diff --git a/img/wrench.png b/img/wrench.png new file mode 100644 index 0000000..62348ec Binary files /dev/null and b/img/wrench.png differ diff --git a/jgui/settings.py b/jgui/settings.py index 7cf7729..8de094b 100644 --- a/jgui/settings.py +++ b/jgui/settings.py @@ -3,3 +3,4 @@ import os DEBUG = True PROJECT_ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__))) SCREENSHOT_DIR = os.path.join(PROJECT_ROOT, 'screenshots') +IMG_DIR = os.path.join(PROJECT_ROOT, 'img') diff --git a/testclasses.py b/testclasses.py index 164880c..ae3acfc 100644 --- a/testclasses.py +++ b/testclasses.py @@ -1,5 +1,6 @@ from jgui.surface import Surface, Window, Position, Size, Color, TextWindow, ImageWindow -import math +import math, os +from jgui.settings import IMG_DIR class TestSurface(Surface): def __init__(self, *args, **kwargs): @@ -17,7 +18,7 @@ class TestSurface(Surface): background_color=(1,1,1), clip_children=True, ignore_debug=True, - background_image='/home/joey/Pictures/wrench.png', + background_image=os.path.join(IMG_DIR, 'wrench.png'), background_image_filter='bilinear') my_win.add_child(TextWindow('text','Micro Bean is the best bean ever.', @@ -30,7 +31,7 @@ class TestSurface(Surface): self.root_window.add_child(TestWindow('child2', position=[200,200], size=[200,200], draggable=True)) - self.root_window.add_child(ImageWindow('image', image_path='/home/joey/Pictures/wrench.png', + self.root_window.add_child(ImageWindow('image', image_path=os.path.join(IMG_DIR, 'wrench.png'), position=[0,200], size=[200,200], draggable=True, resizable=True))