comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Problems with draw_xsize keyword in widget_control
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Problems with draw_xsize keyword in widget_control [message #5575] Tue, 09 January 1996 00:00
ldorffne is currently offline  ldorffne
Messages: 2
Registered: December 1995
Junior Member
I have problems with the 'draw_xsize' and 'draw_ysize' keywords in
widget_control. As the manual says those keywords can be used to change the
width and height of the drawable area for scrolling draw widgets. With the
keywords 'scr_xsize' and 'scr_ysize' I only can change the viewport size.

Example (see also Program-Code below):
If I have a scrolling draw widget with a size of 500 and a scroll_size of 300
I can display a 500x500 image and use the scrollbars to move around. If now I
want to load an image with 600x600 pixels I have to enlarge the viewport size
using the command 'widget_control, widget_id, scr_xsize=600, scr_ysize=600'.
But also I now have a larger viewport the drawable area is still 500x500. So I
want to use the command 'widget_control, widget_id, draw_xsize=600,
draw_ysize=600' to also enlarge the drawable area. But the result is
ablolutely not what I expected and what I wanted.

I am doing something wrong or is there a bug in the 'draw_x/ysize' keywords?
Any hint woul be very helpfull.
Thanks in advance,
Lionel

Here is the Program-Code to check this problem.
------------------------------------------------------------ -------------------
;Select a new image size with the slider and then press a button in the
;drawing area to generate the image.

pro test_events, event
type = widget_info(event.id, /type)
IF type EQ 1L THEN $ ;button event
WIDGET_CONTROL, event.top, /destroy
IF type EQ 4L THEN BEGIN ;draw event
IF event.type EQ 0 THEN BEGIN ;button pressed
WIDGET_CONTROL, event.id-1, get_value=anz
; print,anz*100
ima = lindgen(anz*100,anz*100)
erase
WIDGET_CONTROL, event.id, scr_xsize=anz*100 ;set new screen_size
WIDGET_CONTROL, event.id, scr_ysize=anz*100
;Up to now everything is working well
WIDGET_CONTROL, event.id, draw_xsize=anz*100 ;set new graphic region
WIDGET_CONTROL, event.id, draw_ysize=anz*100
tvscl, ima
ENDIF
ENDIF
END

pro test
base = WIDGET_base(/COLUMN)
slider = WIDGET_slider(base, minimum=2, maximum=8, value=4)
draw = WIDGET_draw(base, scr_xsize=500, scr_ysize=500, x_scroll_size=300, $
y_scroll_size=300, retain=2, /BUTTON_EVENTS, /SCROLL)
button = WIDGET_button(base, value='QUIT')
WIDGET_CONTROL, /realize, base
ima = lindgen(400,400)
tvscl,ima
XManager, "test", base, EVENT_HANDLER = 'test_events', group = group
END
------------------------------------------------------------ -------------------

------------------------------------------------------------ ----------------
Lionel Dorffner Institute for Photogrammetry and Remote Sensing
Technical University Vienna
Gusshausstrasse 27-29 / 122
A-1040 Vienna
Tel ++43 1 58801 3819
INTERNET: ldorffne@fbgeo1.tuwien.ac.at Fax ++43 1 5056268
------------------------------------------------------------ ----------------
[Message index]
 
Read Message
Previous Topic: Point/Polygon Routine
Next Topic: Re: INT_TABULATED function crashes

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Sat Oct 11 08:59:32 PDT 2025

Total time taken to generate the page: 7.12320 seconds