From 4f1011fca3830688f6b986951c778a84467c857c Mon Sep 17 00:00:00 2001 From: James Henstridge Date: Sun, 25 Apr 1999 01:13:25 +0000 Subject: a wrapper for the new function. 1999-04-25 James Henstridge * gtk.py (GtkWidget.get_allocation): a wrapper for the new function. * gtkmodule.c: added a routine for getting the allocation of a widget. 1999-04-25 James Henstridge * pygnome/Makefile.am (EXTRA_DIST): added bookmarks-applet.py * pygnome/examples/bookmarks-applet.py: added another sample applet that demonstrates setting up context menu items. It basically reads in your Netscape 4.x bookmarks file, and puts the bookmarks into the context menu heirachy. It then uses gnome.url.show() to display the bookmark in the browser of the user's choice. --- gtkmodule.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'gtkmodule.c') diff --git a/gtkmodule.c b/gtkmodule.c index 837fb445..74b68874 100644 --- a/gtkmodule.c +++ b/gtkmodule.c @@ -3522,6 +3522,18 @@ static PyObject *_wrap_gtk_widget_get_window(PyObject *self, PyObject *args) { return PyGdkWindow_New(win); } +static PyObject *_wrap_gtk_widget_get_allocation(PyObject *self, PyObject *args) { + GtkAllocation allocation; + PyObject *obj; + + if (!PyArg_ParseTuple(args, "O!:gtk_widget_get_allocation", &PyGtk_Type, + &obj)) + return NULL; + allocation = GTK_WIDGET(PyGtk_Get(obj))->allocation; + return Py_BuildValue("(iiii)", (int)allocation.x, (int)allocation.y, + (int)allocation.width, (int)allocation.height); +} + static PyObject *_wrap_gtk_widget_draw(PyObject *self, PyObject *args) { GdkRectangle rect; PyObject *obj; @@ -5587,6 +5599,7 @@ static PyMethodDef _gtkmoduleMethods[] = { { "gtk_object_get_data", _wrap_gtk_object_get_data, 1 }, { "gtk_object_remove_data", _wrap_gtk_object_remove_data, 1 }, { "gtk_widget_get_window", _wrap_gtk_widget_get_window, 1 }, + { "gtk_widget_get_allocation", _wrap_gtk_widget_get_allocation, 1 }, { "gtk_widget_draw", _wrap_gtk_widget_draw, 1 }, { "gtk_widget_size_request", _wrap_gtk_widget_size_request, 1 }, { "gtk_widget_size_allocate", _wrap_gtk_widget_size_allocate, 1 }, -- cgit v1.2.1