import libclutter_gtk as clutter

gtk = clutter

clutter.gtk_clutter_init(ctypes.pointer(ctypes.c_int(0)))
gtk.init()  # comes after clutter init


window = gtk.Window()
# window.connect('destroy', gtk.main_quit)
print(window)
window.set_title("ctypes clutter test")
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()
vbox.pack_start(embed, True, True, 0)
embed.set_size_request(300, 300)

# we need to realize the widget before we get the stage
embed.realize()
print("embed realized")
stage = clutter.gtk_clutter_embed_get_stage(embed)  # embed.get_stage()
clr = clutter.color_new(0, 0, 127, 100)
clutter.clutter_stage_set_color(stage, clr)

rect = clutter.rectangle_new()  # clutter.Rectangle()
clr = clutter.color_new(100, 1, 0, 100)
clutter.rectangle_set_color(rect, clr)  # rect.set_color( clr )
rect.set_size(100, 100)
rect.set_anchor_point(50, 50)
import os, sys, time, ctypes
if os.path.dirname(os.path.abspath(__file__)) not in sys.path:
    sys.path.append(os.path.dirname(os.path.abspath(__file__)))

import libclutter_gtk as clutter
gtk = clutter
clutter.gtk_clutter_init(ctypes.pointer(ctypes.c_int(0)))
gtk.init()  # comes after clutter init

window = gtk.Window()
window.set_title('ctypes clutter test')
#window.connect('destroy', gtk.main_quit)
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()  # gtk-widget type
embed.set_size_request(300, 300)

sw = gtk.ScrolledWindow()
sw.set_size_request(180, 420)
sw.add_with_viewport(embed)
sw.set_policy(True, False)
vbox.pack_start(sw, True, True, 0)

## its ok to create actors before the stage is realized ##
box = gtk.VBox()
ACTOR = clutter.gtk_clutter_actor_new_with_contents(box)
ACTOR.set_scale(0.75, 1.0)

# we need to realize the widget before we get the stage #
'''
		os.path.dirname(os.path.abspath(__file__))
	)

import libclutter_gtk as clutter
gtk = clutter
clutter.gtk_clutter_init( ctypes.pointer(ctypes.c_int(0)) )
gtk.init()	# comes after clutter init


window = gtk.Window()
window.set_title('ctypes clutter test')
#window.connect('destroy', gtk.main_quit)
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()	# gtk-widget type
embed.set_size_request(300, 300)

sw = gtk.ScrolledWindow()
sw.set_size_request( 180, 420 )
sw.add_with_viewport( embed )
sw.set_policy(True,False)
vbox.pack_start(sw, True, True, 0)

## its ok to create actors before the stage is realized ##
box = gtk.VBox()
ACTOR = clutter.gtk_clutter_actor_new_with_contents( box )
ACTOR.set_scale( 0.75, 1.0 )

# we need to realize the widget before we get the stage #
'''
import os, sys, time, ctypes
import libclutter_gtk as clutter
gtk = clutter

clutter.gtk_clutter_init(ctypes.pointer(ctypes.c_int(0)))
gtk.init()  # comes after clutter init

window = gtk.Window()
#window.connect('destroy', gtk.main_quit)
print(window)
window.set_title('ctypes clutter test')
vbox = gtk.VBox(False, 6)
window.add(vbox)

embed = clutter.gtk_clutter_embed_new()
vbox.pack_start(embed, True, True, 0)
embed.set_size_request(300, 300)

# we need to realize the widget before we get the stage
embed.realize()
print('embed realized')
stage = clutter.gtk_clutter_embed_get_stage(embed)  #embed.get_stage()
clr = clutter.color_new(0, 0, 127, 100)
clutter.clutter_stage_set_color(stage, clr)

rect = clutter.rectangle_new()  #clutter.Rectangle()
clr = clutter.color_new(100, 1, 0, 100)
clutter.rectangle_set_color(rect, clr)  #rect.set_color( clr )
rect.set_size(100, 100)
rect.set_anchor_point(50, 50)