Added a common way to set the pane header.

This commit is contained in:
David Soulayrol 2010-11-17 19:06:16 +01:00
parent ba505cf681
commit 357803c00e

View file

@ -104,6 +104,19 @@ class Pane(gtk.VBox):
if len(self._successors) == 1:
self._switch = klass
def set_header(self, msg):
"""Add a help header to the pane with the given message.
Since it is quite common that panes begin with a little guide
explaining the current step, calling this method will ensure
such panes all present the same header style.
"""
help_label = gtk.Label(msg)
help_label.set_justify(gtk.JUSTIFY_FILL)
help_label.set_line_wrap(True)
self.pack_start(help_label, False, False, 10)
self.pack_start(gtk.HSeparator(), False, False)
def switch(self, klass):
"""Update the switch using the given class.