Re: GtkScrolledWindow issues
| From: | Benjamin Smith | Date: | Fri, 14 Mar 2003 04:09:17 +0000 |
| Subject: | Re: GtkScrolledWindow issues | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-3095@lists.php.net to get a copy of this message | ||
> you need:
> $bg = &new GtkFixed();
That's a typo for this message. The actual code size is quite large, so to
avoid confusion, I summarized it below.
How do I make the GtkScrolledWindow scroll and follow whatever widget that has
focus gotten from the arrow keys?
-Ben
On Thursday 13 March 2003 12:15 am, epplestun wrote:
> ----- Original Message -----
> From: "Benjamin Smith" <bens@effortlessis.com>
> To: <php-gtk-general@lists.php.net>
> Sent: Thursday, March 13, 2003 2:31 AM
> Subject: [PHP-GTK] GtkScrolledWindow issues
>
> > 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();
>
> you need:
> $bg = &new 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?
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php