| Reply | « Previous Thread | Next Thread » |
|
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
|
|
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
|
|
Join Date: Feb 2008
Posts: 743
Location: Belo Horizonte, Brazil
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 | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| 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 |