libxputty 0.1
Loading...
Searching...
No Matches
Functions
xdrawing_area.c File Reference

Go to the source code of this file.

Functions

Widget_tadd_image (Widget_t *parent, const char *label, int x, int y, int width, int height)
 add_image - add a image to a Widget_t
 

Function Documentation

◆ add_image()

Widget_t * add_image ( Widget_t parent,
const char *  label,
int  x,
int  y,
int  width,
int  height 
)

add_image - add a image to a Widget_t

Parameters
*parent- pointer to the Widget_t request the image
*label- Label to show on the image
x,y,width,height- the position/geometry to create the image
Returns
Widget_t* - pointer to the Widget_t image struct

Definition at line 26 of file xdrawing_area.c.

27 {
28
29 Widget_t *wid = create_widget(parent->app, parent, x, y, width, height);
30 wid->label = label;
31 wid->scale.gravity = CENTER;
33 return wid;
34}
xevfunc expose_callback
Definition xwidget.h:85
Gravity gravity
Definition xwidget.h:347
Widget_t - struct to hold the basic Widget_t info.
Definition xwidget.h:457
Resize_t scale
Definition xwidget.h:525
const char * label
Definition xwidget.h:463
Func_t func
Definition xwidget.h:481
Xputty * app
Definition xwidget.h:465
void _draw_image(void *w_, void *user_data)
_draw_image - internal draw the image to the buffer
Widget_t * create_widget(Xputty *app, Widget_t *win, int x, int y, int width, int height)
*create_widget - create a widget A Widget_t could only be created as child of a other Widget_t To...
Definition xwidget.c:265
@ CENTER
Definition xwidget.h:320

References _draw_image(), Widget_t::app, CENTER, create_widget(), Func_t::expose_callback, Widget_t::func, Resize_t::gravity, Widget_t::label, and Widget_t::scale.