Tuesday, March 02, 2010

Getting a copy of a GdkDrawable window

After a couple of days break, its back to gnocl::pixBuf. Today's implemented feature is grabbing a copy of the widget's graphics. For this to work, of course, the item needs to be rendered. Here's the test snippet, clicking a button will result in its picture being 'grabbed'.

set but1 [gnocl::button -text "Hello World" ]
set win1gnocl::window -child $but1]

$but1 configure \
     -onClicked {
         set pb1 [gnocl::pixBuf get drawable $win1]
         $pb1 save fileName.png}









No comments: