(Ooops, I missed an inverted pvwave on the group name.
So here's a second go:)
Re again,...
I want to combine a couple of files into one using
PICKFILE() or something similar. I only have access
to idl 4.0.1 on MS Win95, i know it's obsolete in
a later version.
Now, when I make a widget with a done button and set
its base to be a group leader, its button is grayed
out while PICKFILE is active (GROUP=... set). Is there
a way to avoid that? I can't seem to find that.
Probably someone else already has solved this much
more neatly.
Thanks a lot,
Regards,
Peter.
---
Peter Cornelius <pc***NOSPAM***@inr.fzk.de>
P.S.: Here's how I thought that I could get along.
One might find a way to get around the loop
(Well, er... admittedly, I'm not an
experienced idl programmer... 8-S).
PRO DestroyManyBase
COMMON ManyBaseComm, ManyBase
WIDGET_CONTROL, ManyBase, /DESTROY
END
FUNCTION SelectManyFiles, PATH = StartPath,$
FILTER = FileFilter, FILE = DefaultFile
; This procedure opens a window and allows the user
; to select a(n arbitrary?) number of files that it
; returns as an array of strings.
COMMON GlobalFileVars
COMMON ManyBaseComm
; Create a base to hold the widget
ManyBase = WIDGET_BASE( $
COLUMN=1, $
MAP=1, $
TITLE='Select Files', $
UVALUE='ManyBase')
; Create its contents.
ManyLabel = WIDGET_TEXT(ManyBase, $
EVENT_FUNC='NoOp', $
GROUP_LEADER=ManyBase, $
/ALIGN_CENTER, $
UVALUE='ManyLabel', $
VALUE='Selected files:')
ManyText = WIDGET_TEXT(ManyBase, $
EVENT_FUNC='NoOp', $
GROUP_LEADER=ManyBase, $
UVALUE='ManyText', $
VALUE='')
ManyButton = WIDGET_BUTTON( ManyBase, $
/ALIGN_CENTER, $
EVENT_PRO='DestroyManyBase', $
GROUP_LEADER=ManyBase, $
UVALUE='ManyButton', $
VALUE='DONE')
; Realize widget.
WIDGET_CONTROL, ManyBase, /REALIZE
; Finally register with XMANAGER.
XMANAGER, 'Select Files', ManyBase, GROUP_LEADER=ManyBase
FileNames=MAKE_ARRAY(1024,1, /STRING)
I=0
REPEAT BEGIN
FileNames(I)=PICKFILE(FILTER=FileFilter, FILE=DefaultFile, $
PATH=StartPath, GET_PATH=StartPath, GROUP=ManyBase)
WIDGET_CONTROL, ManyText, $
SET_VALUE=FileNames(I)+STRING(13B), /APPEND
I=I+1
WAIT, 1 ; This is how I bail out presently.
NotDone=WIDGET_INFO(ManyBase, /VALID_ID)
ENDREP UNTIL ( NotDone NE 0 )
RETURN, FileNames
; Oughta return count as well...
END
|