diff --git a/ChangeLog b/ChangeLog index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-0 b/ChangeLog.pre-2-0 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-0 +++ b/ChangeLog.pre-2-0 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-10 b/ChangeLog.pre-2-10 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-10 +++ b/ChangeLog.pre-2-10 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-2 b/ChangeLog.pre-2-2 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-2 +++ b/ChangeLog.pre-2-2 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-4 b/ChangeLog.pre-2-4 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-4 +++ b/ChangeLog.pre-2-4 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-6 b/ChangeLog.pre-2-6 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-6 +++ b/ChangeLog.pre-2-6 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/ChangeLog.pre-2-8 b/ChangeLog.pre-2-8 index 8d9fc65d25..915963aee1 100644 --- a/ChangeLog.pre-2-8 +++ b/ChangeLog.pre-2-8 @@ -1,5 +1,9 @@ Sun Mar 15 08:27:06 1998 Tim Janik + * gtk/gtktipsquery.c (gtk_tips_query_set_labels): changed run type + of GtkTipsQuery::widget_entered to GTK_RUN_LAST, so it can be overidden + by the user. + * gtk/gtkwindow.c (gtk_window_configure_event): small fix by Assar Westerlund . diff --git a/gtk/gtktipsquery.c b/gtk/gtktipsquery.c index 657432af6f..6c1b1b90c9 100644 --- a/gtk/gtktipsquery.c +++ b/gtk/gtktipsquery.c @@ -175,7 +175,7 @@ gtk_tips_query_class_init (GtkTipsQueryClass *class) GTK_TYPE_NONE, 0); tips_query_signals[SIGNAL_WIDGET_ENTERED] = gtk_signal_new ("widget_entered", - GTK_RUN_FIRST, + GTK_RUN_LAST, object_class->type, GTK_SIGNAL_OFFSET (GtkTipsQueryClass, widget_entered), gtk_tips_query_marshal_widget_entered, diff --git a/gtk/testgtk.c b/gtk/testgtk.c index 735b0d74ac..068666749d 100644 --- a/gtk/testgtk.c +++ b/gtk/testgtk.c @@ -1731,8 +1731,23 @@ create_pixmap () gtk_widget_destroy (window); } +static void +tips_query_widget_entered (GtkTipsQuery *tips_query, + GtkWidget *widget, + const gchar *tip_text, + const gchar *tip_private, + GtkWidget *toggle) +{ + if (GTK_TOGGLE_BUTTON (toggle)->active) + { + gtk_label_set (GTK_LABEL (tips_query), tip_text ? "There is a Tip!" : "There is no Tip!"); + /* don't let GtkTipsQuery reset it's label */ + gtk_signal_emit_stop_by_name (GTK_OBJECT (tips_query), "widget_entered"); + } +} + static gint -tips_query_widget_selected (GtkObject *object, +tips_query_widget_selected (GtkWidget *tips_query, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private, @@ -1742,7 +1757,7 @@ tips_query_widget_selected (GtkObject *object, if (widget) g_print ("Help \"%s\" requested for <%s>\n", tip_private ? tip_private : "None", - gtk_type_name (widget->object.klass->type)); + gtk_type_name (GTK_OBJECT_TYPE (widget))); return TRUE; } @@ -1755,6 +1770,7 @@ create_tooltips () GtkWidget *box2; GtkWidget *box3; GtkWidget *button; + GtkWidget *toggle; GtkWidget *frame; GtkWidget *tips_query; GtkWidget *separator; @@ -1801,16 +1817,16 @@ create_tooltips () gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); - gtk_tooltips_set_tip (tooltips,button,"This is button 2", "ContextHelp/buttons/2"); - - button = gtk_toggle_button_new_with_label ("button3"); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - gtk_tooltips_set_tip (tooltips, button, - "This is button 3. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", - "ContextHelp/buttons/3_long"); + "This is button 2. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", + "ContextHelp/buttons/2_long"); + + toggle = gtk_toggle_button_new_with_label ("Override TipsQuery Label"); + gtk_box_pack_start (GTK_BOX (box2), toggle, TRUE, TRUE, 0); + gtk_widget_show (toggle); + + gtk_tooltips_set_tip (tooltips, toggle, "Toggle TipsQuery view.", "Hi msw! ;)"); box3 = gtk_widget_new (gtk_vbox_get_type (), @@ -1840,6 +1856,7 @@ create_tooltips () "GtkWidget::visible", TRUE, "GtkWidget::parent", box3, "GtkTipsQuery::caller", button, + "GtkObject::signal::widget_entered", tips_query_widget_entered, toggle, "GtkObject::signal::widget_selected", tips_query_widget_selected, NULL, NULL); diff --git a/tests/testgtk.c b/tests/testgtk.c index 735b0d74ac..068666749d 100644 --- a/tests/testgtk.c +++ b/tests/testgtk.c @@ -1731,8 +1731,23 @@ create_pixmap () gtk_widget_destroy (window); } +static void +tips_query_widget_entered (GtkTipsQuery *tips_query, + GtkWidget *widget, + const gchar *tip_text, + const gchar *tip_private, + GtkWidget *toggle) +{ + if (GTK_TOGGLE_BUTTON (toggle)->active) + { + gtk_label_set (GTK_LABEL (tips_query), tip_text ? "There is a Tip!" : "There is no Tip!"); + /* don't let GtkTipsQuery reset it's label */ + gtk_signal_emit_stop_by_name (GTK_OBJECT (tips_query), "widget_entered"); + } +} + static gint -tips_query_widget_selected (GtkObject *object, +tips_query_widget_selected (GtkWidget *tips_query, GtkWidget *widget, const gchar *tip_text, const gchar *tip_private, @@ -1742,7 +1757,7 @@ tips_query_widget_selected (GtkObject *object, if (widget) g_print ("Help \"%s\" requested for <%s>\n", tip_private ? tip_private : "None", - gtk_type_name (widget->object.klass->type)); + gtk_type_name (GTK_OBJECT_TYPE (widget))); return TRUE; } @@ -1755,6 +1770,7 @@ create_tooltips () GtkWidget *box2; GtkWidget *box3; GtkWidget *button; + GtkWidget *toggle; GtkWidget *frame; GtkWidget *tips_query; GtkWidget *separator; @@ -1801,16 +1817,16 @@ create_tooltips () gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); gtk_widget_show (button); - gtk_tooltips_set_tip (tooltips,button,"This is button 2", "ContextHelp/buttons/2"); - - button = gtk_toggle_button_new_with_label ("button3"); - gtk_box_pack_start (GTK_BOX (box2), button, TRUE, TRUE, 0); - gtk_widget_show (button); - gtk_tooltips_set_tip (tooltips, button, - "This is button 3. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", - "ContextHelp/buttons/3_long"); + "This is button 2. This is also a really long tooltip which probably won't fit on a single line and will therefore need to be wrapped. Hopefully the wrapping will work correctly.", + "ContextHelp/buttons/2_long"); + + toggle = gtk_toggle_button_new_with_label ("Override TipsQuery Label"); + gtk_box_pack_start (GTK_BOX (box2), toggle, TRUE, TRUE, 0); + gtk_widget_show (toggle); + + gtk_tooltips_set_tip (tooltips, toggle, "Toggle TipsQuery view.", "Hi msw! ;)"); box3 = gtk_widget_new (gtk_vbox_get_type (), @@ -1840,6 +1856,7 @@ create_tooltips () "GtkWidget::visible", TRUE, "GtkWidget::parent", box3, "GtkTipsQuery::caller", button, + "GtkObject::signal::widget_entered", tips_query_widget_entered, toggle, "GtkObject::signal::widget_selected", tips_query_widget_selected, NULL, NULL);