當前位置: 首頁>>代碼示例>>Python>>正文


Python Window.remove_widget方法代碼示例

本文整理匯總了Python中kivy.core.window.Window.remove_widget方法的典型用法代碼示例。如果您正苦於以下問題:Python Window.remove_widget方法的具體用法?Python Window.remove_widget怎麽用?Python Window.remove_widget使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在kivy.core.window.Window的用法示例。


在下文中一共展示了Window.remove_widget方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: create_new_folder

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def create_new_folder(self, textinput):
        path = os.path.join(self._file_chooser.path, textinput.text)
        if not os.path.exists(path):
            print('making folder ', path)
            try:
                os.mkdir(path)

                # a simple trick to force the file chooser to recompute the files
                former_path = self._file_chooser.path
                self._file_chooser.path = 'eeraef7h98fwb38rh3f8h23yr8i'  # change to an invaid path
                self._file_chooser.path = former_path       # then change back
                Window.remove_widget(self.new_bub)

            except OSError:
                print('error making dir')
        else:
            print('already exists') 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:19,代碼來源:__init__.py

示例2: dismiss

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def dismiss(self):
		Window.remove_widget(self) 
開發者ID:kivymd,項目名稱:KivyMD,代碼行數:4,代碼來源:menu.py

示例3: begin

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
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) 
開發者ID:kivymd,項目名稱:KivyMD,代碼行數:13,代碼來源:snackbar.py

示例4: die

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
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) 
開發者ID:kivymd,項目名稱:KivyMD,代碼行數:7,代碼來源:snackbar.py

示例5: on_dismiss

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def on_dismiss(self):
        Window.unbind(on_key_down=self.handle_key)
        # remove bubble if open
        if self.new_bub in Window.children:
            Window.remove_widget(self.new_bub) 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:7,代碼來源:__init__.py

示例6: on_mode

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def on_mode(self, *args):
        if hasattr(self, 'save_widget') and \
                self.save_widget in self.ids.saving_container.children:
               self.ids.saving_container.remove_widget(self.save_widget)
        if hasattr(self, 'folder_btn') and \
            self.folder_btn in self.ids.saving_container.children:
            self.ids.saving_container.remove_widget(self.folder_btn)

        if self.mode == 'save_file':
            self.ids.title.text = 'Save file'
            if not hasattr(self, 'save_widget'):
                self.save_widget = Factory.SaveWidget_()
                self.save_widget.ids.input.bind(on_text_validate=self.handle_saving)
                func = lambda *args: self.handle_saving(self.save_widget.ids.input)
                self.save_widget.ids.save_btn.bind(on_release=func)
            self.ids.saving_container.add_widget(self.save_widget)

        else:
            if self.mode == 'open_file':
                self.ids.title.text = 'Open file'

            elif self.mode == 'choose_dir':
                self.ids.title.text = 'Open folder'

                if not hasattr(self, 'folder_btn'):
                    self.folder_btn = Factory.DirButton_(text='Select')
                    self.folder_btn.bind(on_release=self.folder_selected)
                self.ids.saving_container.add_widget(self.folder_btn) 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:30,代碼來源:__init__.py

示例7: handle_escape

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def handle_escape(self):
        if self.new_bub in Window.children:
            Window.remove_widget(self.new_bub)
        else:
            self.dismiss() 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:7,代碼來源:__init__.py

示例8: handle_bubble

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def handle_bubble(self, btn):
        if self.new_bub in Window.children:
            Window.remove_widget(self.new_bub)
        else:
            self.new_bub.pos = (btn.x - (self.new_bub.width-btn.width), btn.y - self.new_bub.height)
            Window.add_widget(self.new_bub) 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:8,代碼來源:__init__.py

示例9: show_info_on_mouse

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def show_info_on_mouse(message=''):
    ''' func that displays an info 
        on mouse cursor'''
    if message:
        if info_label in Window.children:
            Window.remove_widget(info_label)

        info_label.text = ''
        info_label.text = message
        set_auto_mouse_position(info_label)
        Window.add_widget(info_label) 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:13,代碼來源:infolabel.py

示例10: remove_info_on_mouse

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def remove_info_on_mouse():
    if info_label in Window.children:
        Window.remove_widget(info_label) 
開發者ID:mahart-studio,項目名稱:kivystudio,代碼行數:5,代碼來源:infolabel.py

示例11: decrement_refcount

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def decrement_refcount():
		ProgressSpinner.busy_refcount -= 1 if ProgressSpinner.busy_refcount > 0 else 0
		if ProgressSpinner.busy_refcount == 0 and ProgressSpinner.instance:
			Window.remove_widget(ProgressSpinner.instance)
			ProgressSpinner.instance = None 
開發者ID:autosportlabs,項目名稱:RaceCapture_App,代碼行數:7,代碼來源:__init__.py

示例12: _in_out

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
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 
開發者ID:autosportlabs,項目名稱:RaceCapture_App,代碼行數:9,代碼來源:kivytoast.py

示例13: animate

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def animate( self, dt ) :
        self._duration -= dt * 1000
        if self._duration <= 0:
            self.alpha = 1.0 + (self._duration / self._timeout_down)
        if -(self._duration) > self._timeout_down:
            Window.remove_widget(self)
            return False
        self.fill_color = [ .1961, .1961, .1961, self.alpha ] 
開發者ID:curzel-it,項目名稱:kivy-material-ui,代碼行數:10,代碼來源:various.py

示例14: dismiss

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
def dismiss(self):
        Window.remove_widget(self) 
開發者ID:kiok46,項目名稱:Blogs-Posts-Tutorials,代碼行數:4,代碼來源:menu.py

示例15: begin

# 需要導入模塊: from kivy.core.window import Window [as 別名]
# 或者: from kivy.core.window.Window import remove_widget [as 別名]
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) 
開發者ID:kiok46,項目名稱:Blogs-Posts-Tutorials,代碼行數:13,代碼來源:snackbar.py


注:本文中的kivy.core.window.Window.remove_widget方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。