from kivy.lang.builder import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.uix.relativelayout import RelativeLayout
from kivy.uix.behaviors import DragBehavior
Builder.load_string('''
<tmpWidget>:
size_hint: None, None
size: 250,50
drag_rectangle: self.x, self.y, self.width, self.height
drag_timeout: 10000000
drag_distance: 0
BoxLayout:
orientation: 'vertical'
size_hint: None, None
size: 250,50
spacing: 5
padding: 5
canvas.before:
Color:
rgb: 1,1,0
Rectangle:
size: self.size
pos: self.pos
BoxLayout:
orientation: 'horizontal'
Label:
text: ''
size_hint: None, None
width: 20
height: 40
Label:
text: 'SEARCH TAB'
color: 0,0,0,1
size_hint: 1, 1
Button:
text: 'X'
size_hint: None, 1
width: 40
on_press: root.search_exit()
''')
class tmpWidget(DragBehavior, RelativeLayout):
def search_exit(self):
App.get_running_app().prog.remove_widget(App.get_running_app().prog.tmp)