×

Discussion Board

Results 1 to 5 of 5
  1. #1
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    158

    Native app: press exit twice

    I've rolled a native Python app, but I have to press 'exit' twice to close it. Pressing it once turns the screen completely white.

  2. #2
    Regular Contributor
    Join Date
    Jan 2006
    Posts
    67

    Re: Native app: press exit twice

    Quote Originally Posted by bercobeute
    I've rolled a native Python app, but I have to press 'exit' twice to close it. Pressing it once turns the screen completely white.
    Sounds like a simple menu/loop logic error, I've had plenty of those. Why not post your code somewhere, for people to see if they can spot the problem?

    Steve

  3. #3
    Registered User
    Join Date
    Feb 2005
    Posts
    5

    Re: Native app: press exit twice

    It should because the first time, you execute the code in your app exit handler function, in which you reset the exit handler back to the old one. And the old exit handler is actually the exit function of python itself (and that's what you call at the second exit). Last time i saw this kind of bug was because i had an error in the code dealing with the exit of the application (like in close or __del__).

  4. #4
    Registered User
    Join Date
    May 2005
    Posts
    34

    Re: Native app: press exit twice

    Quote Originally Posted by bercobeute
    I've rolled a native Python app, but I have to press 'exit' twice to close it. Pressing it once turns the screen completely white.
    Did you put appuifw.app.set_exit() at the "exit point"(s)?

    Pimol

  5. #5
    Regular Contributor
    Join Date
    Oct 2004
    Posts
    158

    Re: Native app: press exit twice

    Thanks all for the replies. It turned out that the problem had to do with case sensitivity

    See below: the abort() is called from within the application when exiting. In my previous version of the method set_exit_if_standalone() (taken somewhere else from this forum) the method didn't check for case sensitivity of the application name. Unfortunately the application name can differ in casing... The code below works fine.

    Code:
    def loop( self ):
      try:
        while not self.exit_flag:
           self.lock.wait()
      finally:
        pass
    
    def abort( self ):
      self.exit_flag = True
      self.lock.signal()
      self.set_exit_if_standalone()
    
    def set_exit_if_standalone(self):
      appname = appuifw.app.full_name().lower()
      if appname[-10:] != u"Python.app".lower():
        appuifw.app.set_exit()

Similar Threads

  1. N70 Reset bug
    By sebboB in forum General Development Questions
    Replies: 2
    Last Post: 2005-12-28, 23:09
  2. Standalone App Exit?
    By maym in forum Symbian
    Replies: 2
    Last Post: 2005-08-09, 00:58
  3. Invoking Midlet by a Native app.?
    By ronga in forum Mobile Java General
    Replies: 0
    Last Post: 2005-05-09, 19:42
  4. Invoking Midlet by a Native app.?
    By ronga in forum Symbian
    Replies: 0
    Last Post: 2005-05-09, 19:38
  5. Communication with native Symbian app on Nokia 7650
    By LiamQ in forum Mobile Java General
    Replies: 1
    Last Post: 2002-08-01, 12:56

Posting Permissions

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