[pygtk] Treeview bug

Robert Kaplan belovedbob at greennet.net
Mon Dec 24 14:42:24 WST 2007


Hi,


I'm new, greetings All!

The following appears to create an easily reproducible bug in the =

set_cursor method of a gtk.TreeView.  Can someone confirm, and/or tell =

me where to report it?  Is bugzilla.gnome.org appropriate for pygtk =

bugs, although this has the feel of a 'C' bug to me?

Ubuntu 7.10 with default versions of python, pygtk, and gtk, whatever =

those are.

Thanks


Bob

>
> #    Main.py
> #
> #
>
> import    pygtk
> import    gtk
> import    os
>
> instruct =3D """
>     To reproduce bug:
>
>         leaving tree unexpanded and without a cursor, push bug button,
>         selection bar will be placed on top line,  then expand top line,
>         and try to select second line; selection bar will not work
> """
>
>
> class    Main:
>
>     def    __init__ (self):
>         self. window =3D gtk. Window (gtk. WINDOW_TOPLEVEL)
>         #self. window. maximize ()
>         self. window. connect ("delete_event", self. delete_event)
>         self. window. connect ("destroy", self. destroy)
>         self. window. show ()
>
>         self. box =3D gtk. VBox ()
>         self. box. show ()
>         self. window. add (self. box)
>
>         self. text =3D gtk. TextView ()
>         self. text. show ()
>         bu =3D gtk. TextBuffer ()
>         bu. set_text (instruct)
>         self. text. set_buffer (bu)
>
>         self. tv =3D gtk. TreeView ()
>         self. tv. show ()
>         self. ts =3D gtk. TreeStore (str)
>         self. tv. set_model (self. ts)
>         col =3D gtk. TreeViewColumn ('My column')
>         self. tv. append_column (col)
>         cell =3D gtk. CellRendererText ()
>         col. pack_start (cell, False)
>         col. add_attribute (cell, 'text', 0)
>         r1 =3D self. ts. append (None, ('Test1', ))
>         r2 =3D self. ts. append (r1, ('Test2', ))
>         r3 =3D self. ts. append (r2, ('Test3', ))
>
>         self. box. pack_start (self. tv)
>
>         self. button =3D gtk. Button ('Bug')
>         self. button. show ()
>         self. button. connect ('clicked', self. bug)
>         self. box. pack_end (self. text)
>         self. box. pack_end (self. button, expand =3D False)
>         =

>         =

>
>     def    bug (self, ev):
>         self. tv. set_cursor ((0, 0, 0))
>
>
>     def    main (self):
>         gtk. main ()
>
>         =

>         =

>     def delete_event (self, widget, event, data=3DNone):
>         #print    'Delete event'
>         return False
>
>     def destroy (self, widget, data =3D None):
>         gtk. main_quit ()
>
>         =

>
> if __name__ =3D=3D '__main__':
>     py =3D Main ()
>     py. main ()


-------------- next part --------------
A non-text attachment was scrubbed...
Name: Main.py
Type: text/x-python
Size: 1732 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20071224/2e4fee48/M=
ain.py


More information about the pygtk mailing list