def _update_quickfind_label(self, _, value):
qlabel = self._quickfind_label
if value:
if qlabel:
qlabel.text = value
else:
self._quickfind_label = CompatTextInput(
text=value, size_hint=(None, None), pos=self.pos,
font_size=self.quickfind_font_size,
size=(self.width, int(self.quickfind_font_size * 2.3)))
Window.add_widget(self._quickfind_label)
else:
if qlabel:
Window.remove_widget(qlabel)
self._quickfind_label = None
python类remove_widget()的实例源码
def dismiss(self):
self.children[0].children[0].on_ctx_dismiss()
self.dispatch('on_dismiss')
Window.remove_widget(self)
def begin(self):
if self.button_text == '':
self.remove_widget(self.ids['_button'])
else:
self.ids['_spacer'].width = dp(16) if \
DEVICE_TYPE == "mobile" else dp(40)
self.padding_right = dp(16)
Window.add_widget(self)
anim = Animation(y=0, duration=.3, t='out_quad')
anim.start(self)
Clock.schedule_once(lambda dt: self.die(), self.duration)
def die(self):
anim = Animation(top=0, duration=.3, t='out_quad')
anim.bind(on_complete=lambda *args: _play_next(self))
anim.bind(on_complete=lambda *args: Window.remove_widget(self))
anim.start(self)
def dismiss(self):
Window.remove_widget(self)
def begin(self):
if self.button_text == '':
self.remove_widget(self.ids['_button'])
else:
self.ids['_spacer'].width = dp(16) if DEVICE_TYPE == "mobile" else dp(40)
self.padding_right = dp(16)
Window.add_widget(self)
anim = Animation(y=0, duration=.3, t='out_quad')
anim.start(self)
Clock.schedule_once(lambda dt: self.die(), self.duration)
def die(self):
anim = Animation(top=0, duration=.3, t='out_quad')
anim.bind(on_complete=lambda *args: manager._play_next(self))
anim.bind(on_complete=lambda *args: Window.remove_widget(self))
anim.start(self)
def dismiss(self):
Window.remove_widget(self)
def begin(self):
if self.button_text == '':
self.remove_widget(self.ids['_button'])
else:
self.ids['_spacer'].width = dp(16) if \
DEVICE_TYPE == "mobile" else dp(40)
self.padding_right = dp(16)
Window.add_widget(self)
anim = Animation(y=0, duration=.3, t='out_quad')
anim.start(self)
Clock.schedule_once(lambda dt: self.die(), self.duration)
def die(self):
anim = Animation(top=0, duration=.3, t='out_quad')
anim.bind(on_complete=lambda *args: _play_next(self))
anim.bind(on_complete=lambda *args: Window.remove_widget(self))
anim.start(self)
def dismiss(self):
Window.remove_widget(self)
def begin(self):
if self.button_text == '':
self.remove_widget(self.ids['_button'])
else:
self.ids['_spacer'].width = dp(16) if \
DEVICE_TYPE == "mobile" else dp(40)
self.padding_right = dp(16)
Window.add_widget(self)
anim = Animation(y=0, duration=.3, t='out_quad')
anim.start(self)
Clock.schedule_once(lambda dt: self.die(), self.duration)
def die(self):
anim = Animation(top=0, duration=.3, t='out_quad')
anim.bind(on_complete=lambda *args: _play_next(self))
anim.bind(on_complete=lambda *args: Window.remove_widget(self))
anim.start(self)
def dismiss(self):
Window.remove_widget(self)
def _update_quickfind_label(self, _, value):
qlabel = self._quickfind_label
if value:
if qlabel:
qlabel.text = value
else:
self._quickfind_label = CompatTextInput(
text=value, size_hint=(None, None), pos=self.pos,
font_size=self.quickfind_font_size,
size=(self.width, int(self.quickfind_font_size * 2.3)))
Window.add_widget(self._quickfind_label)
else:
if qlabel:
Window.remove_widget(qlabel)
self._quickfind_label = None
def dismiss(self):
self.children[0].children[0].on_ctx_dismiss()
self.dispatch('on_dismiss')
Window.remove_widget(self)
def dismiss(self):
self.children[0].children[0].on_ctx_dismiss()
Window.remove_widget(self)
def _in_out(self, dt):
self._duration -= dt * 1000
if self._duration <= 0:
self._transparency = 1.0 + (self._duration / self._rampdown)
if -(self._duration) > self._rampdown:
Window.remove_widget(self)
return False