[pygtk] Subclassing gtk.ToolItem

zsolt foldvari zsolt.foldvari at gmail.com
Tue Apr 29 17:47:30 WST 2008


Steve,

On 4/28/08, Steve McClure <smcclure at racemi.com> wrote:
>
>  On Apr 28, 2008, at 6:13 AM, zsolt foldvari wrote:
>
>
> > On 4/24/08, Douglas S. Blank <dblank at cs.brynmawr.edu> wrote:
> >
> > >
> > > > I'm trying to subclass gtk.ToolItem to include a custom widget into
> it.
> > > >
> > > > Now, when I tried to override the gtk.ToolItem.set_tooltip() method
> > > > python crashes with:
> > > >
> > > > python: Objects/stringobject.c:107: PyString_FromString: Assertion
> > > > `str != ((void *)0)' failed.
> > > >
> > > > Any idea what am I doing wrong?
> > > >
> > >
> >
> >
> > > Looks like you need to pass in self as the first argument.
> > >
> >
> > No, it's not the missing self parameter. Any other idea?
> >
>
>
>
>
> >
> > >
> > > >   def do_set_tooltip(self, tooltips, tip_text=None, tip_private=None):
> > > >       gtk.ToolItem.set_tooltip(tooltips, tip_text,
> tip_private)
> > > >
> > >
> >
>
>
>  I don't see self in the call to ToolItem.set_tooltip.

Yes, I did not modify the attached code. However, the behaviour is the
same independently whether the 'self' is included or not.
Actually, the code doesn't even get to the first line of the method
whatever that is.

Cheers,
Zsolt


More information about the pygtk mailing list