Пример #1
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import mygtk
import thread

def load_text_effect_thread(*args):
	texteffect.run()
	main.widget_move(texteffect, 50, 50, 1000)
	texteffect.wait()
	mygtk.log.msg("over")

def load_text_effect(*args):
	if texteffect.get_running():
		texteffect.show_all()
	else:
		thread.start_new_thread(load_text_effect_thread, ())

if __name__ == "__main__":
	mygtk.init(400, 300)
	mygtk.share.set_global_font_path("./mplus/mplus-1m-regular.ttf")
	#mygtk.share.SetFullScreenMode(True)
	main = mygtk.window.Window("show text effect when click")
	main.set_bg("#111")
	main.layer_add("test")
	texteffect = mygtk.texteffect.TextEffect(50, 1, 150, 200)
	texteffect.load_text("show text effect when click", color="#FFF")
	main.widget_put("test", texteffect, 100, 100)
	main.bind_event("mouse_click", load_text_effect)
	mygtk.run()
Пример #2
0
    movieplayer.wait()
    mygtk.msg("play end")


def start_thread(event, target, args=()):
    thread.start_new_thread(target, args)


def exit(*args):
    player.stop()
    movieplayer.stop()
    mygtk.exit()


if __name__ == "__main__":
    mygtk.init(1024, 768, "password")
    mygtk.share.set_global_font_path("./mplus/mplus-1m-regular.ttf")
    mygtk.share.set_global_font_size(20)

    player = mygtk.Player()
    # player.set_volume(0.5)

    movieplayer = mygtk.MoviePlayer(800, 600, "#111")
    # movieplayer.set_volume(0.5)

    main = mygtk.Window("sample image")
    # main.SetBG("#111")
    main.layer_add("button")
    main.layer_add("player")

    main.widget_put("player", movieplayer, 10, 10)
Пример #3
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import mygtk
import os

if __name__ == "__main__":
	mygtk.init()
	key = mygtk.archive.Key("password")
	mygtk.archive.pack("sample.bin", "test.zip", key)
	print mygtk.archive.read("test.zip>inc.txt", key)
	#mygtk.lock.remove_file("test.zip")
Пример #4
0
#!/usr/bin/env python
# -*- coding:utf-8 -*-
import mygtk

if __name__ == "__main__":
	mygtk.init(400, 300, "password")
	main = mygtk.Window("sample image")
	main.set_bg("#111")
	main.layer_add("test")
	main.widget_put("test", mygtk.Image("./sample.bin>normal.png"), 100, 100)
	mygtk.run()
Пример #5
0
		movieplayer.stop()
		return
	movieplayer.play("./test.mpg")
	movieplayer.wait()
	mygtk.msg("play end")

def start_thread(event, target, args=()):
	thread.start_new_thread(target, args)

def exit(*args):
	player.stop()
	movieplayer.stop()
	mygtk.exit()

if __name__ == "__main__":
	mygtk.init(1024, 768, "password")
	mygtk.share.set_global_font_path("./mplus/mplus-1m-regular.ttf")
	mygtk.share.set_global_font_size(20)
	
	player = mygtk.Player()
	#player.set_volume(0.5)
	
	movieplayer = mygtk.MoviePlayer(800, 600, "#111")
	#movieplayer.set_volume(0.5)
	
	main = mygtk.Window("sample image")
	#main.SetBG("#111")
	main.layer_add("button")
	main.layer_add("player")
	
	main.widget_put("player", movieplayer, 10, 10)