Пример #1
0
# HanishKVC, v20201124IST1127
#

import enum
# Import Clutter for use
import gi

gi.require_version('Clutter', '1.0')
from gi.repository import Clutter
import cluttergui as cg

# Initialise
Clutter.init()

# required things
colorizeEffect1 = Clutter.ColorizeEffect()
colorizeEffect1.set_tint(Clutter.color_from_pixel(0xE0E0F0FF))
print(colorizeEffect1.get_tint().to_string())


# Handle events
def handle_btn_press(actor, event):
    print("INFO:BtnPress:{},{}".format(actor, event))
    print("\t x,y [{},{}], btn [{}]".format(event.x, event.y, event.button))
    if actor == stage:
        print("INFO: Bowing down gracefully")
        Clutter.main_quit()
    elif actor in (imgBtn1, imgBtn2):
        print("INFO: Button is pressed:", actor.get_id())
    return Clutter.EVENT_STOP
Пример #2
0
def apply_colorize_effect(actor):
    actor.clear_effects()
    effect = Clutter.ColorizeEffect()
    effect.set_tint(Clutter.Color.new(0, 0, 255, 150))
    actor.add_effect(effect)