File: transparency.py

package info (click to toggle)
ocempgui 0.2.8-1.1
  • links: PTS
  • area: main
  • in suites: squeeze
  • size: 4,464 kB
  • ctags: 1,849
  • sloc: python: 9,304; ansic: 6,849; makefile: 179
file content (42 lines) | stat: -rw-r--r-- 1,082 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# Transparency examples.
from ocempgui.widgets import *
from ocempgui.widgets.Constants import *

def _destroy_dialog (window):
    window.child.text = "#Close"
    
def create_transparent_view ():

    box = Box (180, 80)
    box.border = BORDER_FLAT
    box.topleft = 10, 10

    label = ImageLabel ("image.png")
    label.topleft = 10, 10
    
    button = Button ("A transparent Button")
    button.opacity = 160
    button.topleft = 30, 30

    box.children = label, button
    
    # Create and display a simple window.
    window = Window ("Simple window")
    window.opacity = 100
    window.child = Button ("#Button")
    window.child.connect_signal (SIG_CLICKED, window.destroy)
    window.topleft = 180, 30
    window.depth = 1

    return box, window

if __name__ == "__main__":
    # Initialize the drawing window.
    re = Renderer ()
    re.create_screen (400, 200)
    re.title = "Transparency examples"
    re.color = (234, 228, 223)
    re.show_layer_info = True
    re.add_widget (*create_transparent_view ())
    # Start the main rendering loop.
    re.start ()