GRIDPLUS - Style
Home Reference Manpage Examples Download License Contact

GRIDPLUS Style

GRIDPLUS provides a command/mode to create GRIDPLUS styles. A GRIDPLUS style is simply a named set of options. As most options within GRIDPLUS effect the look of an application I think style is an appropriate term, though any GRIDPLUS options can be part of a style.

Styles can be very useful where you wish to use the same set of options for many GRIDPLUS elements. The style needs to be set only once (Probably as part of an application initialisation procedure/process), the style is then available for any part of the application.

Styles can save duplication of effort, make code more readable -and- make code easier to change as changing the style will change all GRIDPLUS elements using the style.

Example:-

gridplus style action_title {
   -background slategray
   -labelcolor white
   -labelstyle bold
   -linewidth  5
}

gridplus grid .action_title -style action_title {
   {"Actions"} {}
}

...is the same as...

gridplus grid .action_title -background slategray -labelcolor white -labelstyle bold -linewidth  5 {
   {"Actions"} {}
}

(See Example 3 and Example 4 for some ideas for style usage).


Copyright © 2004 Adrian Davis.