Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor v divya's Avatar
    Join Date
    Feb 2009
    Posts
    72
    Hi all.. In my form I have added a menu using
    Code:
    f.menu = [u"Exit",exit]
    When I click on this "Exit" I should go back to my previous screen(here it is a listbox). In other words my exit() should come out of my form once clicked..

    How to get this done? Waiting for ur quick replies

  2. #2
    Nokia Developer Moderator croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    Quote Originally Posted by v divya View Post
    Hi all.. In my form I have added a menu using
    Code:
    f.menu = [u"Exit",exit]
    When I click on this "Exit" I should go back to my previous screen(here it is a listbox). In other words my exit() should come out of my form once clicked..

    How to get this done? Waiting for ur quick replies
    [u"Exit",function]
    Call your function by the above statement. When exit is chosen, the function would be executed rather than the exit function.

    Thus you can use it to go back.

    Best Regards,
    Croozeus
    Pankaj Nathani
    www.croozeus.com

  3. #3
    Regular Contributor v divya's Avatar
    Join Date
    Feb 2009
    Posts
    72
    I tried something like that also.. But what statement to use inside that function which will make my code run as I said before.. Pls do help..

  4. #4
    Nokia Developer Moderator croozeus's Avatar
    Join Date
    May 2007
    Location
    21.46 N 72.11 E
    Posts
    3,635
    Quote Originally Posted by v divya View Post
    I tried something like that also.. But what statement to use inside that function which will make my code run as I said before.. Pls do help..
    You cannot have a statement in the function that would just make your code go backwards, sorry. But encapsulate the UI in one or many functions and call any one of which you want to navigate to, when you press exit.
    Pankaj Nathani
    www.croozeus.com

  5. #5
    Nokia Developer Champion gaba88's Avatar
    Join Date
    Feb 2008
    Location
    Ahmedabad, Gujarat, India
    Posts
    3,688
    Quote Originally Posted by v divya View Post
    I tried something like that also.. But what statement to use inside that function which will make my code run as I said before.. Pls do help..
    hello divya

    really sorry but not getting you exactly. I guess you want to go back when you press exit so just make a callback of that function which you are using previously.

    It will be great if you have a look at the following articles before going to make your menu:

    Basic PyS60 application: part1
    Basic PyS60 application: part2


    hope this articles help you.

    Enjoy Pythoning
    Gaba88

  6. #6
    Super Contributor Rafael T.'s Avatar
    Join Date
    Feb 2008
    Location
    Belo Horizonte, Brazil
    Posts
    744
    Just completing the other answers, if you are running an standlone application, you may exit using this:

    Code:
    appuifw.app.set_exit()
    So, basically the code snippet for doing what you want is:

    Code:
    import appuifw
    
    def exit_function():
        app_lock.signal()
        appuifw.app.set_exit # optional
    
    appuifw.app.menu = [u"Exit", exit_function]
    
    app_lock = e32.Ao_lock()
    app_lock.wait()

    Hope it helps,

    Rafael.

Similar Threads

  1. Providing continuous network stream
    By directx in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2008-04-07, 18:41
  2. why my does not exit on N73 when i push exit soft key?
    By byronlilu in forum Mobile Java General
    Replies: 2
    Last Post: 2007-06-28, 21:29
  3. Removing default exit button
    By jmdeveloper in forum Mobile Java General
    Replies: 9
    Last Post: 2006-11-07, 16:30
  4. N70 Reset bug
    By sebboB in forum General Development Questions
    Replies: 2
    Last Post: 2005-12-28, 23:09
  5. UNDESIRED Exit command key.
    By tektronic in forum Mobile Java General
    Replies: 4
    Last Post: 2005-05-13, 18:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved