×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    35

    [bug?] canvas.bind crashes my app

    Hi everyone,

    I'm experiencing strange behaviour from Python. The documentation says that the expression

    Code:
    canvas.bind(EButton1Down,None)
    is used to clear all callbacks for EButton1Down event. However, after this line is used in a program, Python silently crashes whenever I click the screen. Am I doing something wrong?

    A little program to illustrate the trouble:

    Code:
    import appuifw, graphics, e32
    from key_codes import *
    
    def handle_redraw(rect):
    	if img:
    		canvas.blit(img)
    
    def dummy(pos):
    	pass
    
    
    def app_quit():
    	app_lock.signal()
    
    img = None
    
    canvas = appuifw.Canvas(redraw_callback = handle_redraw)
    appuifw.app.body = canvas
    appuifw.app.screen = "large"
    appuifw.app.directional_pad = False
    appuifw.app.exit_key_handler = app_quit
    
    canvas.bind(EButton1Down,None)
    
    img = graphics.Image.new(canvas.size)
    
    img.clear((0,0,0))
    
    app_lock = e32.Ao_lock()
    app_lock.wait()
    This program crashes Python whenever I click the black area of the screen. The workaround I found is to use

    Code:
    canvas.bind(EButton1Down,dummy,((0,0),canvas.size))
    after clearing the callbacks, but I want to know if that's a bug or just my own error?

  2. #2
    Registered User
    Join Date
    Dec 2008
    Posts
    35

    Re: Supply T-Talk Classic Animal figure Bluetooth

    Thank you, this was reeeeeeeeeeeally helpful, now get out!

  3. #3
    Super Contributor
    Join Date
    Nov 2007
    Location
    Sertaozinho/Brazil
    Posts
    768

    Re: [bug?] canvas.bind crashes my app

    Quote Originally Posted by uhm57 View Post
    I'm experiencing strange behaviour from Python. The documentation says that the expression

    Code:
    canvas.bind(EButton1Down,None)
    is used to clear all callbacks for EButton1Down event. However, after this line is used in a program, Python silently crashes whenever I click the screen. Am I doing something wrong?
    Weird ! All events are disabled by default and you seem to be exercised another test path: turn off them before enabling. May be a bug. In all my programs using canvas I never did something similar, I always enable some parts of screen to be touch sensitive and I removed them after, when not necessary anymore. I will test using my phone and provide some feedback to you (and maemo rep).

    PS: I advised the admins about the ads message.

Similar Threads

  1. App crashes at AppendL() function
    By Rajani_sp in forum Symbian User Interface
    Replies: 22
    Last Post: 2007-10-23, 12:00
  2. App crashes in various stages - 3rd Edition
    By m00gl3 in forum Symbian
    Replies: 2
    Last Post: 2006-05-17, 04:17
  3. RemoteInfo using RAdvGsmCall, app crashes!!
    By prakashsainani in forum Symbian
    Replies: 7
    Last Post: 2004-06-03, 03:51
  4. Screensaver hanges my app
    By xdimas in forum Symbian User Interface
    Replies: 3
    Last Post: 2004-05-31, 10:12
  5. Replies: 0
    Last Post: 2002-06-03, 14:40

Posting Permissions

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