summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--NEWS2
-rw-r--r--README6
-rw-r--r--gtk.py2
-rw-r--r--gtkmodule.c13
5 files changed, 25 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 857fced1..38118f1d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+1999-04-25 James Henstridge <james@daa.com.au>
+
+ * 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-22 James Henstridge <james@daa.com.au>
* NEWS: added a summary of the new features.
diff --git a/NEWS b/NEWS
index 58896a6f..6ae78fd1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-pygtk-0.6.0: 22-April-1999
+pygtk-0.6.0: 25-April-1999
- updated for gtk+-1.2.1.
- You can now write multithreaded programs in python (if python was
compiled with thread support enabled, of course). This feature
diff --git a/README b/README
index a0e10cc4..12a383da 100644
--- a/README
+++ b/README
@@ -49,7 +49,7 @@ Compilation
This archive contains a single C module called gtkmodule. It contains
an almost direct mapping of the functions in GTK including GTK signal
handling, and the gtk_object_new/gtk_object_set commands. This
-version REQUIRES gtk+-1.1.19 or later, as it includes support for
+version REQUIRES gtk+-1.2.1 or later, as it includes support for
features not found in previous versions, and there are
incompatibilities between versions. Also if you want the GdkImlib
extension, you must have Imlib version 1.8 or greater. I recommend
@@ -64,7 +64,7 @@ To compile gtkmodule, first run "./configure" from the base directory
of the distribution. It requires that you have python in the path,
and python has been installed properly. If python is not in the path,
you could try running "PYTHON=/subdir/python ./configure". This
-should generate Makefile from the files Makefile.pre.in and Setup.in.
+should generate the Makefile from the file Makefile.in.
Now you should be able to run "make" to compile the module. Now you
should install the files. I have provided an install target to the
@@ -89,7 +89,7 @@ is about.
Upgrading
=========
-Note that from version 0.5.0 up, pygtk uses GTK v1.1. Since there
+Note that from version 0.5.0 up, pygtk uses GTK >= 1.1. Since there
were some changes to the API, pygtk has changed accordingly. The main
one that will cause problems is the GtkAcceleratorTable. In this
version, it has been removed and replaced with the GtkAccelGroup.
diff --git a/gtk.py b/gtk.py
index f7d7c6dd..7039effb 100644
--- a/gtk.py
+++ b/gtk.py
@@ -311,6 +311,8 @@ class GtkWidget(GtkObject):
_gtk.gtk_widget_event(self._o, event)
def lock_accelerators(self):
_gtk.gtk_widget_lock_accelerators(self._o)
+ def get_allocation(self):
+ return _gtk.gtk_widget_get_allocation(self._o)
def get_ancestor(self, type):
return _obj2inst(_gtk.gtk_widget_get_ancestor(self._o, type))
def get_child_requisition(self):
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 },