Skip to content

Instantly share code, notes, and snippets.

@PARC6502
Created August 7, 2014 17:45
Show Gist options
  • Save PARC6502/7e47667cdea5cbd0e6a4 to your computer and use it in GitHub Desktop.
Save PARC6502/7e47667cdea5cbd0e6a4 to your computer and use it in GitHub Desktop.
Issue with DropDown
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.gridlayout import GridLayout
from kivy.factory import Factory
Builder.load_string("""
<MainView>:
cols: 1
size_hint_y: None
height: self.minimum_height
pos_hint: {'top': 1}
Button:
id: butt
text: "Hello"
size_hint_y: None
height: "40dp"
on_release: root.open_drop()
<CustomDrop@DropDown>:
Button:
text: 'butt 1'
size_hint_y: None
height: '40dp'
Button:
text: 'butt 2'
size_hint_y: None
height: '40dp'
""")
class MainView(GridLayout):
def open_drop(self):
drop_down = Factory.CustomDrop()
drop_down.open(self.ids.butt)
class TestApp(App):
def build(self):
return MainView()
if __name__ == '__main__':
TestApp().run()
[INFO ] Logger: Record log in C:\Users\Serafy\.kivy\logs\kivy_14-08-07_29.txt
[INFO ] Kivy v1.8.1-dev
[INFO ] Python: v2.7.6 |Anaconda 1.9.1 (64-bit)| (default, Nov 11 2013, 10:49:15) [MSC v.1500 64 bit (AMD64)]
[INFO ] Factory: 169 symbols loaded
[DEBUG ] Cache: register <kv.lang> with limit=None, timeout=Nones
[DEBUG ] Cache: register <kv.image> with limit=None, timeout=60s
[DEBUG ] Cache: register <kv.atlas> with limit=None, timeout=Nones
[INFO ] Image: Providers: img_tex, img_dds, img_pygame, img_pil, img_gif
[DEBUG ] Cache: register <kv.texture> with limit=1000, timeout=60s
[DEBUG ] Cache: register <kv.shader> with limit=1000, timeout=3600s
[DEBUG ] App: Loading kv <.\test.kv>
[DEBUG ] App: kv <.\test.kv> not found
[DEBUG ] Window: Ignored <egl_rpi> (import error)
[INFO ] Window: Provider: pygame(['window_egl_rpi'] ignored)
[DEBUG ] Window: Display driver windib
[DEBUG ] Window: Actual window size: %dx%d
[DEBUG ] Window: Actual color bits r%d g%d b%d a%d
[DEBUG ] Window: Actual depth bits: %d
[DEBUG ] Window: Actual stencil bits: %d
[DEBUG ] Window: Actual multisampling samples: %d
[INFO ] GL: OpenGL version <4.4.0>
[INFO ] GL: OpenGL vendor <NVIDIA Corporation>
[INFO ] GL: OpenGL renderer <GeForce GTX 460 SE/PCIe/SSE2>
[INFO ] GL: OpenGL parsed version: 4, 4
[INFO ] GL: Shading version <4.40 NVIDIA via Cg compiler>
[INFO ] GL: Texture max size <16384>
[INFO ] GL: Texture max units <32>
[DEBUG ] Shader: Fragment compiled successfully
[DEBUG ] Shader: Vertex compiled successfully
[DEBUG ] ImagePygame: Load <C:\Users\Serafy\Anaconda\lib\site-packages\kivy\data\glsl\default.png>
[INFO ] Window: virtual keyboard not allowed, single mode, not docked
[INFO ] Text: Provider: pygame
[INFO ] OSC: using <thread> for socket
[DEBUG ] Base: Create provider from mouse
[DEBUG ] Base: Create provider from wm_touch
[DEBUG ] Base: Create provider from wm_pen
[INFO ] Base: Start application main loop
[INFO ] GL: NPOT texture support is available
[DEBUG ] Atlas: Load <C:\Users\Serafy\Anaconda\lib\site-packages\kivy\data\..\data\images\defaulttheme.atlas>
[DEBUG ] Atlas: Need to load 1 images
[DEBUG ] Atlas: Load <C:\Users\Serafy\Anaconda\lib\site-packages\kivy\data\..\data\images\defaulttheme-0.png>
[DEBUG ] ImagePygame: Load <C:\Users\Serafy\Anaconda\lib\site-packages\kivy\data\..\data\images\defaulttheme-0.png>
[INFO ] Base: Leaving application in progress...
[WARNING ] stderr: Traceback (most recent call last):
[WARNING ] stderr: File "drop_test.py", line 40, in <module>
[WARNING ] stderr: TestApp().run()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\app.py", line 821, in run
[WARNING ] stderr: runTouchApp()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\base.py", line 484, in runTouchApp
[WARNING ] stderr: EventLoop.window.mainloop()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\core\window\window_pygame.py", line 363, in mainloop
[WARNING ] stderr: self._mainloop()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\core\window\window_pygame.py", line 267, in _mainloop
[WARNING ] stderr: EventLoop.idle()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\base.py", line 327, in idle
[WARNING ] stderr: self.dispatch_input()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\base.py", line 312, in dispatch_input
[WARNING ] stderr: post_dispatch_input(*pop(0))
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\base.py", line 278, in post_dispatch_input
[WARNING ] stderr: wid.dispatch('on_touch_up', me)
[WARNING ] stderr: File "_event.pyx", line 388, in kivy._event.EventDispatcher.dispatch (c:\users\serafy\appdata\local\temp\pip_build_Serafy\Kivy\kivy\_event.c:4491)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\behaviors.py", line 119, in on_touch_up
[WARNING ] stderr: self.dispatch('on_release')
[WARNING ] stderr: File "_event.pyx", line 384, in kivy._event.EventDispatcher.dispatch (c:\users\serafy\appdata\local\temp\pip_build_Serafy\Kivy\kivy\_event.c:4442)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\lang.py", line 1423, in custom_callback
[WARNING ] stderr: exec(__kvlang__.co_value, idmap)
[WARNING ] stderr: File "<string>", line 12, in <module>
[WARNING ] stderr: File "drop_test.py", line 32, in open_drop
[WARNING ] stderr: drop_down = Factory.CustomDrop()
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\dropdown.py", line 182, in __init__
[WARNING ] stderr: super(DropDown, self).__init__(**kwargs)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\scrollview.py", line 423, in __init__
[WARNING ] stderr: super(ScrollView, self).__init__(**kwargs)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\widget.py", line 301, in __init__
[WARNING ] stderr: Builder.apply(self)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\lang.py", line 1693, in apply
[WARNING ] stderr: self._apply_rule(widget, rule, rule)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\lang.py", line 1799, in _apply_rule
[WARNING ] stderr: widget.add_widget(child)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\dropdown.py", line 254, in add_widget
[WARNING ] stderr: return super(DropDown, self).add_widget(*largs)
[WARNING ] stderr: File "C:\Users\Serafy\Anaconda\lib\site-packages\kivy\uix\scrollview.py", line 814, in add_widget
[WARNING ] stderr: raise Exception('ScrollView accept only one widget')
[WARNING ] stderr: Exception: ScrollView accept only one widget
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment