4 class LabeledWidget(Pmw.MegaWidget):
5 def __init__(self, parent = None, **kw):
7 # Define the megawidget options.
10 ('labelmargin', 0, INITOPT),
11 ('labelpos', None, INITOPT),
12 ('sticky', 'nsew', INITOPT),
14 self.defineoptions(kw, optiondefs)
16 # Initialise the base class (after defining the options).
17 Pmw.MegaWidget.__init__(self, parent)
19 # Create the components.
20 interior = Pmw.MegaWidget.interior(self)
21 self._labelChildSite = self.createcomponent('labelchildsite',
23 Tkinter.Frame, (interior,))
24 self._labelChildSite.grid(column=2, row=2, sticky=self['sticky'])
25 interior.grid_columnconfigure(2, weight=1)
26 interior.grid_rowconfigure(2, weight=1)
28 self.createlabel(interior)
30 # Check keywords and initialise options.
31 self.initialiseoptions()
34 return self._labelChildSite