Popup Menu's

Crittar

Member
Hi,

9.1d01 chui.

I have a popup menu associated with a button. I can get this menu to pop up by hitting esc u when the button has focus but what I would like to do is cause the menu to popup automatically as soon as the user applies focus (i.e. on 'ENTRY' of button). Has anyone out there managed to do this? Has anyone out there any idea what I need to do to make this happen?
 

bendaluz2

Member
I take it then, that writing an ON "ENTRY" trigger doesnt work?

If so, then you could do the following, as long as it is a true chui environment (i.e. no mouse).

Given that this is the case, the only way to get to the button is to tab or back tab onto it, i.e. you cant just click onto it.
So you could define an on "leave" trigger on the previous widget and on "back-tab" on the next widget to create the popup menu.

Hope this helps :)

Originally posted by Crittar
Hi,

9.1d01 chui.

I have a popup menu associated with a button. I can get this menu to pop up by hitting esc u when the button has focus but what I would like to do is cause the menu to popup automatically as soon as the user applies focus (i.e. on 'ENTRY' of button). Has anyone out there managed to do this? Has anyone out there any idea what I need to do to make this happen?
 

Crittar

Member
Originally posted by bendaluz2
I take it then, that writing an ON "ENTRY" trigger doesnt work?

Sorry, I guess my original post was less than clear:

I can detect the entry to the button - I can't find any way to make the menu pop up programatically - I have to hit esc u to cause it to appear. What I really need is an idea of the code to put into the 'on entry' to cause this to happen.
 

bendaluz2

Member
i see, that makes more sense. In windows, I simulate a right mouse button click via the api to make this happen. I would think that applying "ESC-U" to the frame would do the job, since this causes the menu to appear.

Hope it works :)

Originally posted by Crittar
Sorry, I guess my original post was less than clear:

I can detect the entry to the button - I can't find any way to make the menu pop up programatically - I have to hit esc u to cause it to appear. What I really need is an idea of the code to put into the 'on entry' to cause this to happen.
 

Crittar

Member
Originally posted by bendaluz2
i see, that makes more sense. In windows, I simulate a right mouse button click via the api to make this happen. I would think that applying "ESC-U" to the frame would do the job, since this causes the menu to appear.

Hope it works :)

I already tried that - along with applying lot's of other things (having done a LIST-SET-ATTRS to see what I can do) - so far nothing works.

It seems to me that what I want to do should be easy but it doesn't seem to be. :brick:
 

MHotovec

Member
Here's something I've done in some code that works, maybe you can adapt it for your use.
But first, I guess I'm 'forced' to ask, why esc-u on the button? MY users would weird out if I asked them to do such a keystroke. Of course, maybe I'm working with the wrong users...

Anyhow
on choose of {button} in {frame} do:
a bunch of stuff that only matters to me.
end.

on entry of {button} in {frame}
apply 'choose' to {button} in {frame}.

I'm wondering if it has to do with the esc-u. I've had an instance where I wanted to apply a ctrl-u and I could NOT get that thing to work. I could apply any OTHER key that I wanted, but not that combination. A pattern?- I dunno...

Mark
 

Crittar

Member
Mark,

The esc-u comes from the programmers handbook (as does the example I was testing this with as it's smaller than my program).

The choose of the button (in the example) does one thing, esc-u pops up a menu which has several options on it.

What I was aiming for was to pop up the menu on entry and actually leave the button without a function. I ended up having to code round it by giving a radio set on choose of the button - the radio set being the equivalent of the menu options I wanted to present.

BUT (for future reference) if anyone out there knows of a way of forcing a pop-up menu to appear then PLEASE do let me know.
 
Top