The default settings for the gnocl::button are for the icon to be on the left and the label on the right. Not all buttons need to be like this. Consider the toolbar button where the icon in above the label. These new options offer the programmer a little more flexibility when building a UI using Gnocl, especially when creating ribbon type containers.
This is how the new settings look:
And the sample code:
set hbox [gnocl::hBox]
set but1 [gnocl::button -text vertical -icon %#Info -data DATA -orientation vertical ]
set but2 [gnocl::button -text vertical-invert -icon %#Info -data DATA -orientation vertical -invert 1]
set but3 [gnocl::button -text horizontal -icon %#Info -data DATA ]
set but4 [gnocl::button -text horizontal-invert -icon %#Info -data DATA -invert 1]
puts "but1 orientation = [$but1 cget -orientation]"
puts "but3 orientation = [$but3 cget -orientation]"
puts "but1 invert = [$but1 cget -invert]"
puts "but2 invert = [$but2 cget -invert]"
$hbox add $but1 -fill 1 -expand 1
$hbox add $but2 -fill 1 -expand 1
$hbox add $but3 -fill 1 -expand 1
$hbox add $but4 -fill 1 -expand 1
gnocl::window -child $hbox -title "Button -invert and -orientation"
Subscribe to:
Post Comments (Atom)
-
Given this module some attention today. Added some of the more package wide options to the module and created customised handler for settin...
-
Spent some time today creating some simple howto-tutorials on creating standalone Tcl/Gnocl applications using freewrap. The process is almo...
-
Linux distros have heaps of pre-installed icons ready for use. I recently needed to create a toolbar menu which needed to access a set of un...

No comments:
Post a Comment