1LabFrame(3) User Contributed Perl Documentation LabFrame(3)
2
3
4
6 Tk::LabFrame - labeled frame.
7
9 use Tk::LabFrame;
10
11 $f = $parent->LabFrame(?-label=>text, -labelside=>where, ...?);
12
14 LabFrame is exactly like Frame and additionaly allows to add a label to
15 the frame.
16
18 LabFrame supports the same options as the Frame widget.
19
20 Additional options of LabFrame are:
21
22 -font => font
23 Specifies the label's font
24
25 -foreground => color
26 Specifies the label's foreground color
27
28 -label => text
29 The text of the label to be placed with the Frame.
30
31 -labelside => where
32 Where can be one of left, right, top, bottom or acrosstop. The
33 first four work as might be expected and place the label to the
34 left, right, above or below the frame respectively. The acrosstop
35 creates a grooved frame around the central frame and puts the label
36 near the northwest corner such that it appears to "overwrite" the
37 groove.
38
39 -labelvariable => scalar_ref
40 Specifies a reference to a variable and used as an alternative to
41 -label. If the value of the variable changes, then the widget will
42 be updated automatically to reflect the change. Used like
43 -textvariable.
44
46 See "Subwidget" in Tk::mega how to use advertised widgets.
47
48 border
49 Frame used to display the border
50
51 frame
52 Frame used to create new LabFrame children.
53
54 label
55 Label used for displaying text
56
58 Run the following test program to see this in action:
59
60 use strict;
61 use Tk;
62 require Tk::LabFrame;
63 require Tk::LabEntry;
64
65 my $test = 'Test this';
66 my $mw = Tk::MainWindow->new;
67 my $f = $mw->LabFrame(-label => "This is a label",
68 -labelside => "acrosstop");
69 $f->LabEntry(-label => "Testing", -textvariable => \$test)->pack;
70 $f->pack;
71 Tk::MainLoop;
72
74 Perhaps LabFrame should be subsumed within the generic pTk labeled
75 widget mechanism.
76
78 Rajappa Iyer rsi@earthling.net
79
80 This code is derived from LabFrame.tcl and LabWidg.tcl in the Tix4.0
81 distribution by Ioi Lam. The code may be redistributed under the same
82 terms as Perl.
83
84
85
86perl v5.36.0 2022-07-22 LabFrame(3)