You Are Here:

Community: Developer Discussion Boards

#1 Old Smile Main screen - 2008-08-14, 09:13

Join Date: Apr 2008
Posts: 32
Faisal Rehman
Offline
Registered User
Hi

I want to make main screen for my application in which multiple icons are available.user have to select one icon to enter into purticular section.

Can any body help me how to make main screen in python?
thanx
Reply With Quote

#2 Old Re: Main screen - 2008-08-14, 09:20

Join Date: Oct 2007
Posts: 2,841
Location: Deva, Romania
bogdan.galiceanu's Avatar
bogdan.galiceanu
Offline
Forum Nokia Champion
Hi,

I'm not sure I understand what you mean, but I suppose you could draw some images that represent the icons on a canvas and have that as the app's screen. Is that what you meant?
Reply With Quote

#3 Old Re: Main screen - 2008-08-14, 09:28

Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
Send a message via Yahoo to gaba88 Send a message via Skype™ to gaba88
gaba88's Avatar
gaba88
Offline
Forum Nokia Champion
Quote:
Originally Posted by Faisal Rehman View Post
Hi

I want to make main screen for my application in which multiple icons are available.user have to select one icon to enter into purticular section.

Can any body help me how to make main screen in python?
thanx
hi Faisal Rehman
yes bogdan is absolutely correct it will be better if you explain your question bit in detail.

Thanks
Gaba88


Gargi Das- http://gargidas.blogsot.com

Forum Nokia Python Wiki


Learn Python at http://mobapps.org/PyS60
Reply With Quote

#4 Old Re: Main screen - 2008-08-14, 12:50

Join Date: Sep 2005
Posts: 314
Location: Finland, Helsinki
aaaaapo
Offline
Regular Contributor
Quote:
Originally Posted by Faisal Rehman View Post
I want to make main screen for my application in which multiple icons are available. user have to select one icon to enter into purticular section.
You can create e.g. appuifw.Listbox(), which contains names and icons of all sections. If the user selects a item from the Listbox, your listbox handler calls the activate()-method of appropriate object.

Untested pseudocode, some mandatory parts may not exist:

Code:
class Main:
    def __init__(self):
        self.lock = e32.Ao_lock()
        self.menu_entries = []
        self.menu_entries.append(((u"Screen 1"), Scr1(self)))
        self.menu_entries.append(((u"Other"), Other(self)))
        # Create main menu from that sequence
        self.main_menu = [item[0] for item in self.menu_entries]
        # Create list of views from sequence above
        self.views = [item[1] for item in self.menu_entries]
        # Create a listbox from main_menu and set select-handler
        self.listbox = appuifw.Listbox(self.main_menu, self.handle_select)
        self.activate()

    def handle_select(self):
        self.views[self.listbox.current()].activate()

    def run(self):
        self.lock.wait()
        self.close()

    def activate(self):
        """Set main menu to app.body."""
        appuifw.app.exit_key_handler = self.exit_key_handler
        appuifw.app.body = self.listbox

    def exit_key_handler(self):
        if appuifw.query(u"Quit program", 'query') is True:
            self.running = False
            self.lock.signal()

class Scr1:
    def __init__(self, parent):
        self.parent = parent
        # initialize app.body here

    def activate(self):
        # draw screen stuff here

    def close(self):
        self.parent.activate() # restores main screen

App = Main()
App.run()
I may have complete example somewhere, if you are interested.
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
Emulator main screen overwrites application screen nguyenhoaiduc Symbian User Interface 4 2009-02-05 16:40
user interface ideas - options menu vs. main screen menus hp3 WRT Widget Development 0 2008-06-12 19:38
Return from the second screen to main screen akus Python 2 2007-09-14 10:41
How to display an icon on the main screen sergiutruta Mobile Java General 2 2005-02-15 13:53
program to move files from phone main screen j2me_raj General Symbian C++ 6 2004-11-19 11:51

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