diff options
author | Tim Janik <timj@gimp.org> | 1998-02-27 16:31:06 +0000 |
---|---|---|
committer | Tim Janik <timj@src.gnome.org> | 1998-02-27 16:31:06 +0000 |
commit | 693fa02b839c54d0670f39df3f6dfde98a4d7788 (patch) | |
tree | 6213e60524c0c7e9d7bb469b0f9cdaf38ea60f6b /gtk/gtkframe.c | |
parent | a36ffb12a5e730c6f811bdf4c53ad0f1ffc95161 (diff) | |
download | gtk+-693fa02b839c54d0670f39df3f6dfde98a4d7788.tar.gz |
we make an active server grab now, this way we can change the cursor
Fri Feb 27 15:31:55 1998 Tim Janik <timj@gimp.org>
* gtk/gtktipsquery.c: we make an active server grab now, this way we
can change the cursor globally and don't need to tweak event masks
of other windows.
* gtk/gtkframe.c (gtk_frame_style_set): recompute label size.
* gtk/gtkwidget.h:
* gtk/gtkwidget.c:
New signal GtkWidget::style_set to be emitted when a widget's style
changed. New flag GTK_RC_STYLE to indicate whether an rc lookup has
been perfomed for the widget.
(gtk_widget_ensure_style): New function.
(gtk_widget_set_rc_style): New function.
* docs/styles.txt: new file.
Diffstat (limited to 'gtk/gtkframe.c')
-rw-r--r-- | gtk/gtkframe.c | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/gtk/gtkframe.c b/gtk/gtkframe.c index f2c29702e7..d1f5189c3c 100644 --- a/gtk/gtkframe.c +++ b/gtk/gtkframe.c @@ -46,6 +46,8 @@ static void gtk_frame_size_request (GtkWidget *widget, GtkRequisition *requisition); static void gtk_frame_size_allocate (GtkWidget *widget, GtkAllocation *allocation); +static void gtk_frame_style_set (GtkWidget *widget, + GtkStyle *previous_style); static GtkBinClass *parent_class = NULL; @@ -97,6 +99,7 @@ gtk_frame_class_init (GtkFrameClass *class) widget_class->expose_event = gtk_frame_expose; widget_class->size_request = gtk_frame_size_request; widget_class->size_allocate = gtk_frame_size_allocate; + widget_class->style_set = gtk_frame_style_set; } static void @@ -174,6 +177,25 @@ gtk_frame_new (const gchar *label) return GTK_WIDGET (frame); } +static void +gtk_frame_style_set (GtkWidget *widget, + GtkStyle *previous_style) +{ + GtkFrame *frame; + + frame = GTK_FRAME (widget); + + if (frame->label) + { + frame->label_width = gdk_string_measure (GTK_WIDGET (frame)->style->font, frame->label) + 7; + frame->label_height = (GTK_WIDGET (frame)->style->font->ascent + + GTK_WIDGET (frame)->style->font->descent + 1); + } + + if (GTK_WIDGET_CLASS (parent_class)->style_set) + GTK_WIDGET_CLASS (parent_class)->style_set (widget, previous_style); +} + void gtk_frame_set_label (GtkFrame *frame, const gchar *label) |