GRIDPLUS2 - Setting Default Values For GRIDPLUS Widgets
Home Reference Manpage Examples Download License Contact

Setting Default Values For GRIDPLUS Widgets

Default values for GRIDPLUS widgets can be set using either the gpdefault command -or- can be set as a widget option for date, dropdown, entry and spinbox.

Using The gpdefault Command

The gpdefault command can be used to set one or more GRDIDPLUS widget default values.


set the value of a single widget - Or...

gpdefault {item value ... ...}


gpdefault {
   .mygrid,myitem1  "My default one"
   .mygrid,myitem2  "My default two"
   .mygrid,myitem3  1
   .mygrid,myitem4  0
   .mygrid          item6

gridplus widget .mygrid -width 30 -wtitle "Defaults" {
   {&e "My Item 1" .myitem1}
   {&e "My Item 2" .myitem2 "=Widget option overrides gpdefault"}
   {&c "My Item 3" .myitem3}
   {&c "My Item 4" .myitem4}
   {&r "My Item 5" .myitem5 -item5}
   {&r "My Item 6" .myitem6 -item6}
   {&e "My Item 7" .myitem7}

pack .mygrid

Note: The GRIDPLUS tablelist, text and tree widgets default values cannot be set using gpdefault.

Copyright © 2013 Adrian Davis.