widget_control, /destroy (buttons) [message #8964] |
Tue, 20 May 1997 00:00  |
R. Bauer
Messages: 137 Registered: November 1996
|
Senior Member |
|
|
Hi,
this is an example for I think a really simple way to remove buttons,
=======================================
n=50
widget_control, map.xlist, get_uval=inwids
n = n_elements(inwids)
for i=0,n-1 do widget_control, inwids(i),/dest
========================================
the buttons were created by this source:
id_xlist = widget_button(bb,val='X',menu=2,xsize=230,uvalue='ID_XLIST')
; Graph list
list=strarr(50)
n=n_elements(list)
wids = lonarr(n_elements(list))
for i=0,n-1 do begin
wids(i) = widget_button(id_Xlist,val=dlist(i),uval='ID_XLIST '+$
strtrim(list(i)))
endfor
widget_control, id_xlist, set_uval=wids
==========================================
Now the question:
On my PC it needs only a few milliseconds to erase 50 buttons, my AIX
Workstation needs 30 seconds.
==========================================
This is the output from time_test for the Workstation:
Compiled module: TIME_TEST.
1 0.791033 Empty For loop, 1 million times
2 1.10210 Call empty procedure (1 param) 100,000 times
3 0.729081 Add 100,000 integer scalars and store
4 0.692555 25,000 scalar loops each of 5 ops, 2 =, 1 if)
5 0.453449 Mult 512 by 512 byte by constant and store, 10
times
6 0.120897 Shift 512 by 512 byte and store, 10 times
7 0.321909 Add constant to 512 x 512 byte array and store, 10
times
8 0.382123 Add two 512 by 512 byte images and store, 10 times
9 0.647779 Mult 512 by 512 floating by constant and store, 10
times
10 0.343291 Add constant to 512 x 512 floating and store, 10
times
11 4.21601 Add two 512 by 512 floating images and store, 10
times
12 0.663108 Invert a 100 by 100 random matrix
13 0.841334 Transpose 256 x 256 byte, FOR loops
14 0.129078 Transpose 256 x 256 byte, row and column ops
15 0.0704670 Transpose 256 x 256 byte, transpose function
16 1.77501 Log of 100,000 numbers, FOR loop
17 0.294971 Log of 100,000 numbers, vector ops
18 1.84227 Add two 100000 element floating vectors, FOR loop
19 0.0375990 Add two 100000 element floating vectors, vector op
20 0.397431 65536 point real to complex FFT
21 0.235875 Smooth 512 by 512 byte array, 5x5 boxcar
22 0.457804 Smooth 512 by 512 floating array, 5x5 boxcar
23 0.268260 Write and read 10 512 by 512 byte arrays
16.8134=Total Time, 0.43873257=Geometric mean, 23
tests.
What is wrong whith idl on my workstation?
--
R.Bauer
Institut fuer Stratosphaerische Chemie (ICG-1)
Forschungszentrum Juelich
email: R.Bauer@fz-juelich.de
|
|
|
Re: widget_control, /destroy (buttons) [message #9042 is a reply to message #8964] |
Wed, 21 May 1997 00:00  |
Mike Schienle
Messages: 37 Registered: May 1997
|
Member |
|
|
R. Bauer wrote:
>
> Hi,
> this is an example for I think a really simple way to remove buttons,
>
> =======================================
>
> n=50
> widget_control, map.xlist, get_uval=inwids
> n = n_elements(inwids)
> for i=0,n-1 do widget_control, inwids(i),/dest
>
> ========================================
>
> What is wrong whith idl on my workstation?
Cc'd to R. Bauer
Try turning off "updates" to the window manager. Your workstation is
trying to update the display every time you destroy a widget. In my
case, I have two widget hierarchies overlapping each other within the
same base (no row/column control of the base). I want to display the
widgets before the second hierarchy is created so the user sees
something quickly. The rest of the widgets take a few moments to be
created. After all of the widget hierarchies are modified, update the
base of the hierarchy.
; Only realize if we are using X Windows
; X Windows can turn off "Updates" allowing all updates to be
; performed after the commands have been issued. This can be a
; big performance boost.
IF (!Version.OS_Family EQ 'unix') THEN $
Widget_Control, wBase, /Realize
; turn off updates - not honored by all window systems
Widget_Control, wBase, Update=0
; commands to create overlapping hierarchy
...
Widget_Control, wBase, Update=1
IF NOT (Widget_Info(wBase, /Realized)) THEN $
Widget_Control, wBase, /Realize
In your case, surround your loop with the Update calls.
--
Mike Schienle Hughes STX - EROS Data Center, Sioux Falls, SD
Work: schienle@edcsgw13.cr.usgs.gov Home: mgs@sd.cybernex.net
|
|
|