Expose Events (easy questions) [message #30067] |
Wed, 03 April 2002 07:27 |
Ted Cary
Messages: 53 Registered: October 2001
|
Member |
|
|
Hello all,
Anyone with experience using scrollable, resizable draw widgets and RETAIN=0
should be able to answer these easily.
What is contained in the X and Y fields of the structure generated by a draw
widget expose event ? I'm using a draw widget with APP_SCROLL set
(RETAIN=0, etc...). As far as I can tell, the Y field contains the
y-coordinate of the viewport's vertical slider or something related to it,
which makes sense. What does not make sense is that the X field definitely
contains the *vertical* screen size of the draw widget, always the same
thing as returned in the SCR_YSIZE field of WIDGET_INFO geometry structure.
I'm missing something.
The APP_SCROLL draw widget is in a resizable base. The expose events are
generated when the base is resized, at which point it is necessary to redraw
the viewable portion of the image according to the position of the
viewport's two sliders. If information on the sliders' positions is not
contained in the expose event structure or the WIDGET_INFO geometry
structure, how can I query the widget to get the positions? Since the X and
Y fields of viewport motion events do contain information on slider
positions, do I actually have to store this information in an info
structure each time a viewport motion event is generated, then use the
stored values when an expose event occurs? Is it possible to
programmatically position the sliders?
Finally, is this even the fastest way to scroll through a large image?
That's the motivation behind using APP_SCROLL in the first place. Should I
be using any other techniques as well, like DEVICE_COPYING from pixmaps or
anything like that?
Thanks
|
|
|