Re: GtkLayout: correct use or kludge?



greg <gregor waltz villanova edu> writes: 
the widget is basically a container in which the children get scrolled
differently. one child gets scrolled in both directions, while others
are only scrolled by one or none. so, the latter widgets are stationary
in at least one direction. all of the children are visible at all times;
they never scroll off the viewable area as would happen if they were
scrolled normally.

Ouch, this is going to be a real pain in the ass to do smoothly. Well,
"no scrolling" is easy; just make the child a child of layout->window
not layout->bin_window - except the layout has no API for that, so
you'll need a custom container widget using layout code,
probably. Scrolling in one direction I don't know how you'll do.

i was about to try one of two ideas, but before i start i was hoping to
get some opinions.

1) use a gtklayout to hold everything. move the children on scroll
events accordingly by setting their attribute (x,y) position. then use
gdk_window_lower to put the fully scrollable child under everthing so it
doesn't obscure other children when scrolled.

2) use a layout to hold multiple layouts. each child layout is given a
viewable area (size) and attached to the appropriate scroll bars.

i think 2 sounds better, but i'm not sure yet. any ideas?

Neither of those sounds really right... 

The idea of a layout is that child widgets are automatically scrolled
for you. So you may not want to use a layout, if you're doing this -
you'll have to scroll, then move the one-dimension children back in
one dimension, which will flicker and jump, and require a confusing
calculation of some kind.

Maybe have a look at the GtkLayout test in testgtk, that could be
helpful.

Havoc



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]