Re: TEXT FIELD in a CONTEXT MENU ? [message #66593] |
Mon, 25 May 2009 18:04 |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
On May 25, 8:57 pm, nata <bernat.puigdomen...@gmail.com> wrote:
> Hi,
>
> Coding my pop-up program I've 1 question of how to implement a
> specific property.
> I want the same functionality as a CONTEXT_MENU, so if the pop-up
> loses the focus, it has to disappear.
>
> I can place the pop-up correctly but I'm not sure of how to do this.
> Any suggestions ?
>
ok KBRD_FOCUS_EVENTS is the solution
|
|
|
Re: TEXT FIELD in a CONTEXT MENU ? [message #66594 is a reply to message #66593] |
Mon, 25 May 2009 17:57  |
natha
Messages: 482 Registered: October 2007
|
Senior Member |
|
|
Hi,
Coding my pop-up program I've 1 question of how to implement a
specific property.
I want the same functionality as a CONTEXT_MENU, so if the pop-up
loses the focus, it has to disappear.
I can place the pop-up correctly but I'm not sure of how to do this.
Any suggestions ?
Thanks,
nata
|
|
|
|
Re: TEXT FIELD in a CONTEXT MENU ? [message #66596 is a reply to message #66595] |
Mon, 25 May 2009 13:00  |
David Fanning
Messages: 11724 Registered: August 2001
|
Senior Member |
|
|
nata writes:
> I want to display a CONTEXT MENU (pop-up or shortcut menu) with a
> WIDGET_TEXT or CW_FIELD. I don't know if it's possible because, right
> now, when I try to add a text component, the IDL gives me the
> following message: Parent is of incorrect type.
>
> base=WIDGET_BASE(parent,/COLUMN,/FRAME,/CONTEXT_MENU)
> option_1=CW_PDMENU(base,['0\ option 1'],/CONTEXT_MENU)
>
> ;; here is where I've the problem -------------------------------
> option_text=WIDGET_TEXT(base,VALUE='text')
> ;;
> ------------------------------------------------------------ ---------
> WIDGET_DISPLAYCONTEXTMENU, event.id, event.x, event.y, base
>
> Is there a correct way to add a text field in a CONTEXT MENU ? If not
> how can I do something similar?
Only button widgets are allowed as children of a contextmenu base
widget. What you want to do isn't possible with context menus.
You are free, of course, to build your own pop-up dialog
widgets in any way you like.
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
|
|
|