Re: Setting initial position of GtkScrolledWindow?
| From: | Benjamin Smith | Date: | Fri, 25 Apr 2003 03:42:04 +0000 |
| Subject: | Re: Setting initial position of GtkScrolledWindow? | ||
| References: | 1 2 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-3293@lists.php.net to get a copy of this message | ||
I'm redrawing the widget with wholy new data - I just want to start at the
same point. (sorta like refreshing a dynamic page in your web browser - even
if the content changes rather dramatically, the scrollbars stay at the same
spot)
I've tried a number of things. The closest I've come is when I tried
extracting the viewport from the GtkScrolledWindow, Destroying it, then
rebuilding $vbox and putting it into $scrolled:
Function RedrawScrolledWindow()
{
global $win;
$scrolled=$win->child;
$viewport=$scrolled->child;
$viewport->Destroy();
$vbox=CreateVBox();
$scrolled->Add_With_Viewport($vbox);
/*
now, the scrollbars are in the right place, but nothing shows until I
scroll something with the scrollbars..even when I try
$scrolled->Queue_Draw();
or
$viewport=$scrolled->child;
$viewport->Queue_Draw();
*/
}
There, the scrollbars were in the right position, but on Win2K, the text sorta
"disappeared" until I scrolled something with the scrollbars. Yes, I tried
queue_draw(), hide(), and show().
What am I missing?!?!
On Thursday 24 April 2003 08:39 pm, you wrote:
> I'm lost again...
>
>
> http://gtk.php.net/manual/en/gtk.gtkwidget.method.queue_draw.php
> doesn't
> help any?
>
> ----- Original Message -----
> From: "Benjamin Smith" <bens@effortlessis.com>
> To: <php-gtk-general@lists.php.net>
> Sent: Friday, April 25, 2003 2:31 AM
> Subject: [PHP-GTK] Setting initial position of GtkScrolledWindow?
>
> > I'm performing a background action that requires the redraw of a
> > GtkScrolledWindow containing a BIG list of items, and I'd like it if I
>
> could
>
> > return the newly drawn page to the same scrolling position - except
>
> that I
>
> > can't figure out how to.
> >
> > Here's what I've been trying: (This is NOT the code I'm using - but
>
> rather a
>
> > conceptual representation of a much larger codebase) Pay closest
>
> attention to
>
> > RedrawScrolledWindow().
> >
> > How would one do this?
> >
> > Function DrawScrolledWindow($vbox, $vadj=null)
> > {
> > // $vbox has a number of GtkToggleButtons packed into a GtkVbox
> > $scrolled=&New GtkScrolledWindow(null, $vadj);
> > $scrolled->Add_With_Viewport($vbox);
> > $scrolled->Show();
> > global $win;
> > $win->Add($scrolled);
> > }
> >
> > Function RedrawScrolledWindow()
> > {
> > $vbox=CreateVBox();
> > global $win;
> > $scrolled=$win->child;
> > $vadj=$scrolled->Get_VAdjustment();
> > $scrolled->Destroy();
> > DrawScrolledWindow($vbox, $vadj);
> > }
> >
> > --
> > PHP-GTK General Mailing List (http://gtk.php.net/)
> > To unsubscribe, visit: http://www.php.net/unsub.php