Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / lib / PmwTextDialog.py
CommitLineData
86530b38
AT
1# A Dialog with a ScrolledText widget.
2
3import Pmw
4
5class TextDialog(Pmw.Dialog):
6 def __init__(self, parent = None, **kw):
7 # Define the megawidget options.
8 INITOPT = Pmw.INITOPT
9 optiondefs = (
10 ('borderx', 10, INITOPT),
11 ('bordery', 10, INITOPT),
12 )
13 self.defineoptions(kw, optiondefs)
14
15 # Initialise the base class (after defining the options).
16 Pmw.Dialog.__init__(self, parent)
17
18 # Create the components.
19 interior = self.interior()
20 aliases = (
21 ('text', 'scrolledtext_text'),
22 ('label', 'scrolledtext_label'),
23 )
24 self._text = self.createcomponent('scrolledtext',
25 aliases, None,
26 Pmw.ScrolledText, (interior,))
27 self._text.pack(side='top', expand=1, fill='both',
28 padx = self['borderx'], pady = self['bordery'])
29
30 # Check keywords and initialise options.
31 self.initialiseoptions()
32
33 # Need to explicitly forward this to override the stupid
34 # (grid_)bbox method inherited from Tkinter.Toplevel.Grid.
35 def bbox(self, index):
36 return self._text.bbox(index)
37
38Pmw.forwardmethods(TextDialog, Pmw.ScrolledText, '_text')