[gnome-games] gnomine: Use get_preferred_{width, height} instead of size_request
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-games] gnomine: Use get_preferred_{width, height} instead of size_request
- Date: Sat, 30 Oct 2010 17:02:52 +0000 (UTC)
commit 8234a19903b53d4acfaf8d47af59c4aa722f87be
Author: Matthias Clasen <mclasen redhat com>
Date: Sat Oct 30 18:57:12 2010 +0200
gnomine: Use get_preferred_{width,height} instead of size_request
gnomine/minefield.c | 18 ++++++++++++++----
1 files changed, 14 insertions(+), 4 deletions(-)
---
diff --git a/gnomine/minefield.c b/gnomine/minefield.c
index f2ca8e0..9534ffc 100644
--- a/gnomine/minefield.c
+++ b/gnomine/minefield.c
@@ -415,12 +415,21 @@ gtk_minefield_size_allocate (GtkWidget * widget, GtkAllocation * allocation)
}
static void
-gtk_minefield_size_request (GtkWidget * widget, GtkRequisition * requisition)
+gtk_minefield_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural)
{
GtkMineField *mf = GTK_MINEFIELD (widget);
+
+ /* request the minimum size - to allow the widget window to be resized */
+ *minimum = *natural = mf->xsize * MINESIZE_MIN;
+}
+
+static void
+gtk_minefield_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural)
+{
+ GtkMineField *mf = GTK_MINEFIELD (widget);
+
/* request the minimum size - to allow the widget window to be resized */
- requisition->width = mf->xsize * MINESIZE_MIN;
- requisition->height = mf->ysize * MINESIZE_MIN;
+ *minimum = *natural = mf->ysize * MINESIZE_MIN;
}
static void
@@ -1199,7 +1208,8 @@ gtk_minefield_class_init (GtkMineFieldClass * class)
widget_class->realize = gtk_minefield_realize;
widget_class->unrealize = gtk_minefield_unrealize;
widget_class->size_allocate = gtk_minefield_size_allocate;
- widget_class->size_request = gtk_minefield_size_request;
+ widget_class->get_preferred_width = gtk_minefield_get_preferred_width;
+ widget_class->get_preferred_height = gtk_minefield_get_preferred_height;
widget_class->expose_event = gtk_minefield_expose;
widget_class->button_press_event = gtk_minefield_button_press;
widget_class->button_release_event = gtk_minefield_button_release;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]