diff options
author | Tim Janik <timj@gimp.org> | 1998-03-01 23:29:40 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-03-01 23:29:40 +0000 |
commit | af18ab4305fbf3f913bd57988d3e845d794ae8b5 (patch) | |
tree | 03abdd43558f2b99cee6f32a8cfb61fece3ba4fe /tests | |
parent | 3fb589b2ff76843d840e98ad90de186f43fc2893 (diff) | |
download | gdk-pixbuf-af18ab4305fbf3f913bd57988d3e845d794ae8b5.tar.gz |
complete api change to honour message contexts. unfortunaltely this also
Sun Mar 1 22:59:09 1998 Tim Janik <timj@gimp.org>
* gtk/gtkstatusbar.h:
* gtk/gtkstatusbar.c: complete api change to honour message contexts.
unfortunaltely this also involved argument changes on the signal
emissions which will not be caught by the compiler. your callbacks
should look like:
void message_text_popped (GtkStatusbar *statusbar,
guint context_id,
const gchar *text,
gpointer func_data);
* gtk/gtkwidget.c (gtk_widget_set_rc_style): eliminated bug about
initial signal emission.
(gtk_widget_set_parent): don't ensure style, just call
gtk_widget_set_style_recurse.
(gtk_widget_set_style_recurse): only change a widget's rc styles if
if there has already been a lookup.
* gtk/testgtk.c: adaptions for statusbar widget.
substituted notebook pixmaps with pixmaps from fvwm, since
we don't know where the originals came from.
* gtk/gtkobject.c (gtk_object_data_destroy): call the destroy
notifier with the objects data, not its internal structure.
* gtk/gtkspinbutton.c (gtk_spin_button_button_press): small
fix from lars.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/testgtk.c | 140 |
1 files changed, 85 insertions, 55 deletions
diff --git a/tests/testgtk.c b/tests/testgtk.c index d263dbf61..61619b8ff 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -800,25 +800,26 @@ statusbar_push (GtkWidget *button, sprintf (text, "something %d", statusbar_counter++); - gtk_statusbar_push (statusbar, text); + gtk_statusbar_push (statusbar, 1, text); } static void statusbar_pop (GtkWidget *button, GtkStatusbar *statusbar) { - gtk_statusbar_pop (statusbar); + gtk_statusbar_pop (statusbar, 1); } static void statusbar_steal (GtkWidget *button, GtkStatusbar *statusbar) { - gtk_statusbar_steal (statusbar, 4); + gtk_statusbar_remove (statusbar, 1, 4); } static void statusbar_popped (GtkStatusbar *statusbar, + guint context_id, const gchar *text) { if (!statusbar->messages) @@ -826,6 +827,38 @@ statusbar_popped (GtkStatusbar *statusbar, } static void +statusbar_contexts (GtkWidget *button, + GtkStatusbar *statusbar) +{ + gchar *string; + + string = "any context"; + g_print ("GtkStatusBar: context=\"%s\", context_id=%d\n", + string, + gtk_statusbar_get_context_id (statusbar, string)); + + string = "idle messages"; + g_print ("GtkStatusBar: context=\"%s\", context_id=%d\n", + string, + gtk_statusbar_get_context_id (statusbar, string)); + + string = "some text"; + g_print ("GtkStatusBar: context=\"%s\", context_id=%d\n", + string, + gtk_statusbar_get_context_id (statusbar, string)); + + string = "hit the mouse"; + g_print ("GtkStatusBar: context=\"%s\", context_id=%d\n", + string, + gtk_statusbar_get_context_id (statusbar, string)); + + string = "hit the mouse2"; + g_print ("GtkStatusBar: context=\"%s\", context_id=%d\n", + string, + gtk_statusbar_get_context_id (statusbar, string)); +} + +static void statusbar_dump_stack (GtkWidget *button, GtkStatusbar *statusbar) { @@ -836,7 +869,10 @@ statusbar_dump_stack (GtkWidget *button, GtkStatusbarMsg *msg; msg = list->data; - g_print ("status_id: %d, status_text: \"%s\"\n", msg->status_id, msg->text); + g_print ("context_id: %d, message_id: %d, status_text: \"%s\"\n", + msg->context_id, + msg->message_id, + msg->text); } } @@ -911,6 +947,13 @@ create_statusbar () "GtkObject::signal::clicked", statusbar_dump_stack, statusbar, NULL); + button = gtk_widget_new (gtk_button_get_type (), + "GtkButton::label", "test contexts", + "GtkWidget::visible", TRUE, + "GtkWidget::parent", box2, + "GtkObject::signal::clicked", statusbar_contexts, statusbar, + NULL); + separator = gtk_hseparator_new (); gtk_box_pack_start (GTK_BOX (box1), separator, FALSE, TRUE, 0); gtk_widget_show (separator); @@ -2860,65 +2903,52 @@ GdkBitmap *book_open_mask; GdkBitmap *book_closed_mask; static char * book_open_xpm[] = { -"16 16 11 1", -" c None", -". c #28A22CB228A2", -"X c #FFFFFFFFFFFF", -"o c #F7DEF7DEF7DE", -"O c #000000000000", -"+ c #FFFF6DB60000", -"@ c #CF3CCF3CCF3C", -"# c #FFFFDB6C0000", -"$ c #30C234D330C2", -"% c #C71BC30BC71B", -"& c #D75C6DB60000", +"16 16 4 1", +" c None s None", +". c black", +"X c #808080", +"o c white", " ", " .. ", -" .X. ", -" .oO ... ", -" .+Xo. ..oX.. ", -" .+oXo..XXoX.@..", -" .+ooX.@ooXo.@#.", -" .+XXo.@XooX.@+.", -" .+XoX.@XoXo.@#.", -" .+oXo.@oXXX.@+.", -" .++Xo$@oOO..%#.", -" ..+&X.@.O@@@@+.", -" .++........#.", -" .+..+++++++&$", -" .+++.......$.", -" ... "}; +" .Xo. ... ", +" .Xoo. ..oo. ", +" .Xooo.Xooo... ", +" .Xooo.oooo.X. ", +" .Xooo.Xooo.X. ", +" .Xooo.oooo.X. ", +" .Xooo.Xooo.X. ", +" .Xooo.oooo.X. ", +" .Xoo.Xoo..X. ", +" .Xo.o..ooX. ", +" .X..XXXXX. ", +" ..X....... ", +" .. ", +" "}; static char * book_closed_xpm[] = { -"16 16 12 1", -" c None", -". c #000000000000", -"X c #FFFF6DB60000", -"o c #082008200820", -"O c #AEBA00005144", -"+ c #FFFFDB6C0000", -"@ c #AEBA00000000", -"# c #D75CDB6C0000", -"$ c #28A22CB228A2", -"% c #FFFFFFFFFFFF", -"& c #F7DEF7DEF7DE", -"* c #30C234D330C2", +"16 16 6 1", +" c None s None", +". c black", +"X c red", +"o c yellow", +"O c #808080", +"# c white", " ", " .. ", " ..XX. ", " ..XXXXX. ", -" o.XXXXXXXX. ", -".O+XXXXXXXXX. ", -"o.@#XXXXXXXXX. ", -".X.O+XXXXXXXXXo ", -".XX.@+XXXXXXXX.$", -"oXXX.O+XXXXX..%$", -" .XXX.@+XX..&&&$", -" .XXX.O..&%&%.*", -" .XX$.&&%&.. ", -" .X$&%&.o ", -" .$%.. ", -" .o "}; +" ..XXXXXXXX. ", +".ooXXXXXXXXX. ", +"..ooXXXXXXXXX. ", +".X.ooXXXXXXXXX. ", +".XX.ooXXXXXX.. ", +" .XX.ooXXX..#O ", +" .XX.oo..##OO. ", +" .XX..##OO.. ", +" .X.#OO.. ", +" ..O.. ", +" .. ", +" "}; static void page_switch (GtkWidget *widget, GtkNotebookPage *page, gint page_num) |