Exemplo n.º 1
0
import kaa, kaa.canvas
from test_common import *

kaa.main.select_notifier(notifier)

if output == "DirectFB":
    canvas = kaa.canvas.DirectFBCanvas(size)
elif output == "FB":
    canvas = kaa.canvas.FBCanvas(size)
else:  # X11
    canvas = kaa.canvas.X11Canvas(size)

box = canvas.add_child(kaa.canvas.HBox())
box.add_child(kaa.canvas.Rectangle(), width="30%", height="100%", color="#ff0000")
box.add_child(kaa.canvas.Rectangle(), width="70%", height="100%", color="#0000ff")

kaa.main.run()
Exemplo n.º 2
0
import kaa, kaa.canvas
from test_common import *

kaa.main.select_notifier(notifier)

if output == "DirectFB":
    canvas = kaa.canvas.DirectFBCanvas(size)
elif output == "FB":
    canvas = kaa.canvas.FBCanvas(size)
else: # X11
    canvas = kaa.canvas.X11Canvas(size)

canvas.add_child(kaa.canvas.Image("data/background.jpg"))

container = canvas.add_child(kaa.canvas.Container(), hcenter = "50%", vcenter = "50%")

frame = kaa.canvas.Image("data/frame.png")
frame.set_border(30, 30, 30, 30)
container.add_child(frame, width = "75%", height = "50%")

text = kaa.canvas.Text("Text inside a container.", font="data/Vera")
container.add_child(text, hcenter = "50%", vcenter = "50%")

kaa.main.run()
Exemplo n.º 3
0
import kaa, kaa.canvas
from test_common import *

kaa.main.select_notifier(notifier)

if output == "DirectFB":
    canvas = kaa.canvas.DirectFBCanvas(size)
elif output == "FB":
    canvas = kaa.canvas.FBCanvas(size)
else: # X11
    canvas = kaa.canvas.X11Canvas(size)

canvas.add_child(kaa.canvas.Image("data/background.jpg"))

c = canvas.add_container(width=100, height=100, hcenter="50%", top=30)
c.add_child(kaa.canvas.Rectangle(), width=200, height=200, color="#44ffff55")
c.add_child(kaa.canvas.Text("Text and rect will overflow", font="data/Vera"), clip = None)

c = canvas.add_container(width=100, height=100,  clip="auto", hcenter="50%", top=300)
c.add_child(kaa.canvas.Rectangle(), width=200, height=200, color="#ff44ff55")
c.add_child(kaa.canvas.Text("Text is clipped", font="data/Vera"))

kaa.main.run()
Exemplo n.º 4
0
Arquivo: hello.py Projeto: clones/kaa
import kaa
import kaa.canvas
from test_common import *

kaa.main.select_notifier(notifier)

if output == "DirectFB":
    canvas = kaa.canvas.DirectFBCanvas(size)
elif output == "FB":
    canvas = kaa.canvas.FBCanvas(size)
else: # X11
    canvas = kaa.canvas.X11Canvas(size)


background = kaa.canvas.Image("data/background.jpg")
canvas.add_child(background)

hello = kaa.canvas.Text("Hello world!", font="data/Vera")
hello.move(hcenter = "50%", vcenter = "50%")
canvas.add_child(hello)

kaa.main.run()