libxputty 0.1
Loading...
Searching...
No Matches
xlabel.c
Go to the documentation of this file.
1/*
2 * 0BSD
3 *
4 * BSD Zero Clause License
5 *
6 * Copyright (c) 2019 Hermann Meyer
7 *
8 * Permission to use, copy, modify, and/or distribute this software for any
9 * purpose with or without fee is hereby granted.
10
11 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
12 * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
13 * AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
14 * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
15 * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
16 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
17 * PERFORMANCE OF THIS SOFTWARE.
18 *
19 */
20
21
22#include "xlabel.h"
23#include "xlabel_private.h"
24
25
26Widget_t* add_label(Widget_t *parent, const char * label,
27 int x, int y, int width, int height) {
28
29 Widget_t *wid = create_widget(parent->app, parent, x, y, width, height);
30 wid->label = label;
31 wid->scale.gravity = ASPECT;
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
Widget_t * add_label(Widget_t *parent, const char *label, int x, int y, int width, int height)
add_label - add a label to a Widget_t
Definition xlabel.c:26
void _draw_label(void *w_, void *user_data)
_draw_label - internal draw the label 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
@ ASPECT
Definition xwidget.h:322