class LabeledWidget(Pmw
.MegaWidget
):
def __init__(self
, parent
= None, **kw
):
# Define the megawidget options.
('labelmargin', 0, INITOPT
),
('labelpos', None, INITOPT
),
('sticky', 'nsew', INITOPT
),
self
.defineoptions(kw
, optiondefs
)
# Initialise the base class (after defining the options).
Pmw
.MegaWidget
.__init
__(self
, parent
)
interior
= Pmw
.MegaWidget
.interior(self
)
self
._labelChildSite
= self
.createcomponent('labelchildsite',
Tkinter
.Frame
, (interior
,))
self
._labelChildSite
.grid(column
=2, row
=2, sticky
=self
['sticky'])
interior
.grid_columnconfigure(2, weight
=1)
interior
.grid_rowconfigure(2, weight
=1)
self
.createlabel(interior
)
# Check keywords and initialise options.
return self
._labelChildSite