From 357803c00e11929587bace09678ac3ad086380e0 Mon Sep 17 00:00:00 2001 From: David Soulayrol Date: Wed, 17 Nov 2010 19:06:16 +0100 Subject: [PATCH] Added a common way to set the pane header. --- wizpym.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/wizpym.py b/wizpym.py index 31342d1..6ca1d16 100644 --- a/wizpym.py +++ b/wizpym.py @@ -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.