[pygtk] gtk/pygobject api question
tomeu at sugarlabs.org
Mon Mar 7 17:23:52 WST 2011
On Fri, Mar 4, 2011 at 21:38, Andrew Steele <steeley.uk at gmail.com> wrote:
> You can still specify arguments at construction time, e.g. sizegroup =
> Gtk.SizeGroup(mode=Gtk.SizeGroupMode.BOTH). The important thing to remember
> is to 'name' the argument with 'mode='.
> As for you're other questions, I'd be interested to know myself whether
> arguments will be optional at some point in the future.
It's a desired feature. It has been proposed storing in the typelib
the serialized variant of the default value. Once that is done,
PyGObject can add support for optional arguments.
> On 4 March 2011 20:32, Tom Cato Amundsen <tca at gnu.org> wrote:
>> It is explained somewhere how the API will change from pygtk to
>> gtk+pygobject? I'm trying to port GNU Solfege using python-gobject
>> 2.27.91 and gobject-introspection 0.10.3 in ubuntu natty.
>> With pygtk I would do this:
>> sizegroup = gtk.SizeGroup(gtk.SIZE_GROUP_HORIZONTAL)
>> With gtk + pygobject it requires two lines:
>> sizegroup = Gtk.SizeGroup()
>> I have had the impression that using python and pygobject would make
>> the python api closer to C. On
>> http://library.gnome.org/devel/gtk/stable/GtkSizeGroup.html I can see
>> that gtk_size_group_new take one argument, the GtkSizeGroupMode, so I
>> would expect I could set the direction (horizontal/vertical) in the
>> constructor. But I can't.
>> Is the gtk+pygobject pretty stable now? Will it become closer to the
>> pygtk api, or should I just port to what we have now? There are other
>> changes too, like Box.pack_start that don't have optional arguments
>> any more. Is this what it will be when it is final, or can I expect
>> optional arguments in methods like in pygtk?
>> Tom Cato Amundsen <tca at gnu.org> http://www.solfege.org/
>> GNU Solfege - free ear training http://www.gnu.org/software/solfege/
>> pygtk mailing list pygtk at daa.com.au
>> Read the PyGTK FAQ: http://faq.pygtk.org/
> pygtk mailing list pygtk at daa.com.au
> Read the PyGTK FAQ: http://faq.pygtk.org/
More information about the pygtk