mirror of https://github.com/kivy/kivy.git
fix passing default arguements
This commit is contained in:
parent
59008f4fba
commit
c459f74a1a
|
@ -23,8 +23,7 @@ class BubbleShowcase(FloatLayout):
|
|||
self.add_widget(self.but_bubble)
|
||||
|
||||
def show_bubble(self, *l):
|
||||
bubb = Bubble(size_hint = (.27, .0792), arrow_pos = 'bottom_mid')
|
||||
#bubb.content.rows = 1
|
||||
bubb = Bubble(size_hint = (.27, .0792), arrow_pos = 'bottom_right')
|
||||
bubb.content.cols = 3
|
||||
bubb.add_widget(Button(text = 'Cut',
|
||||
background_normal = 'data/images/bubble_btn.png',
|
||||
|
|
|
@ -76,7 +76,7 @@ class Bubble(GridLayout):
|
|||
self.padding = 2
|
||||
self.add_widget(self.content)
|
||||
self.bk_img.bind(on_texture = self._on_texture)
|
||||
self.arrow_pos = 'bottom_mid'
|
||||
self.on_arrow_pos()
|
||||
|
||||
def _on_texture(self, *l):
|
||||
self.background_texture = self.bk_img.texture
|
||||
|
@ -95,6 +95,9 @@ class Bubble(GridLayout):
|
|||
self.arrow_img.source = self.arrow_image
|
||||
|
||||
def on_arrow_pos(self, *l):
|
||||
if not self.content:
|
||||
return
|
||||
print self.content
|
||||
self.arrow_layout.clear_widgets()
|
||||
self.clear_widgets()
|
||||
self.arrow_img.size_hint = (1, None)
|
||||
|
|
Loading…
Reference in New Issue