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

Home » Public Forums » archive » Re: dialog_pickfile return question..
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: dialog_pickfile return question.. [message #54315 is a reply to message #54314] Wed, 06 June 2007 09:13 Go to previous messageGo to previous message
jkj is currently offline  jkj
Messages: 48
Registered: April 2007
Member
On Jun 6, 10:44 am, ryans...@gmail.com wrote:
> How would I go about getting the path choosen from Dialog Pickfile and
> then having that path appear in a pre-existing widget_text? I have
> attempted using a pointer but I could not get it to work, as the
> widget_text doesn't 'update'.
>
> Here is my code, if anyone could help it would be fantastic!
>
> PRO test_event, ev
> widget_control, ev.id, get_value=value
> widget_control, ev.top, get_uvalue=info
>
> if value eq '...' then begin
> filepicked = DIALOG_PICKFILE (/READ)
> print, "File picked"
> print, filepicked
> fp = ptr_new(filepicked)
> END
>
> END
>
> PRO test, value
>
> main = widget_base (title='PRO', MBAR=bar, /row)
> wt0 = WIDGET_TEXT(main, XSIZE=15, uvalue='Filename', /ALL_EVENTS, /
> EDITABLE)
>
> findfiles = widget_button (main, value='...')
>
> widget_control, main, /realize
> widget_control, main, set_uvalue=info
> xmanager, 'experiment', main
>
> END
>
> Thanks,
> Ryan

Sent the id of widget_text to the handler in the info structure and
then update it from within the event handler:

1. Add wt0 to the info structure:
info = { $
id:wt0 $
}

....
2. use wt0 in the event handler:
filepicked = DIALOG_PICKFILE (/READ)
widget_control, info.id, set_value=filepicked

-Kevin
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: scaling idlGrAxis ticks?
Next Topic: How to use backing store while using object graphics?

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

Current Time: Wed Oct 08 19:09:36 PDT 2025

Total time taken to generate the page: 0.00783 seconds