Real Software Forums

The forum for Real Studio and other Real Software products.
[ REAL Software Website | Board Index ]
It is currently Mon Apr 24, 2017 3:55 pm
xojo

All times are UTC - 5 hours




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Menu handler issue
PostPosted: Sat May 25, 2013 2:59 am 
Offline

Joined: Sun Oct 17, 2010 9:46 am
Posts: 83
Location: Berlin, Germany
I have an issue with a menu handler. One is called MenuWindowClose, the other MenuWindowMinimize. The code is:
Close()
Return True
and:
Minimize()
Return True
Now "Close()" calls the event handler "Close" of the window instead of closing the window, "Minimize()" works as expected.

I need to put Self in front of Close(). This is of course a solution, though it slightly frightens me, that the behavior differs. Does it mean, if I want to be on the safe side, I should always put Self in front of each method call in any menu handler?


Top
 Profile  
 
 Post subject: Re: Menu handler issue
PostPosted: Mon May 27, 2013 9:14 pm 
Offline
User avatar

Joined: Fri Nov 10, 2006 4:10 pm
Posts: 1855
Location: Michigan, USA
You're working with overloaded names here, and there can easily be confusion between inherited methods, private methods, and events. I recommend using the RaiseEvent keyword for events, as it will ensure the compiler knows what you're referring to.
RaiseEvent Close()
Return True


Hope this helps! :)

_________________
Windows 8 x64
Windows XP Pro SP3
Ubuntu 11.04 via Virtual Box
RS Enterprise 2012r1.1

Programming Tutorials & Free Projects: http://www.JasonTheAdams.com
"Christianity has not been tried and found wanting; it has been found difficult and not tried." - G.K. Chesterton


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC - 5 hours


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group