I'm found some seriously strange behavior with a TextView inside a
Paned() widget. I believe this is most likely a bug in the underlying
gtk, but I'm not sure which component is to blame and so I'd be
grateful for any thoughts on where the underlying problem is so I can
find/file a useful bug report.

Note: this isn't a huge problem since I can fix it by changing the
scroll policy of the TextView widget. Nonetheless, it seems like it
shouldn't be happening.

Wrapping text in a TextView in a ScrolledWindow with a
no-horizontal-scroll policy inside an HPaned results in a rapidly
expanding window when the Paned widget's set_position method is
called.

Example code is below.

Tom
----

import gtk

w = gtk.Window()
vb = gtk.VBox()
b=gtk.Button("Show strange behavior")
vb.add(b)
hp=gtk.HPaned()
vb.add(hp)
w.add(vb)

# set up scrolled window
sw=gtk.ScrolledWindow()
# Changing POLICY_NEVER to POLICY_AUTOMATIC will make the
# strange behavior go away.
sw.set_policy(gtk.POLICY_NEVER,gtk.POLICY_AUTOMATIC)
txvw=gtk.TextView()
blob='This is some text to fill our buffer. ' * 10
blob = '%s\n'%blob * 75
txvw.get_buffer().set_text(blob)
txvw.set_wrap_mode(gtk.WRAP_WORD)
sw.add(txvw)

# add something to both sides
hp.add1(gtk.Label('This is absurd and very silly'))
hp.add2(sw)

def set_pos (*args):
    hp.set_position(45)

# connect our button to demonstrate
b.connect('clicked',set_pos)

w.show_all()
hp.show_all()
gtk.main()
_______________________________________________
pygtk mailing list   [email protected]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to