Friday, February 19, 2010

gnocl::image flip command

The night just simply gets more productive. Implemented 'flip' command for the gnocl::image widget. The test script tells all..

set pb4 [gnocl::pixBuf load "ball.svg" ]
set img1 [gnocl::image -image "%?$pb4"]

$img1 flip -orientation horizontal
$img1 flip -orientation vertical

catch { $img1 flip -orientation  ASAs } ;# this will generate an error

set but1 [gnocl::button \
   -text "Turn" \
   -onClicked { $img1 turn 90 } ]

set box1 [gnocl::box -orientation vertical]
   $box1 add $but1
   $box1 add $img1 -fill {1 1} -expand 1

set win1 [gnocl::window \
   -child $box1 \
   -widthRequest 200 \
   -heightRequest 200 \
   -allowShrink 0 \
   -allowGrow 0 ]

No comments: