1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181
|
<html>
<head>
<meta name="description" content="Pmw - a toolkit for building high-level compound widgets in Python">
<meta name="content" content="python, megawidget, mega widget, compound widget, gui, tkinter">
<title>Pmw.Group reference manual</title>
</head>
<body bgcolor="#ffffff" text="#000000" link="#0000ee"
vlink="551a8b" alink="ff0000">
<h1 ALIGN="CENTER">Pmw.Group</h1>
<p>
<center><IMG SRC=Group.gif ALT="" WIDTH=428 HEIGHT=209></center>
<dl>
<dt> <h3>Name</h3><dd>
<p>Pmw.Group() -
frame with ring border and tag
</p>
<dt> <h3>Inherits</h3><dd>
<a href="MegaWidget.html">Pmw.MegaWidget</a><br>
<dt> <h3>Description</h3><dd>
<p>
This megawidget consists of an interior frame with an exterior
ring border and an identifying tag displayed over the top edge of
the ring. The programmer can create other widgets within the
interior frame.</p>
<p></p>
<dt> <h3>Options</h3><dd>
Options for this megawidget and its base
classes are described below.<p>
<a name=option.tagindent></a>
<dl><dt> <strong>tagindent
</strong><dd>
Initialisation option. The distance from the left edge of the ring to the left side of
the tag component. The default is <strong>10</strong>.</p>
</dt></dl>
<dt> <h3>Components</h3><dd>
Components created by this megawidget and its base
classes are described below.<p>
<a name=component.groupchildsite></a>
<dl><dt> <strong>groupchildsite
</strong><dd>
The frame which can contain other widgets to be grouped. By default, this component is a Tkinter.Frame.</p>
</dt></dl>
<a name=component.hull></a>
<dl><dt> <strong>hull
</strong><dd>
This acts as the body for the entire megawidget. Other components
are created as children of the hull to further specialise the
widget. By default, this component is a Tkinter.Frame.</p>
</dt></dl>
<a name=component.ring></a>
<dl><dt> <strong>ring
</strong><dd>
This component acts as the enclosing ring around the
<strong>groupchildsite</strong>. The default <strong>borderwidth</strong> is <strong>2</strong> and the
default <strong>relief</strong> is <strong>'groove'</strong>. By default, this component is a Tkinter.Frame.</p>
</dt></dl>
<a name=component.tag></a>
<dl><dt> <strong>tag
</strong><dd>
The identifying tag displayed over the top edge of the enclosing
ring. If this is <strong>None</strong>, no tag is displayed. By default, this component is a Tkinter.Label.</p>
</dt></dl>
<a name=methods></a>
<dt> <h3>Methods</h3><dd>
Only methods specific to this megawidget are described below.
For a description of its inherited methods, see the
manuals for its base classes.
<p>
<a name=method.interior></a>
<dl><dt> <strong>interior</strong>()<dd>
Return the frame within which the programmer may create widgets.
This is the same as <code>component('groupchildsite')</code>.</p>
</dt></dl>
<dt> <h3>Example</h3><dd>
The image at the top of this manual is a snapshot
of the window (or part of the window) produced
by the following code.<p>
<pre>
class Demo:
def __init__(self, parent):
# Create and pack the Groups.
w = Pmw.Group(parent, tag_text='label')
w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
cw = Tkinter.Label(w.interior(),
text = 'A group with the\ndefault Label tag')
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
w = Pmw.Group(parent, tag_pyclass = None)
w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
cw = Tkinter.Label(w.interior(), text = 'A group\nwithout a tag')
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
radiogroups = []
self.var = Tkinter.IntVar()
self.var.set(0)
radioframe = Tkinter.Frame(parent)
w = Pmw.Group(radioframe,
tag_pyclass = Tkinter.Radiobutton,
tag_text='radiobutton 1',
tag_value = 0,
tag_variable = self.var)
w.pack(fill = 'both', expand = 1, side='left')
cw = Tkinter.Frame(w.interior(),width=200,height=20)
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
radiogroups.append(w)
w = Pmw.Group(radioframe,
tag_pyclass = Tkinter.Radiobutton,
tag_text='radiobutton 2',
tag_font = Pmw.logicalfont('Helvetica', 4),
tag_value = 1,
tag_variable = self.var)
w.pack(fill = 'both', expand = 1, side='left')
cw = Tkinter.Frame(w.interior(),width=200,height=20)
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
radiogroups.append(w)
radioframe.pack(padx = 6, pady = 6, expand='yes', fill='both')
Pmw.aligngrouptags(radiogroups)
w = Pmw.Group(parent,
tag_pyclass = Tkinter.Checkbutton,
tag_text='checkbutton',
tag_foreground='blue')
w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
cw = Tkinter.Frame(w.interior(),width=150,height=20)
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
w = Pmw.Group(parent,
tag_pyclass = Tkinter.Button,
tag_text='Tkinter.Button')
w.pack(fill = 'both', expand = 1, padx = 6, pady = 6)
cw = Tkinter.Label(w.interior(),
background = 'aliceblue',
text = 'A group with\na Button tag!?'
)
cw.pack(padx = 2, pady = 2, expand='yes', fill='both')
</pre>
</dl>
<center><P ALIGN="CENTER">
<IMG SRC = blue_line.gif ALT = "" WIDTH=320 HEIGHT=5>
</p></center>
<font size=-1>
<center><P ALIGN="CENTER">
<a href="index.html">Home</a>.
Pmw 0.8.5
Maintainer
<a href="mailto:gregm@iname.com">gregm@iname.com</a>.
9 Feb 2001
<br>Manual page last reviewed: 15 November 1998
</p></center>
</font>
</body>
</html>
|