diff options
author | Tim Janik <timj@gimp.org> | 1998-03-15 21:14:28 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-03-15 21:14:28 +0000 |
commit | 16c6ee03aef8819c9057fdf3c22852e843084e2b (patch) | |
tree | b9d3b0e5fc4a5bc3d6b8f3926e4ca79b55db3ee3 /gtk/gtkmisc.c | |
parent | eac28852edc1fce79e9f45f62d95ad116cf490d1 (diff) | |
download | gtk+-16c6ee03aef8819c9057fdf3c22852e843084e2b.tar.gz |
removed the ugly check whether we need gtk_widget_destroy or
Sun Mar 15 20:13:42 1998 Tim Janik <timj@gimp.org>
* gtk/gtkmain.c (gtk_quit_destructor): removed the ugly check whether
we need gtk_widget_destroy or gtk_object_destroy. these functions are
by no means allowed to act differently!
* gtk/gtkmisc.c (gtk_misc_set_alignment): check for _DRAWABLE instead
of _VISIBLE to operate on widget->window.
(gtk_misc_set_padding): likewise.
* gtk/gtkwidget.c: slightly reordered object arguments.
* gtk/gtkobject.c (gtk_object_setv):
* gtk/gtkobject.c (gtk_object_getv):
operator `!' has precedence over `&'.
Diffstat (limited to 'gtk/gtkmisc.c')
-rw-r--r-- | gtk/gtkmisc.c | 25 |
1 files changed, 12 insertions, 13 deletions
diff --git a/gtk/gtkmisc.c b/gtk/gtkmisc.c index 2791e69904..d044e40c2e 100644 --- a/gtk/gtkmisc.c +++ b/gtk/gtkmisc.c @@ -91,22 +91,21 @@ gtk_misc_set_alignment (GtkMisc *misc, { misc->xalign = xalign; misc->yalign = yalign; - + /* clear the area that was allocated before the change - */ - if (GTK_WIDGET_VISIBLE (misc)) + */ + if (GTK_WIDGET_DRAWABLE (misc)) { GtkWidget *widget; - + widget = GTK_WIDGET (misc); gdk_window_clear_area (widget->window, widget->allocation.x, widget->allocation.y, widget->allocation.width, widget->allocation.height); + gtk_widget_queue_draw (GTK_WIDGET (misc)); } - - gtk_widget_queue_draw (GTK_WIDGET (misc)); } } @@ -116,28 +115,28 @@ gtk_misc_set_padding (GtkMisc *misc, gint ypad) { GtkRequisition *requisition; - + g_return_if_fail (misc != NULL); g_return_if_fail (GTK_IS_MISC (misc)); - + if (xpad < 0) xpad = 0; if (ypad < 0) ypad = 0; - + if ((xpad != misc->xpad) || (ypad != misc->ypad)) { requisition = &(GTK_WIDGET (misc)->requisition); requisition->width -= misc->xpad * 2; requisition->height -= misc->ypad * 2; - + misc->xpad = xpad; misc->ypad = ypad; - + requisition->width += misc->xpad * 2; requisition->height += misc->ypad * 2; - - if (GTK_WIDGET (misc)->parent && GTK_WIDGET_VISIBLE (misc)) + + if (GTK_WIDGET_DRAWABLE (misc)) gtk_widget_queue_resize (GTK_WIDGET (misc)); } } |