GRIDPLUS2 - Line | ![]() |
||||||
|
GRIDPLUS Line |
The "Line" widget is something I created for GRIDPLUS. It can be used to create a horizontal -or- vertical line. Horizontal lines may have an optional title (label).
Example |
This section contains an example which illustrates the main GRIDPLUS line command mode features.
The following example assumes that the reader is familiar with the contents of the Grid/Layout page. Information given on that page will not be duplicated here.
Note: The example assumes that the GRIDPLUS package has already been "required" and the commands imported.
Window:
Source Code:
Comments:
The direction of the line (horizontal/vertical) is determinted by the attachment specified
for the line in its containing Layout.
For Example: ".myline:ew"
In this case line ".myline" is attached to the east and west. The
line is therefore stretched horizontally to fill its containing cell in the layout.
Window:
Source Code:
Comments:
The GRIDPLUS line command does not have
any form of layout.
The direction of the line (horizontal/vertical) is determinted by the attachment specified
for the line in its containing Layout.
For Example: ".myline:ns"
In this case line ".myline" is attached to the north (top) and south
(Bottom). The Line is therefore stretched vertically to fill its containing cell in the layout.
Window:
Source Code:
Comments:
Horizontal lines may also have a title.
For Example: "gridplus line .myline -title "My Line""
This creates a Line with a title (label) "My Line".
Window:
Source Code:
Comments:
This example demontrates creating colored lines. To create a colored line set
"-borderwidth 0" and the "-background" option to the required
color. The "-linewidth" option can be used to control the width of the
line.
Line Example 1
gridplus grid .mygrid1 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus line .myline
gridplus grid .mygrid2 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus layout .main -wtitle "Line Example" {
.mygrid1
.myline:ew
.mygrid2
}
pack .main
Line Example 2
gridplus grid .mygrid1 {
{"Label One"}
{"Label Two"}
{"Label Three"}
{"Label Four"}
{"Label Five"}
}
gridplus line .myline
gridplus grid .mygrid2 {
{"Label One"}
{"Label Two"}
{"Label Three"}
{"Label Four"}
{"Label Five"}
}
gridplus layout .main -wtitle "Line Example" {
.mygrid1 .myline:ns .mygrid2
}
pack .main
Line Example 3
gridplus grid .mygrid1 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus line .myline -title "My Line"
gridplus grid .mygrid2 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus layout .main -wtitle "Line Example" {
.mygrid1
.myline:ew
.mygrid2
}
pack .main
Line Example 4
gridplus grid .mygrid1 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus grid .mygrid2 {
{"Label One"} {"Label Two"} {"Label Three"} {"Label Four"} {"Label Five"}
}
gridplus line .myline -borderwidth 0 -background red
gridplus layout .main -wtitle "Line Example" {
.mygrid1
.myline:ew
.mygrid2
}
pack .main
Copyright © 2006 Adrian Davis.