[pygtk] Centering multi-line text in a label?
Ravan, James
jravan at irobot.com
Wed Feb 24 00:55:52 WST 2010
I have a window class that I use to display progress messages. It's
something like this:
class fooWindow:
def __init__(self):
# Create progress message window.
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
vbox = gtk.VBox(False, 10)
self.window.add(vbox)
# Put a label in the window.
self.progress = gtk.Label()
self.setProgress("Initialization")
vbox.pack_start(self.progress, False, False, 0)
# Signals
self.window.connect("destroy", lambda w: gtk.main_quit())
# Show
self.window.show_all()
def setProgress(self,text):
self.progress.set_markup("<b>" + text + "</b>")
The method that displays progress messages is "setProgress". What I
would like to be able to do, but currently don't know how to accomplish,
is to be able to supply an array of lines to setProgress and have them
all centered or left-justified or right-justified.
I've looked at Pango markup and there is no mention of justification.
And after thinking about it for a few moments, I can understand why. But
is there some way to supply strings to set_markup() that will achieve
centering or justification?
thanks,
-jim
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.daa.com.au/pipermail/pygtk/attachments/20100223/85aa9d6b/attachment.htm
More information about the pygtk
mailing list