当前位置: 首页>>代码示例>>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;未经允许,请勿转载。