Re: having a scollable widget
- From: Havoc Pennington <hp redhat com>
- To: gregor waltz villanova edu
- Cc: gtk-app-devel-list gnome org
- Subject: Re: having a scollable widget
- Date: 10 Feb 2001 12:29:44 -0500
gregor waltz villanova edu writes:
so for 1.3.x, the widget should listen for the
set_scroll_adjustments_signal then use gdk_window_scroll?
Nope, the set_scroll_adjustments_signal is just how the scrolled
window will give you your adjustments. Then you have to set all the
values in the adjustments, and scroll when adjustment->value changes.
Normally you use adjustment->value to represent the X or Y coordinate
to scroll to.
I forgot to mention the bin_window thing - you want widget->window to
stay fixed and be the size of your widget size allocation, and then
you scroll the bin_window around inside it. bin_window should be the
size of the entire scrollable area.
GtkTextView uses this technique.
GtkTreeView and GtkLayout look like they're using gdk_window_move()
instead of gdk_window_scroll(), I'm not sure what's up with that, I
have to ask Jonathan and Owen.
Anyway, get the source code and check out some of these widgets.
do you recommend just inheriting from GtkLayout?
It might make things a bit easier, but hardly necessary, most of the
hard logic is now in GDK instead of GtkLayout, so GtkLayout isn't
doing anything too fancy. GtkLayout is probably a much simpler example
than the TextView or TreeView though.
Havoc
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]