Ajout du GUI

This commit is contained in:
thatscringebro
2022-08-08 16:31:52 -04:00
parent db362ccdca
commit abd15f28b6
851 changed files with 99957 additions and 1 deletions

View File

@@ -0,0 +1,30 @@
'''
uix.relativelayout tests
========================
'''
import unittest
from kivy.base import EventLoop
from kivy.tests import UTMotionEvent
from kivy.uix.relativelayout import RelativeLayout
class UixRelativeLayoutTest(unittest.TestCase):
def test_relativelayout_on_touch_move(self):
EventLoop.ensure_window()
rl = RelativeLayout()
EventLoop.window.add_widget(rl)
touch = UTMotionEvent("unittest", 1, {"x": .5, "y": .5})
EventLoop.post_dispatch_input("begin", touch)
touch.move({"x": .6, "y": .4})
EventLoop.post_dispatch_input("update", touch)
EventLoop.post_dispatch_input("end", touch)
def test_relativelayout_coordinates(self):
EventLoop.ensure_window()
rl = RelativeLayout(pos=(100, 100))
EventLoop.window.add_widget(rl) # do_layout() called
self.assertEqual(rl.to_parent(50, 50), (150, 150))
self.assertEqual(rl.to_local(50, 50), (-50, -50))