[pygtk] segmentation fault while using pango

Rebecca Rebhuhn-Glanz rrebhuhnglanz at gmail.com
Thu Jul 31 23:30:28 WST 2008


Thank you so much. The code now reads:

elif image.get_name()=="text":

text=image.get_children()[0].get_child().get_children()[0]

pangoText=text.get_parent().create_pango_layout(text.get_text())
                    #pangoText.set_text(text)

point=image.get_children()[0].get_child().get_children()[2]

xcoord=point.get_children()[0].get_children()[0].get_children()[0].get_children()[1].get_value_as_int()

ycoord=point.get_children()[0].get_children()[0].get_children()[0].get_children()[3].get_value_as_int()

drawingArea.draw_layout(gtk.gdk.GC(drawingArea),xcoord,ycoord,pangoText)

No more banging my head against the wall.

Thanks again,
Rebecca R.G.

On Thu, Jul 31, 2008 at 11:21 AM, Gian Mario Tagliaretti
<gianmt at gnome.org>wrote:

> 2008/7/31 Rebecca Rebhuhn-Glanz <rrebhuhnglanz at gmail.com>:
>
> Hi Rebecca,
>
> >                     pangoText=pango.Layout(pango.Context())
>
> I guess the problem is here, you shouldn't create a pango context but
> get the one of the parent widget instead:
>
> http://www.pygtk.org/docs/pygtk/class-gtkwidget.html#method-gtkwidget--get-pango-context
>
> cheers
> --
> Gian Mario Tagliaretti
> GNOME Foundation member
> gianmt at gnome.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20080731/0f092ce0/attachment.htm 


More information about the pygtk mailing list