fix passing default arguements

This commit is contained in:
Qua-non 2012-01-02 18:54:48 +05:30
parent 59008f4fba
commit c459f74a1a
2 changed files with 11 additions and 9 deletions

View File

@ -23,8 +23,7 @@ class BubbleShowcase(FloatLayout):
self.add_widget(self.but_bubble) self.add_widget(self.but_bubble)
def show_bubble(self, *l): def show_bubble(self, *l):
bubb = Bubble(size_hint = (.27, .0792), arrow_pos = 'bottom_mid') bubb = Bubble(size_hint = (.27, .0792), arrow_pos = 'bottom_right')
#bubb.content.rows = 1
bubb.content.cols = 3 bubb.content.cols = 3
bubb.add_widget(Button(text = 'Cut', bubb.add_widget(Button(text = 'Cut',
background_normal = 'data/images/bubble_btn.png', background_normal = 'data/images/bubble_btn.png',

View File

@ -76,7 +76,7 @@ class Bubble(GridLayout):
self.padding = 2 self.padding = 2
self.add_widget(self.content) self.add_widget(self.content)
self.bk_img.bind(on_texture = self._on_texture) self.bk_img.bind(on_texture = self._on_texture)
self.arrow_pos = 'bottom_mid' self.on_arrow_pos()
def _on_texture(self, *l): def _on_texture(self, *l):
self.background_texture = self.bk_img.texture self.background_texture = self.bk_img.texture
@ -95,6 +95,9 @@ class Bubble(GridLayout):
self.arrow_img.source = self.arrow_image self.arrow_img.source = self.arrow_image
def on_arrow_pos(self, *l): def on_arrow_pos(self, *l):
if not self.content:
return
print self.content
self.arrow_layout.clear_widgets() self.arrow_layout.clear_widgets()
self.clear_widgets() self.clear_widgets()
self.arrow_img.size_hint = (1, None) self.arrow_img.size_hint = (1, None)