Edward Muller wrote:
> 
> I can't seem to get the text in the label to wrap in the following code. I've
> played around with moving the set_line_wrap call around a little and a few
> other things with no results. Any ideas?
> 
> from gtk import *
> from GTK import *
> 
> class MsgBox(GtkWindow):
>     def __init__(self,lbl_text):
>         GtkWindow.__init__(self)
>         self.set_usize(120,160)
>         self.set_uposition(60,80)
>         frame = GtkFrame()
>         frame.set_shadow_type(SHADOW_ETCHED_IN)
>         self.add(frame)
>         frame.show()
>         box = GtkVBox()
>         frame.add(box)
>         lbl = GtkLabel()
>         lbl.show()
>         box.pack_start(lbl,expand=TRUE,fill=TRUE)
>         lbl.set_line_wrap(TRUE)
>         lbl.set_text(lbl_text)
>         self.close = GtkButton('Okay')
>         self.close.show()
>         box.pack_start(self.close,expand=FALSE)
>         box.show()
>         self.close.connect('clicked',self.close_me)
>         self.set_modal(TRUE)
> 
>     def close_me(self,btn):
>         self.hide()
>         del self

Turning line wrapping on in a label does nothing unless you also call
set_usize() on it to set the dimensions you want the label to wrap to.

James.

_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk

Reply via email to