[gtk+/scrollable] Fix some oversights
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtk+/scrollable] Fix some oversights
- Date: Mon, 18 Oct 2010 05:02:45 +0000 (UTC)
commit 3152a594ed786735a9a4edee78a98b68b18a0a5e
Author: Matthias Clasen <mclasen redhat com>
Date: Mon Oct 18 01:00:18 2010 -0400
Fix some oversights
Can't set properties on NULL.
gtk/gtk.symbols | 6 ------
gtk/gtklayout.c | 6 ++----
gtk/gtkscrolledwindow.c | 18 ++++++++++++------
3 files changed, 14 insertions(+), 16 deletions(-)
---
diff --git a/gtk/gtk.symbols b/gtk/gtk.symbols
index 8b6258c..1d413ec 100644
--- a/gtk/gtk.symbols
+++ b/gtk/gtk.symbols
@@ -3514,7 +3514,6 @@ gtk_text_view_set_border_window_size
gtk_text_view_set_buffer
gtk_text_view_set_cursor_visible
gtk_text_view_set_editable
-gtk_text_view_set_hadjustment
gtk_text_view_set_indent
gtk_text_view_set_justification
gtk_text_view_set_left_margin
@@ -3524,7 +3523,6 @@ gtk_text_view_set_pixels_below_lines
gtk_text_view_set_pixels_inside_wrap
gtk_text_view_set_right_margin
gtk_text_view_set_tabs
-gtk_text_view_set_vadjustment
gtk_text_view_set_wrap_mode
gtk_text_view_starts_display_line
gtk_text_view_window_to_buffer_coords
@@ -3713,9 +3711,7 @@ gtk_tool_palette_get_drag_item
gtk_tool_palette_set_drag_source
gtk_tool_palette_add_drag_dest
gtk_tool_palette_get_hadjustment
-gtk_tool_palette_set_hadjustment
gtk_tool_palette_get_vadjustment
-gtk_tool_palette_set_vadjustment
gtk_tool_palette_get_drag_target_item G_GNUC_CONST
gtk_tool_palette_get_drag_target_group G_GNUC_CONST
#endif
@@ -4055,7 +4051,6 @@ gtk_tree_view_set_enable_tree_lines
gtk_tree_view_set_expander_column
gtk_tree_view_set_fixed_height_mode
gtk_tree_view_set_grid_lines
-gtk_tree_view_set_hadjustment
gtk_tree_view_set_headers_clickable
gtk_tree_view_set_headers_visible
gtk_tree_view_set_hover_expand
@@ -4074,7 +4069,6 @@ gtk_tree_view_set_show_expanders
gtk_tree_view_set_tooltip_row
gtk_tree_view_set_tooltip_cell
gtk_tree_view_set_tooltip_column
-gtk_tree_view_set_vadjustment
gtk_tree_view_unset_rows_drag_dest
gtk_tree_view_unset_rows_drag_source
gtk_tree_view_columns_autosize
diff --git a/gtk/gtklayout.c b/gtk/gtklayout.c
index 5f71717..36a6ab1 100644
--- a/gtk/gtklayout.c
+++ b/gtk/gtklayout.c
@@ -30,6 +30,8 @@
#include "config.h"
+#undef GTK_DISABLE_DEPRECATED
+
#include "gtklayout.h"
#include "gdkconfig.h"
@@ -128,10 +130,6 @@ static void gtk_layout_style_set (GtkWidget *widget,
static void gtk_layout_set_hadjustment_values (GtkLayout *layout);
static void gtk_layout_set_vadjustment_values (GtkLayout *layout);
-static void gtk_layout_set_hadjustment (GtkLayout *layout,
- GtkAdjustment *adjustment);
-static void gtk_layout_set_vadjustment (GtkLayout *layout,
- GtkAdjustment *adjustment);
G_DEFINE_TYPE_WITH_CODE (GtkLayout, gtk_layout, GTK_TYPE_CONTAINER,
G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL))
diff --git a/gtk/gtkscrolledwindow.c b/gtk/gtkscrolledwindow.c
index 209eebf..48b0d41 100644
--- a/gtk/gtkscrolledwindow.c
+++ b/gtk/gtkscrolledwindow.c
@@ -531,6 +531,7 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
{
GtkScrolledWindowPrivate *priv;
GtkBin *bin;
+ GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
if (hadjustment)
@@ -573,9 +574,11 @@ gtk_scrolled_window_set_hadjustment (GtkScrolledWindow *scrolled_window,
scrolled_window);
gtk_scrolled_window_adjustment_changed (hadjustment, scrolled_window);
- g_object_set (gtk_bin_get_child (bin),
- "hadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)),
- NULL);
+ child = gtk_bin_get_child (bin);
+ if (child)
+ g_object_set (child,
+ "hadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->hscrollbar)),
+ NULL);
g_object_notify (G_OBJECT (scrolled_window), "hadjustment");
}
@@ -593,6 +596,7 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
{
GtkScrolledWindowPrivate *priv;
GtkBin *bin;
+ GtkWidget *child;
g_return_if_fail (GTK_IS_SCROLLED_WINDOW (scrolled_window));
if (vadjustment)
@@ -635,9 +639,11 @@ gtk_scrolled_window_set_vadjustment (GtkScrolledWindow *scrolled_window,
scrolled_window);
gtk_scrolled_window_adjustment_changed (vadjustment, scrolled_window);
- g_object_set (gtk_bin_get_child (bin),
- "vadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)),
- NULL);
+ child = gtk_bin_get_child (bin);
+ if (child)
+ g_object_set (child,
+ "vadjustment", gtk_range_get_adjustment (GTK_RANGE (priv->vscrollbar)),
+ NULL);
g_object_notify (G_OBJECT (scrolled_window), "vadjustment");
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]