[gtk+/treeview-refactor] examples/gtkdial: Do not use size_request vfunc



commit df5286f11e5f89ebb74162af28bb702506e822a5
Author: Javier Jardón <jjardon gnome org>
Date:   Thu Nov 11 05:03:06 2010 +0100

    examples/gtkdial: Do not use size_request vfunc

 examples/gtkdial/gtkdial.c |   29 +++++++++++++++++++++--------
 1 files changed, 21 insertions(+), 8 deletions(-)
---
diff --git a/examples/gtkdial/gtkdial.c b/examples/gtkdial/gtkdial.c
index a347501..39338f6 100644
--- a/examples/gtkdial/gtkdial.c
+++ b/examples/gtkdial/gtkdial.c
@@ -33,8 +33,12 @@ static void gtk_dial_class_init               (GtkDialClass     *klass);
 static void gtk_dial_init                     (GtkDial          *dial);
 static void gtk_dial_destroy                  (GtkWidget        *widget);
 static void gtk_dial_realize                  (GtkWidget        *widget);
-static void gtk_dial_size_request             (GtkWidget        *widget,
-                                               GtkRequisition   *requisition);
+static void gtk_dial_get_preferred_width      (GtkWidget        *widget,
+                                               gint             *minimum,
+                                               gint             *natural);
+static void gtk_dial_get_preferred_heigh      (GtkWidget        *widget,
+                                               gint             *minimum,
+                                               gint             *natural);
 static void gtk_dial_size_allocate            (GtkWidget        *widget,
                                                GtkAllocation    *allocation);
 static gboolean gtk_dial_expose               (GtkWidget        *widget,
@@ -96,7 +100,8 @@ gtk_dial_class_init (GtkDialClass *class)
   widget_class->destroy = gtk_dial_destroy;
   widget_class->realize = gtk_dial_realize;
   widget_class->expose_event = gtk_dial_expose;
-  widget_class->size_request = gtk_dial_size_request;
+  widget_class->get_preferred_width = gtk_dial_get_preferred_width;
+  widget_class->get_preferred_height = gtk_dial_get_preferred_height;
   widget_class->size_allocate = gtk_dial_size_allocate;
   widget_class->button_press_event = gtk_dial_button_press;
   widget_class->button_release_event = gtk_dial_button_release;
@@ -237,12 +242,20 @@ gtk_dial_realize (GtkWidget *widget)
   gtk_style_set_background (widget->style, widget->window, GTK_STATE_ACTIVE);
 }
 
-static void 
-gtk_dial_size_request (GtkWidget      *widget,
-		       GtkRequisition *requisition)
+static void
+gtk_dial_get_preferred_width (GtkWidget *widget,
+                              gint      *minimum,
+                              gint      *natural);
+{
+  *minimum = *natural = DIAL_DEFAULT_SIZE;
+}
+
+static void
+gtk_dial_get_preferred_heigh (GtkWidget *widget,
+                              gint      *minimum,
+                              gint      *natural);
 {
-  requisition->width = DIAL_DEFAULT_SIZE;
-  requisition->height = DIAL_DEFAULT_SIZE;
+  *minimum = *natural = DIAL_DEFAULT_SIZE;
 }
 
 static void



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]