Re: [pygtk] GTK_IS_WIDGET on subclass of a widget fails
Christian Becke wrote: Jeffrey Finkelstein schrieb: I'm new to Gtk. I tried to create a subclass of an HBox and add it to a window, but I get a GtkWarning telling me that the assertion `GTK_IS_WIDGET()' fails on the instance of my subclass. For example: ===code=== from gtk import Window, HBox, WINDOW_TOPLEVEL, main class FooBox(HBox): def __init__(self): pass I think you have to call the constructor of the parent object here: def __init__(self): HBox.__init__(self) wouldn't it be better to use super(FooBox,self).__init__() and you have to make your new widget known: import gobject gobject.type_register (FooBox) window = Window(WINDOW_TOPLEVEL) window.add(FooBox()) window.show_all() main() ===/code=== yields a warning at window.add(), namely GtkWarning: gtk_container_add: assertion `GTK_IS_WIDGET (widget)' failed. This causes the widget to not be displayed in the window. I don't really understand why this is; am I missing a method call? Have a look at the gobject tutorial [1]. HTH, Chris [1] http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Recent Manager on Windows
On Thu, May 21, 2009 at 10:13 PM, Alec Mills alec.mi...@mdacorporation.com wrote: Hi, Hi Alec, [...] I'm running gtk 2.14.7 and pygtk 2.12.1 on python 2.6.2 on WinXP Pro 2002 SP3 we had a problem with 2.12.1-1 maybe you are using that one. If that is the case please update pygtk using 2.12.1-3 which should be ok. http://ftp.acc.umu.se/pub/GNOME/binaries/win32/pygtk/2.12/ cheers -- Gian Mario Tagliaretti GNOME Foundation member gia...@gnome.org ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] making pygobject_register_sinkfunc a noop?
Hi, I'm working on pybank and have found a problem when removing the floating reference after construction. The current plan is to base pybank on pygobject, so pybank would basically create at runtime the equivalent of the code generated for the gtk, gstreamer, etc bindings. I'm wondering now how can I make the equivalent of calling pygobject_register_sinkfunc in pybank and by looking at the gjs code, seems like we don't really need for each library bindings to register their own sinkfuncs: http://git.gnome.org/cgit/gjs/tree/gi/object.c#n709 Is Gjs correct and we can do something generically and drop pygobject_register_sinkfunc? You can track my work here: http://git.sugarlabs.org/projects/pybank/repos/mainline And learn more about pybank here: http://live.gnome.org/PyBank/ Thanks, Tomeu ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] making pygobject_register_sinkfunc a noop?
On Fri, May 22, 2009 at 12:01, Tomeu Vizoso to...@sugarlabs.org wrote: Hi, I'm working on pybank and have found a problem when removing the floating reference after construction. The current plan is to base pybank on pygobject, so pybank would basically create at runtime the equivalent of the code generated for the gtk, gstreamer, etc bindings. I'm wondering now how can I make the equivalent of calling pygobject_register_sinkfunc in pybank and by looking at the gjs code, seems like we don't really need for each library bindings to register their own sinkfuncs: http://git.gnome.org/cgit/gjs/tree/gi/object.c#n709 Is Gjs correct and we can do something generically and drop pygobject_register_sinkfunc? As one more data point, this is what seed does: construction: http://git.gnome.org/cgit/seed/tree/libseed/seed-engine.c#n201 method invocation: http://git.gnome.org/cgit/seed/tree/libseed/seed-engine.c#n473 Regards, Tomeu You can track my work here: http://git.sugarlabs.org/projects/pybank/repos/mainline And learn more about pybank here: http://live.gnome.org/PyBank/ Thanks, Tomeu ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] Recent Manager on Windows
On Fri, May 22, 2009 at 4:10 PM, Alec Mills alec.mi...@mdacorporation.com wrote: Hi Gian, Hi Alec, I've tried it with both of the available installers: 2.12.1-2 and 2.12.1-3. Just to be sure, I did a completely clean install of python on my system. I then installed python 2.6.2, the gtk+ all in one bundle, pycairo, pygobject and pygtk from the website. All the most recent versions and nothing else. Yeah looks like the problem is now in the binary for python 2.6, for 2.5 works fine Python 2.6.2 (r262:71605, Apr 14 2009, 22:40:02) [MSC v.1500 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import gtk gtk.RecentManager() Traceback (most recent call last): File stdin, line 1, in module AttributeError: 'module' object has no attribute 'RecentManager' Python 2.5.1 (r251:54863, Apr 18 2007, 08:51:08) [MSC v.1310 32 bit (Intel)] on win32 Type help, copyright, credits or license for more information. import gtk gtk.pygtk_version (2, 12, 1) gtk.RecentManager() gtk.RecentManager object at 0xb9be68 (GtkRecentManager at 0xe25010) sorry about that, hopefully someone that knows how to compile things on win32 will help us in building binaries for that platform. cheers -- Gian Mario Tagliaretti GNOME Foundation member gia...@gnome.org ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] GTK_IS_WIDGET on subclass of a widget fails
Have a look at this: http://fuhm.net/super-harmful/ ;) On Fri, May 22, 2009 at 3:21 PM, Neil Dugan py...@butterflystitches.com.auwrote: Christian Becke wrote: Jeffrey Finkelstein schrieb: I'm new to Gtk. I tried to create a subclass of an HBox and add it to a window, but I get a GtkWarning telling me that the assertion `GTK_IS_WIDGET()' fails on the instance of my subclass. For example: ===code=== from gtk import Window, HBox, WINDOW_TOPLEVEL, main class FooBox(HBox): def __init__(self): pass I think you have to call the constructor of the parent object here: def __init__(self): HBox.__init__(self) wouldn't it be better to use super(FooBox,self).__init__() and you have to make your new widget known: import gobject gobject.type_register (FooBox) window = Window(WINDOW_TOPLEVEL) window.add(FooBox()) window.show_all() main() ===/code=== yields a warning at window.add(), namely GtkWarning: gtk_container_add: assertion `GTK_IS_WIDGET (widget)' failed. This causes the widget to not be displayed in the window. I don't really understand why this is; am I missing a method call? Have a look at the gobject tutorial [1]. HTH, Chris [1] http://www.sicem.biz/personal/lgs/docs/gobject-python/gobject-tutorial.html ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/ ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] GTK_IS_WIDGET on subclass of a widget fails
Kelvin Ho wrote: Have a look at this: http://fuhm.net/super-harmful/ ;) Interesting...so what can _I_ do then? This seems like a problem above me... ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
Re: [pygtk] GTK_IS_WIDGET on subclass of a widget fails
Jeffrey Finkelstein a écrit : Kelvin Ho wrote: Have a look at this: http://fuhm.net/super-harmful/ ;) Interesting...so what can _I_ do then? This seems like a problem above me... call HBox.__init__(self), as it was suggested, it will work. ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Spead Sheet like widget
Hi Need to edit some tables, mostly smaller but some up to 2000 rows, 16-30ish columns. Some spread sheet like calculations, but nothing to complex. What are the best suggestions, the app needs to run on Win32 as well as Linux. Thanks in advance. -- Rob Brown-Bayliss r.brown.bayl...@gmail.com ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] Extract GtkObject from PyObject
Hi, I'm trying to embed python in my c-application so that I can use matplotlib. My python code sets up a GtkObject to sends signals. I want to pass a reference to this GtkObject back to my C-Code so that I can then send signals from C. I can use SWIG to create C functions that are callable from python. In this case I pass a Python GtkObject (PyGtkObject) into my C-function. From this PyObject I need to extract a GtkObject so that I can use it with the gtk functions in C. Can anyone help me do this? I assume PyGtk does this in order to interface with the C language bindings for gtk. Thanks Jeremy ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/
[pygtk] building pygobject on windows
Hi, I'm trying to find some information about the best way to build pygobject on Windows. Is there a preferred method to do this? I'd prefer to use whatever method is employed for the binaries that are supplied for download on pygtk.org, as I've tested those and they work fine for me, except for this bug: http://bugzilla.gnome.org/show_bug.cgi?id=546802 which I've been running into. The patch fixes my problems in Linux, so I'd like to build pygobject 2.14.2 for Windows with that patch applied, if possible. thanks, dave ___ pygtk mailing list pygtk@daa.com.au http://www.daa.com.au/mailman/listinfo/pygtk Read the PyGTK FAQ: http://faq.pygtk.org/