GtkScrolledWindow issues

From: Date: Thu, 13 Mar 2003 01:31:41 +0000
Subject: GtkScrolledWindow issues
Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-3092@lists.php.net to get a copy of this message
How can you make GtkScrolledWindow follow the widgets that have focus? I have a big list of questions and I want to take input for each, in a scrollable window. What I have so far is a GtkFixed widget with the questions and the associated input box on a GtkFixed, such as $questions=array('Do birds have feathers?', 'Do planes have wings?', 'and so on...'); $bg=GtkFixed(); while (list($k, $question)=each($questions)) { ${'item'.$k}=&New GtkLabel($question); ${'ans'.$k}=&New GtkEntry(); ${'ans'.$k}->Connect('changed', 'HandleAnswer'); $bg->put(${'item'.$k}, 0, 20*$k); $bg->put(${'ans'.$k}, 350, 20*$k); } Then, I put the GtkFixed item into a scrollable window $scroll=&New GtkScrolledWindow(); $scroll->Set_Usize(400, 400); $scroll->Add_With_Viewport($bg); This seems to work very well, the arrow keys work as expected, except that when you arrow down to the bottom of the screen, you can go past the viewable area and the window doesn't scroll to follow the selected GtkEntry. How can I make the window "follow", or scroll down to display whatever widget has focus via the keyboard?

« previous php.gtk.general (#3092) next »