Forum Archive

Beta Bug: will_close not triggered in panel UI

ywangd

Following simple UI code does not function properly in current beta build 160024. The will_close method is not called when closing the UI (i.e. tap the cross button). This bug seems only exists in panel UI. If the UI is presented as sheet or popover, the method is trigger properly. Also the code works fine with v1.5.

import ui

class TestUI (ui.View):

    def __init__(self):
        self.flex = 'wh'

    def will_close(self):
        print 'closing'  # will NOT print!

v = TestUI()
v.present('panel')
ywangd

No one can reproduce this bug? Did I miss something?

omz

I can confirm this, will be fixed in the next build.

ywangd

Thanks! :)

ccc

Also on current beta, no label will appear in a full_screen view.

import ui
label = ui.Label()
label.text = 'Hello World!'
label.present()  # works with 'sheet', 'popover', 'panel', but not with 'full_screen'

I can add label.text_color = 'blue' to get the text to appear in full screen mode but that trick does not work if I create a ui.DatePicker instead of a ui.Label.