Re: Moveto in Clist?

From: Date: Wed, 15 Jun 2005 20:16:09 +0000
Subject: Re: Moveto in Clist?
References: 1  Groups: php.gtk.general 
Request: Send a blank email to php-gtk-general+get-5877@lists.php.net to get a copy of this message
Madeleine, I'd //LOVE// whatever documentation and notes you have on this! If I can make this work, life in one area gets much better for me... I tried what you mentioned below as follows, and now the clist ends up with focus, and the script output indicates that it should be moved, but it still isn't moving. The clist has focus, as indicated by a black border around row0 that isn't there when I don't grab_focus first. $s['clist']=&New GtkClist(1, array('snork')); for($i=0; $i<1000; $i++) $s['clist']->Append(array($i)); $scrolled=&New GtkScrolledWindow(); $scrolled->Add_With_ViewPort($s['clist']); $win=&New GtkWindow(); $win->Add($scrolled); $win->Set_Usize(500, 500); $win->Show_All(); if ($s['clist']->row_is_visible($lastRow) != GTK_VISIBILITY_FULL) { echo "We're moving it!"; $s['clist']->Grab_Focus(); $s['clist']->moveto(99,0,1.0,0.0); } On Wednesday 15 June 2005 11:21, Madeleine D. wrote: > Ben - > > I just go this working a couple days ago, and am working on an update to > the Docs page. > > Meantime, there are a couple points. First, I found I needed to grab_focus > on the clist before a move would occur at all. Second, I had to make sure > the row existed and wasn't already visible, as in: > > if ($clistObj->row_is_visible($lastRow) != GTK_VISIBILITY_FULL) { > $clistObj->moveto($lastRow,0,1.0,0.0); > } > > If the row, column don't exist, the moveto method goes nowhere. Also, this > moves the scroll bar, not the selection, so if you need the row selected as > well, that's a separate step. > > There's a third, which may or may not apply to you. Once I wanted to use a > button to move the scroll bar after the window had been painted and loaded, > there was a whole nother issue with that. Let me know if you need that > right away, otherwise, it will be on Docs page, once I can get to it. > > Hope that helps. > > Madeleine D. > > > > At 10:39 AM 6/15/05 -0700, you wrote: > >I'm trying to make clist "jump" to a specific row/col that has to be > scrolled > >to to get to. > > > >I'm running the latest PHP-GTK for PHP 4.x, with PHP 4.3.11 executables on > MS > >Windows. > > > >Here's a demonstration of what I'm trying - what am I doing wrong? No errors > >seem to be reported anywhere that I can find. > > > > > >// CREATE THE CLIST WIDGET > >$s['clist']=&New GtkClist(1, array('snork')); > >// POPULATE THE WIDGET > >for($i=0; $i<1000; $i++) > > $s['clist']->Append(array($i)); > >// PUT IT IN A SCROLLED WINDOW... > >$scrolled=&New GtkScrolledWindow(); > >$scrolled->Add_With_ViewPort($s['clist']); > >// PUT THE WINDOW IN A SCREEN. > >$win=&New GtkWindow(); > >$win->Add($scrolled); > >$win->Set_Usize(500, 500); > >$win->Show_All(); > >// EVERYTHING LOOKS FINE TO HERE... > > > >// NOW, TO MAKE IT "JUMP"... BUT IT DOESN'T SEEM TO DO ANYTHING > >$s['clist']->MoveTo(99, -1, 0.5, 0.5); > > > >-Ben > >-- > >"The best way to predict the future is to invent it." > >- XEROX PARC slogan, circa 1978 > > > >-- > >PHP-GTK General Mailing List (http://gtk.php.net/) > >To unsubscribe, visit: http://www.php.net/unsub.php > > > > > > -- > PHP-GTK General Mailing List (http://gtk.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > > -- "The best way to predict the future is to invent it." - XEROX PARC slogan, circa 1978

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