summaryrefslogtreecommitdiff
path: root/gtk/gtktogglebutton.c
diff options
context:
space:
mode:
authorOwen Taylor <otaylor@redhat.com>1998-11-06 16:03:17 +0000
committerOwen Taylor <otaylor@src.gnome.org>1998-11-06 16:03:17 +0000
commit093032a4c1940919ef403556d4912f371c3bfc24 (patch)
tree78ec24e0d6ce2d84453f27ba496673f53206db8e /gtk/gtktogglebutton.c
parent4b0e615fc5e2ab8c996f08e5401ba459eca7f078 (diff)
downloadgtk+-themes-2.tar.gz
Queue a clear/redraw, not just a redraw, so the focus gets undrawnthemes-2
Thu Nov 5 12:06:16 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkcheckbutton.c (gtk_check_button_draw_focus): Queue a clear/redraw, not just a redraw, so the focus gets undrawn properly. * gtk/gtktogglebutton.c (gtk_toggle_button_unrealize): Chain to gtk_widget_unrealize() instead of duplicating code. Wed Nov 4 14:34:51 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdk.c gdk/gdkprivate.h gdk/gdkwindow.c: Removed last vestiges of old DND. Tue Nov 3 12:27:52 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c: Restored inner border to entries, erase cursors to background image. Fri Oct 30 12:09:21 1998 Owen Taylor <otaylor@redhat.com> * gtk/gtkentry.c gtk/gtkstyle.[ch]: removed paint_entry() - it was identical to paint_flat_box(). * gtk/gtkstyle.c: Coding style fixups. * gtk/gtkwindow.c (gtk_window_move_resize): removed useless test. * gtk/gtkframe.c gtkstyle.[ch] gtknotebook.c: Change 'side' for paint_[box/shadow]_gap and paint_extension to be GtkPositionType instead of a random int. * gtk/gtkaspectframe.c (gtk_aspect_frame_paint): Use "frame" as detail - an aspectframe should draw identical to a frame. Tue Oct 27 09:58:11 1998 Owen Taylor <otaylor@redhat.com> * gdk/gdkwindow.c (gdk_window_merge_child_shapes): renamed from combine_child_shapes(). * gdk/gdkwindow.c: Merge propagate_shapes() and propagate_combine_shapes() to remove code duplication.
Diffstat (limited to 'gtk/gtktogglebutton.c')
-rw-r--r--gtk/gtktogglebutton.c49
1 files changed, 14 insertions, 35 deletions
diff --git a/gtk/gtktogglebutton.c b/gtk/gtktogglebutton.c
index b87ecb0a3e..cd8e6e04e2 100644
--- a/gtk/gtktogglebutton.c
+++ b/gtk/gtktogglebutton.c
@@ -52,12 +52,12 @@ static void gtk_toggle_button_set_arg (GtkObject *object,
static void gtk_toggle_button_get_arg (GtkObject *object,
GtkArg *arg,
guint arg_id);
-static void gtk_toggle_button_leave (GtkButton *button);
-static void gtk_toggle_button_realize (GtkWidget *widget);
-static void gtk_toggle_button_unrealize (GtkWidget *widget);
+static void gtk_toggle_button_leave (GtkButton *button);
+static void gtk_toggle_button_realize (GtkWidget *widget);
+static void gtk_toggle_button_unrealize (GtkWidget *widget);
static guint toggle_button_signals[LAST_SIGNAL] = { 0 };
-
+static GtkContainerClass *parent_class = NULL;
GtkType
gtk_toggle_button_get_type (void)
@@ -97,6 +97,8 @@ gtk_toggle_button_class_init (GtkToggleButtonClass *class)
container_class = (GtkContainerClass*) class;
button_class = (GtkButtonClass*) class;
+ parent_class = gtk_type_class (GTK_TYPE_BUTTON);
+
gtk_object_add_arg_type ("GtkToggleButton::active", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_ACTIVE);
gtk_object_add_arg_type ("GtkToggleButton::draw_indicator", GTK_TYPE_BOOL, GTK_ARG_READWRITE, ARG_DRAW_INDICATOR);
@@ -214,19 +216,10 @@ gtk_toggle_button_set_mode (GtkToggleButton *toggle_button,
{
if (GTK_WIDGET_REALIZED(toggle_button))
{
- if (GTK_WIDGET_VISIBLE (toggle_button))
- {
- gtk_widget_unrealize(GTK_WIDGET(toggle_button));
- toggle_button->draw_indicator = draw_indicator;
- gtk_widget_realize(GTK_WIDGET(toggle_button));
- gtk_widget_show(GTK_WIDGET(toggle_button));
- }
- else
- {
- gtk_widget_unrealize(GTK_WIDGET(toggle_button));
- toggle_button->draw_indicator = draw_indicator;
- gtk_widget_realize(GTK_WIDGET(toggle_button));
- }
+ gtk_widget_unrealize(GTK_WIDGET(toggle_button));
+ toggle_button->draw_indicator = draw_indicator;
+ gtk_widget_realize(GTK_WIDGET(toggle_button));
+ gtk_widget_show(GTK_WIDGET(toggle_button));
}
else
toggle_button->draw_indicator = draw_indicator;
@@ -508,31 +501,17 @@ gtk_toggle_button_unrealize (GtkWidget *widget)
GtkToggleButton *toggle_button;
g_return_if_fail (widget != NULL);
- g_return_if_fail (GTK_IS_WIDGET (widget));
+ g_return_if_fail (GTK_IS_TOGGLE_BUTTON (widget));
toggle_button = GTK_TOGGLE_BUTTON (widget);
- GTK_WIDGET_UNSET_FLAGS (widget, GTK_REALIZED | GTK_MAPPED);
- gtk_style_detach (widget->style);
-
if (toggle_button->draw_indicator)
{
gdk_window_set_user_data (toggle_button->event_window, NULL);
gdk_window_destroy (toggle_button->event_window);
- gdk_window_unref (widget->window);
+ toggle_button->event_window = NULL;
}
- else
- {
- gdk_window_set_user_data (widget->window, NULL);
- gdk_window_destroy (widget->window);
- }
- widget->window = NULL;
- toggle_button->event_window = NULL;
- /* Unrealize afterwards to improve visual effect */
-
- if (GTK_IS_CONTAINER (widget))
- gtk_container_foreach (GTK_CONTAINER (widget),
- (GtkCallback) gtk_widget_unrealize,
- NULL);
+ if (GTK_WIDGET_CLASS (parent_class)->unrealize)
+ (* GTK_WIDGET_CLASS (parent_class)->unrealize) (widget);
}