Fixed up some paths and added a test image.

This commit is contained in:
Joey Payne 2014-02-07 15:55:06 -07:00
commit 5c9b721567
3 changed files with 5 additions and 3 deletions

BIN
img/wrench.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB

View file

@ -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')

View file

@ -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))