You Are Here:

Community: Developer Discussion Boards

#1 Old Menu item auto-invoking method - 2005-08-21, 22:49

Join Date: Oct 2004
Posts: 158
bercobeute
Offline
Regular Contributor
If the handle given with a menu item has elipses ('()') the method is automatically invoked.

Code:
appuifw.app.menu  = [( u"Start", self.start(go=True))]

def start(self, go=True):
    if go:
        print 'hi'
Is this standard behaviour? Is it at all possible to invoke the handle with a value?
Reply With Quote

#2 Old 2005-08-22, 09:43

Join Date: Dec 2004
Posts: 646
jplauril's Avatar
jplauril
Offline
Forum Nokia Expert
Yes, it's standard Python behaviour. Use:
Code:
appuifw.app.menu  = [( u"Start", lambda:self.start(go=True))]
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia