Python kivy.core.window.Window.remove_widget() Examples

The following are 18 code examples of kivy.core.window.Window.remove_widget(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module kivy.core.window.Window , or try the search function .
Example #1
Source File: __init__.py    From kivystudio with MIT License 6 votes vote down vote up
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') 
Example #2
Source File: infolabel.py    From kivystudio with MIT License 5 votes vote down vote up
def remove_info_on_mouse():
    if info_label in Window.children:
        Window.remove_widget(info_label) 
Example #3
Source File: connection.py    From Persimmon with MIT License 5 votes vote down vote up
def remove_info(self):
        Window.remove_widget(self.info)

    # Auxiliary methods 
Example #4
Source File: connection.py    From Persimmon with MIT License 5 votes vote down vote up
def delete_connection(self):
        """ This function deletes both ends (if they exist) and the connection
        itself. """
        self.parent.remove_widget(self)  # Self-destruct
        self.remove_info()
        if self.start:
            self._unbind_pin(self.start)
            self.start.on_connection_delete(self)
        if self.end:
            self._unbind_pin(self.end)
            self.end.on_connection_delete(self) 
Example #5
Source File: snackbar.py    From Blogs-Posts-Tutorials with MIT License 5 votes vote down vote up
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) 
Example #6
Source File: snackbar.py    From Blogs-Posts-Tutorials with MIT License 5 votes vote down vote up
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) 
Example #7
Source File: menu.py    From Blogs-Posts-Tutorials with MIT License 5 votes vote down vote up
def dismiss(self):
        Window.remove_widget(self) 
Example #8
Source File: various.py    From kivy-material-ui with MIT License 5 votes vote down vote up
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 ] 
Example #9
Source File: kivytoast.py    From RaceCapture_App with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #10
Source File: __init__.py    From RaceCapture_App with GNU General Public License v3.0 5 votes vote down vote up
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 
Example #11
Source File: menu.py    From KivyMD with MIT License 5 votes vote down vote up
def dismiss(self):
		Window.remove_widget(self) 
Example #12
Source File: infolabel.py    From kivystudio with MIT License 5 votes vote down vote up
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) 
Example #13
Source File: __init__.py    From kivystudio with MIT License 5 votes vote down vote up
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) 
Example #14
Source File: __init__.py    From kivystudio with MIT License 5 votes vote down vote up
def handle_escape(self):
        if self.new_bub in Window.children:
            Window.remove_widget(self.new_bub)
        else:
            self.dismiss() 
Example #15
Source File: __init__.py    From kivystudio with MIT License 5 votes vote down vote up
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) 
Example #16
Source File: __init__.py    From kivystudio with MIT License 5 votes vote down vote up
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) 
Example #17
Source File: snackbar.py    From KivyMD with MIT License 5 votes vote down vote up
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) 
Example #18
Source File: snackbar.py    From KivyMD with MIT License 5 votes vote down vote up
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)