[gtk+] notebook: Implement height_for_width and width_for_height getters
- From: Benjamin Otte <otte src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+] notebook: Implement height_for_width and width_for_height getters
- Date: Wed, 1 Jun 2011 22:09:17 +0000 (UTC)
commit 352569298a739f897f17b36e084f129f2c212a10
Author: Benjamin Otte <otte redhat com>
Date: Wed Jun 1 23:37:21 2011 +0200
notebook: Implement height_for_width and width_for_height getters
gtk/gtknotebook.c | 29 +++++++++++++++++++++++++++++
1 files changed, 29 insertions(+), 0 deletions(-)
---
diff --git a/gtk/gtknotebook.c b/gtk/gtknotebook.c
index f8457b5..88835d3 100644
--- a/gtk/gtknotebook.c
+++ b/gtk/gtknotebook.c
@@ -332,6 +332,16 @@ static void gtk_notebook_get_preferred_width (GtkWidget *widget,
static void gtk_notebook_get_preferred_height(GtkWidget *widget,
gint *minimum,
gint *natural);
+static void gtk_notebook_get_preferred_width_for_height
+ (GtkWidget *widget,
+ gint height,
+ gint *minimum,
+ gint *natural);
+static void gtk_notebook_get_preferred_height_for_width
+ (GtkWidget *widget,
+ gint width,
+ gint *minimum,
+ gint *natural);
static void gtk_notebook_size_allocate (GtkWidget *widget,
GtkAllocation *allocation);
static gint gtk_notebook_draw (GtkWidget *widget,
@@ -635,6 +645,8 @@ gtk_notebook_class_init (GtkNotebookClass *class)
widget_class->unrealize = gtk_notebook_unrealize;
widget_class->get_preferred_width = gtk_notebook_get_preferred_width;
widget_class->get_preferred_height = gtk_notebook_get_preferred_height;
+ widget_class->get_preferred_width_for_height = gtk_notebook_get_preferred_width_for_height;
+ widget_class->get_preferred_height_for_width = gtk_notebook_get_preferred_height_for_width;
widget_class->size_allocate = gtk_notebook_size_allocate;
widget_class->draw = gtk_notebook_draw;
widget_class->button_press_event = gtk_notebook_button_press;
@@ -2336,6 +2348,23 @@ gtk_notebook_size_request (GtkWidget *widget,
}
}
+static void
+gtk_notebook_get_preferred_width_for_height (GtkWidget *widget,
+ gint height,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_notebook_size_request (widget, GTK_ORIENTATION_HORIZONTAL, height, minimum, natural);
+}
+
+static void
+gtk_notebook_get_preferred_height_for_width (GtkWidget *widget,
+ gint width,
+ gint *minimum,
+ gint *natural)
+{
+ gtk_notebook_size_request (widget, GTK_ORIENTATION_VERTICAL, width, minimum, natural);
+}
static void
gtk_notebook_get_preferred_width (GtkWidget *widget,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]