[pygtk/gtk-3.0: 10/55] Override: Fix GtkWidget
- From: John Stowers <jstowers src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [pygtk/gtk-3.0: 10/55] Override: Fix GtkWidget
- Date: Sat, 17 Jul 2010 00:25:14 +0000 (UTC)
commit 3484ffa902c0bc3b6d06bf0187abb7669141dd03
Author: John Stowers <john stowers gmail com>
Date: Mon Jul 5 17:08:34 2010 +1200
Override: Fix GtkWidget
gtk/gtkwidget.override | 12 +++++++++---
1 files changed, 9 insertions(+), 3 deletions(-)
---
diff --git a/gtk/gtkwidget.override b/gtk/gtkwidget.override
index f9b9140..5253fc7 100644
--- a/gtk/gtkwidget.override
+++ b/gtk/gtkwidget.override
@@ -92,7 +92,7 @@ _wrap_gtk_widget_get_allocation(PyGObject *self)
{
GtkAllocation allocation;
- allocation = GTK_WIDGET(self->obj)->allocation;
+ gtk_widget_get_allocation(GTK_WIDGET(self->obj), &allocation);
return pyg_boxed_new(GDK_TYPE_RECTANGLE, &allocation, TRUE, TRUE);
}
%%
@@ -328,12 +328,15 @@ override-attr GtkWidget.window
static int
_wrap_gtk_widget__set_window(PyGObject *self, PyGObject *value, void *closure)
{
+ GdkWindow *window;
+
if (!pygobject_check(value, &PyGdkWindow_Type)) {
PyErr_SetString(PyExc_TypeError, "must be a GdkWindow object");
return -1;
}
- GTK_WIDGET(self->obj)->window = g_object_ref(GDK_WINDOW(value->obj));
+ window = g_object_ref(GDK_WINDOW(value->obj));
+ gtk_widget_set_window(GTK_WIDGET(self->obj), window);
return 0;
}
@@ -342,12 +345,15 @@ override-attr GtkWidget.allocation
static int
_wrap_gtk_widget__set_allocation(PyGObject *self, PyObject *value, void *closure)
{
+ GtkAllocation allocation;
+
if (!pygobject_check(value, &PyGdkRectangle_Type)) {
PyErr_SetString(PyExc_TypeError, "must be a GdkRectangle object");
return -1;
}
- pygdk_rectangle_from_pyobject(value, >K_WIDGET(self->obj)->allocation);
+ gtk_widget_get_allocation(GTK_WIDGET(self->obj), &allocation);
+ pygdk_rectangle_from_pyobject(value, &allocation);
return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]