You Are Here:

Community: Developer Discussion Boards

#1 Old Listbox + Menu - 2008-10-30, 07:54

Join Date: Oct 2008
Posts: 29
mango7
Offline
Registered User
Hi,

Does anyone know how to use a listbox with a menu? I get an error that says: 'tuple' object is not callable'.

Relevant example portions of code are below:

Code:
   def __init__(self, mt):
         self.menuOptions = [('Add', self.Add),
                            ('Subtract', self.Subtract)
                            ('Multiply', self.Multiply)]       
    def Add(self):
        ...

    def Subtract(self):
        ...

    def Multiply(self):
        ...

    def displayScreen(self):
         appuifw.app.menu = self.menuOptions
Reply With Quote

#2 Old Re: Listbox + Menu - 2008-10-30, 08:14

Join Date: Oct 2008
Posts: 29
mango7
Offline
Registered User
Sorry for that post, I got it working. Here it is for the benefit of people navigating to this thread:

Code:
def __init__(self, mt):
         self.menuOptions = [(u'Add', self.Add),
                            (u'Subtract', self.Subtract),
                            (u'Multiply', self.Multiply)]       
    def Add(self):
        ...

    def Subtract(self):
        ...

    def Multiply(self):
        ...

    def displayScreen(self):
         appuifw.app.menu = self.menuOptions
Reply With Quote

#3 Old Re: Listbox + Menu - 2008-10-30, 19:48

Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
Send a message via Skype™ to Rafael T.
Rafael T.'s Avatar
Rafael T.
Offline
Forum Nokia Champion
Hi mango7,

Yes, you should always use commas to separate items from a list and in case of menu the title/options must be a unicode string. Good you found that out by yourself


BR,

Rafael.
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
Similar Threads
Thread Thread Starter Forum Replies Last Post
dynemic menu pankaj gupta55 General Symbian C++ 1 2008-09-20 12:33
Creating menu to listbox silverrocha Symbian User Interface 5 2008-05-11 19:26
opening a menu in listbox santhosh.ram General Symbian C++ 3 2008-02-22 12:03
Application with Listbox Menu and Multiview UI? junnikokuki Symbian User Interface 2 2007-12-20 13:26
slide menu in j2me afka Mobile Java General 4 2006-09-04 10:10

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