Hey Dok, On Sat, 2008-05-03 at 00:28 +0200, Denis Oliver Kropp wrote: > That's great! Thanks for your work! > > LiTE will be continued. I also got other patches to integrate, e.g. > checkboxes, lists and scrolled views... :) > > I'll integrate these and your patch as soon as possible (tomorrow).
Ok, good to hear. Feel free to merge as you want or throw away my patches in case you implemented that in a more general way. Just for the sake of completeness, this patch demonstrates how to use new button feature. I missed to include that in my last patch unfortunately. Daniel
diff --git a/examples/simple.c b/examples/simple.c index 8e3f7c6..8db4e3b 100644 --- a/examples/simple.c +++ b/examples/simple.c @@ -43,6 +43,11 @@ button_pressed( LiteButton *button, void *ctx ) lite_close_window( LITE_WINDOW(ctx) ); } +static void +toggle_button_pressed( LiteButton *button, void *ctx ) +{ +} + int main (int argc, char *argv[]) { @@ -81,9 +86,12 @@ main (int argc, char *argv[]) /* setup the textline */ rect.x = 10; rect.y = 40; rect.w = 100; rect.h = 20; res = lite_new_textline(LITE_BOX(window), &rect, liteNoTextLineTheme, &textline); + + rect.x = 10; rect.y = 60; rect.w = 100; rect.h = 20; + res = lite_new_textline(LITE_BOX(window), &rect, liteNoTextLineTheme, &textline); /* setup the button */ - rect.x = 230; rect.y = 130; rect.w = 50; rect.h = 50; + rect.x = 180; rect.y = 130; rect.w = 50; rect.h = 50; res = lite_new_button(LITE_BOX(window), &rect, liteNoButtonTheme, &button); lite_set_button_image( button, LITE_BS_NORMAL, EXAMPLESDATADIR "/stop.png" ); @@ -92,6 +100,20 @@ main (int argc, char *argv[]) lite_set_button_image( button, LITE_BS_PRESSED, EXAMPLESDATADIR "/stop_pressed.png" ); lite_on_button_press( button, button_pressed, window ); + + /* 2nd button */ + rect.x = 230; rect.y = 130; rect.w = 50; rect.h = 50; + res = lite_new_button(LITE_BOX(window), &rect, liteNoButtonTheme, &button); + lite_set_button_type( button, LITE_BT_TOGGLE ); + + lite_set_button_image( button, LITE_BS_NORMAL, EXAMPLESDATADIR "/toggle.png" ); + lite_set_button_image( button, LITE_BS_DISABLED, EXAMPLESDATADIR "/toggle_disabled.png" ); + lite_set_button_image( button, LITE_BS_HILITE, EXAMPLESDATADIR "/toggle_highlighted.png" ); + lite_set_button_image( button, LITE_BS_PRESSED, EXAMPLESDATADIR "/toggle_pressed.png" ); + lite_set_button_image( button, LITE_BS_HILITE_ON, EXAMPLESDATADIR "/toggle_highlighted_on.png" ); + lite_set_button_image( button, LITE_BS_DISABLED_ON, EXAMPLESDATADIR "/toggle_disabled_on.png" ); + + lite_on_button_press( button, toggle_button_pressed, window ); /* setup the image */ rect.x = 200; rect.y = 20; rect.w = 64; rect.h = 50;
_______________________________________________ directfb-dev mailing list directfb-dev@directfb.org http://mail.directfb.org/cgi-bin/mailman/listinfo/directfb-dev