Re: GtkList not scrolling
| From: | bradm at mchsi dot com | Date: | Wed, 02 Feb 2005 04:36:39 +0000 |
| Subject: | Re: GtkList not scrolling | ||
| Groups: | php.gtk.general | ||
| Request: | Send a blank email to php-gtk-general+get-5520@lists.php.net to get a copy of this message | ||
hello all
this is how i solved that problem with the selected list item
hiding
function expose_list_box_selection($list_box_name)
{
// this function keeps the selected list item visible when moving them up or
down, it does not let them hide
global $list_box;
$list_box_vadj = $list_box[$list_box_name]['vadj'];
$selected =
$list_box[$list_box_name]['list']->child_position($list_box[$list_box_name]['list']->selection[0]);
$top_index =
round(((round($list_box_vadj->value)+$list_box_vadj->page_size)/16) -
round($list_box_vadj->page_size/16));
$bottom_index =
round(((round($list_box_vadj->value)+$list_box_vadj->page_size)/16) -1);
if($selected < $top_index or $selected > $bottom_index){
if($selected < $top_index){
$list_box_vadj->set_value(($selected * 16));
}else{
$list_box_vadj->set_value((($selected -
round(($list_box_vadj->page_size / 16)-1)) * 16));
}
}
}
Linux ROCKS !!
bradm
> Hi
>
> Does somebody know why the GtkList does not scroll when non-visible
> items are selected?
>
> I'm using a scrolled windows, then a viewport, an on top on this a
> GtkList. If there are too much items, the scrollbars are shown and I can
> scroll with the mouse.
> But when I use the keyboard to go to the next (not visible) items, the
> viewport isn't moved.
>
>
> Regards/MfG,
> Christian Weiske
> --
> XMMS is playing now:
>