summaryrefslogtreecommitdiff
path: root/gtk/gtksizerequest.c
diff options
context:
space:
mode:
authorTristan Van Berkom <tristan.van.berkom@gmail.com>2011-01-28 15:54:50 +0900
committerTristan Van Berkom <tristan.van.berkom@gmail.com>2011-01-28 15:58:07 +0900
commit5a5854f6f64231be8df028dbcb87f75a8025609e (patch)
tree733f5fb20f1e09f8e4d69b0fa67030bdca7dafda /gtk/gtksizerequest.c
parentea6e57412f09435278ec1e21280bb5527d96350b (diff)
downloadgtk+-5a5854f6f64231be8df028dbcb87f75a8025609e.tar.gz
Add default class implementation of gtk_widget_get_request_mode().
Instead of checking if klass->get_request_mode is != NULL from the gtk_widget_get_request_mode() api, this allows classes to trust that there is a default implementation and chain up (specifically added this for gtkmm wrapper objects).
Diffstat (limited to 'gtk/gtksizerequest.c')
-rw-r--r--gtk/gtksizerequest.c9
1 files changed, 1 insertions, 8 deletions
diff --git a/gtk/gtksizerequest.c b/gtk/gtksizerequest.c
index 272f2ebfbe..ef96ed0402 100644
--- a/gtk/gtksizerequest.c
+++ b/gtk/gtksizerequest.c
@@ -370,16 +370,9 @@ compute_size_for_orientation (GtkWidget *widget,
GtkSizeRequestMode
gtk_widget_get_request_mode (GtkWidget *widget)
{
- GtkWidgetClass *klass;
-
g_return_val_if_fail (GTK_IS_WIDGET (widget), GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH);
- klass = GTK_WIDGET_GET_CLASS (widget);
- if (klass->get_request_mode)
- return klass->get_request_mode (widget);
-
- /* By default widgets are height-for-width. */
- return GTK_SIZE_REQUEST_HEIGHT_FOR_WIDTH;
+ return GTK_WIDGET_GET_CLASS (widget)->get_request_mode (widget);
}
/**