diff options
| author | [email protected] <[email protected]> | 2011-06-05 15:16:41 +0000 |
|---|---|---|
| committer | [email protected] <[email protected]> | 2011-06-05 15:16:41 +0000 |
| commit | bbf68d15e513d4799f651acd4fd9f88fe3a03ffd (patch) | |
| tree | 373cff350b3df4b8326df7a6e698a41a9f496c19 /components/rtgui/widgets | |
| parent | b936b13ed25d596694517bff813c0c72c3769b3c (diff) | |
change graphic driver as RT-Thread device driver
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@1454 bbd45198-f89e-11dd-88c7-29a3b14d5316
Diffstat (limited to 'components/rtgui/widgets')
| -rw-r--r-- | components/rtgui/widgets/widget.c | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/components/rtgui/widgets/widget.c b/components/rtgui/widgets/widget.c index 32280c3d58..91a14ac27e 100644 --- a/components/rtgui/widgets/widget.c +++ b/components/rtgui/widgets/widget.c @@ -56,7 +56,7 @@ static void _rtgui_widget_constructor(rtgui_widget_t *widget) #endif /* set default event handler */ - widget->event_handler = rtgui_widget_event_handler; + rtgui_widget_set_event_handler(widget,rtgui_widget_event_handler); /* init user data private to 0 */ widget->user_data = 0; @@ -132,6 +132,16 @@ void rtgui_widget_set_rect(rtgui_widget_t* widget, const rtgui_rect_t* rect) } } +void rtgui_widget_set_rectangle(rtgui_widget_t* widget, int x, int y, int width, int height) +{ + rtgui_rect_t rect; + + rect.x1 = x; rect.y1 = y; + rect.x2 = x + width; rect.y2 = y + height; + + rtgui_widget_set_rect(widget, &rect); +} + void rtgui_widget_set_parent(rtgui_widget_t* widget, rtgui_widget_t* parent) { /* set parent and toplevel widget */ |
