[Gambas-user] how to capture click event on a popup menu.

Tobias Boege taboege at ...626...
Wed Dec 3 00:18:44 CET 2014


On Wed, 03 Dec 2014, B Bruen wrote:
> On Tue, 2 Dec 2014 22:44:04 +0100
> Tobias Boege <taboege at ...626...> wrote:
> 
> > On Tue, 02 Dec 2014, Martin McGlensey wrote:
> > > Hello,
> > > 
> > >  
> > > 
> > > I've used the menu to create menus on my main form. Those that I want to see
> > > on the tool bar are marked visible. Those that I want to use as popups are
> > > not visible on the tool bar. These two menus are attached to individual text
> > > boxes in the graphic form designer. When I right click on the textbox the
> > > popup appears but, when I click on it nothing happens. In the form code I
> > > have the sub:
> > > 
> > >  
> > > 
> > > Private Sub mnuA_Click()
> > > 
> > >                 FForm.Open
> > > 
> > > End
> > > 
> > >  
> > > 
> > > The form FForm does not open. In the debugger I can see the click event is
> > > not captured. What did I miss?
> > > 
> > 
> > Well, what's the event name of your menu?
> > 
> > Or if you don't want us to guess around: Can you send the project?
> > 
> > Regards,
> > Tobi
> > 
> 
> I can guess :-)
> 
> PUBLIC Sub mnuA_Click()
> 

Don't encourage this behaviour :-)

To elaborate: event handlers must be declared Public (not Private) so that
the interpreter can find them when an event fires.

Regards,
Tobi

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk




More information about the User mailing list