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"
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"
Comments