Re: Moveto in Clist?
| From: | Madeleine D. | Date: | Wed, 15 Jun 2005 18:21:33 +0000 |
| Subject: | Re: Moveto in Clist? | ||
| References: | 1 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5876@lists.php.net to get a copy of this message | ||
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
>
>