You Are Here:

Community: Developer Discussion Boards

#1 Old Native app: press exit twice - 2006-02-24, 13:33

Join Date: Oct 2004
Posts: 158
bercobeute
Offline
Regular Contributor
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.
Reply With Quote

#2 Old Re: Native app: press exit twice - 2006-02-25, 20:09

Join Date: Jan 2006
Posts: 67
slitchfield
Offline
Regular Contributor
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
Reply With Quote

#3 Old Re: Native app: press exit twice - 2006-02-25, 21:27

Join Date: Feb 2005
Posts: 5
ttheoria
Offline
Registered User
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__).
Reply With Quote

#4 Old Re: Native app: press exit twice - 2006-02-26, 15:57

Join Date: May 2005
Posts: 33
pimol
Offline
Registered User
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
Reply With Quote

#5 Old Re: Native app: press exit twice - 2006-02-26, 18:02

Join Date: Oct 2004
Posts: 158
bercobeute
Offline
Regular Contributor
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()
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
N70 Reset bug sebboB General Discussion 2 2005-12-29 00:09
Standalone App Exit? maym Python 2 2005-08-09 01:58
Invoking Midlet by a Native app.? ronga Mobile Java General 0 2005-05-09 20:42
Invoking Midlet by a Native app.? ronga General Symbian C++ 0 2005-05-09 20:38
Communication with native Symbian app on Nokia 7650 LiamQ Mobile Java General 1 2002-08-01 13:56

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