[maemo-developers] [maemo-developers] gtk-infoprint
From: Laszlo T. tlacix at gmail.comDate: Fri May 26 17:39:55 EEST 2006
- Previous message: [maemo-developers] gtk-infoprint
- Next message: [maemo-developers] gtk-infoprint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
> > Hello, > > > > /* For another example: */ > > > > #include <hildon-widgets/hildon-app.h> > #include <hildon-widgets/hildon-appview.h> > #include <hildon-widgets/gtk-infoprint.h> > #include <gtk/gtk.h> > > > > static gint infoprint_type = 1; > > > /* Callback to show infoprints */ > void show_infoprint(GtkButton * widget, HildonApp * app) > { > switch (infoprint_type) { > case 1: /* no animation, only sleep */ > /* gtk_infoprint(GTK_WINDOW(app), "Hi there!"); */ > gtk_banner_show_animation(GTK_WINDOW(app), "Hi there!"); > sleep(5); > gtk_banner_close( GTK_WINDOW(app) ); > break; > > case 2: /* animation AFTER the sleep, I don't understand. */ > /* gtk_infoprint_with_icon_stock(GTK_WINDOW(app), > "This is save icon", > GTK_STOCK_SAVE);*/ > gtk_banner_show_animation(GTK_WINDOW(app), "Hi there!"); > sleep(5); > break; > > case 3: /* close the banner */ > /* gtk_banner_show_bar(GTK_WINDOW(app), "Info with progress bar"); > gtk_banner_set_fraction(GTK_WINDOW(app), 0.2); */ > gtk_banner_close( GTK_WINDOW(app) ); > break; > > case 4: > /* With fifth click, end the application */ > gtk_main_quit(); > } > > /* Increase the counter */ > infoprint_type++; > } > > > > > > /* Main application */ > int main(int argc, char *argv[]) > { > /* Create needed variables */ > HildonApp *app; > HildonAppView *appview; > GtkWidget *main_vbox; > GtkWidget *button1; > > /* Initialize the GTK. */ > gtk_init(&argc, &argv); > > /* Create the hildon application and setup the title */ > app = HILDON_APP(hildon_app_new()); > hildon_app_set_title(app, "App Title"); > hildon_app_set_two_part_title(app, TRUE); > > /* Create HildonAppView and set it to HildonApp */ > appview = HILDON_APPVIEW(hildon_appview_new("AppView Title")); > hildon_app_set_appview(app, appview); > > /* Add vbox to appview */ > main_vbox = gtk_vbox_new(FALSE, 0); > gtk_container_add(GTK_CONTAINER(appview), main_vbox); > > /* Add button to vbox */ > button1 = gtk_button_new_with_label("Show Info"); > gtk_box_pack_start(GTK_BOX(main_vbox), button1, FALSE, TRUE, 0); > > /* Add signal listener to button */ > g_signal_connect(G_OBJECT(button1), "clicked", > G_CALLBACK(show_infoprint), app); > > /* Begin the main application */ > gtk_widget_show_all(GTK_WIDGET(app)); > gtk_main(); > > /* Exit */ > return 0; > } > > > Thanks, > Laci > ??? -------------- next part -------------- An HTML attachment was scrubbed... URL: http://lists.maemo.org/pipermail/maemo-developers/attachments/20060526/ec33f93a/attachment.htm
- Previous message: [maemo-developers] gtk-infoprint
- Next message: [maemo-developers] gtk-infoprint
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]