Re: [gtk-list] Manual listbox scrolling
- From: Owen Taylor <owt1 cornell edu>
- To: Stefan Jeske <jeske braunschweig netsurf de>
- Cc: gtk-list redhat com
- Subject: Re: [gtk-list] Manual listbox scrolling
- Date: 01 Nov 1997 21:09:52 -0500
Stefan Jeske <email@example.com> writes:
> Hi !
> I'd like to implement the above, and have to find out if the
> selected list item is inside or (partly) outside the visible
> part of the list box, in order to scroll one line up or down.
> How can I check this ?
There's a sort of fundemental problem here in that a listbox
knows very little about the scrolledwindow it lives in.
That being said, a rough way of achieving this might be to
use the function:
void gdk_window_get_geometry (GdkWindow *window,
To find out the location of the window with respect to the parent
gdk_window_get_geometry (list_item->window, NULL, &y, NULL, &height,NULL);
Then check if the parent widget is a viewport.
if (gtk_type_is_a(GTK_TYPE(widget->parent), gtk_viewport_get_type))
[ Look at viewport->adjustment->vadjustment, and
figure out from that, list_widget->allocation.height, and geometry
of the list item, whether the list item is visible. ]
Hope this helps,
] [Thread Prev