added eugtk examples
This commit is contained in:
32
eugtk/examples/glade/clock.ex
Normal file
32
eugtk/examples/glade/clock.ex
Normal file
@@ -0,0 +1,32 @@
|
||||
|
||||
--# Clock built with Glade
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
include std/datetime.e
|
||||
|
||||
gtk:add(builder,"~/demos/glade/clock.glade")
|
||||
|
||||
constant ticker = gtk:create(GTimeout,250,_("TickTock")) -- every 1/4 sec.
|
||||
|
||||
create(GtkCssProvider,"""#clock {
|
||||
font: Purisa, Comic Sans bold 30;
|
||||
color: red;
|
||||
text-shadow: 1px 1px 0px blue, -2px -2px yellow;
|
||||
}""")
|
||||
|
||||
main()
|
||||
|
||||
----------------------
|
||||
function TickTock() -- update time display
|
||||
----------------------
|
||||
gtk:set("display","markup",datetime:format(now(),"%a %l:%M:%S %P"))
|
||||
return 1 -- return 1 to keep clock ticking!
|
||||
end function
|
||||
|
||||
----------------------
|
||||
global function Bail()
|
||||
----------------------
|
||||
return Quit()
|
||||
end function
|
||||
|
||||
Reference in New Issue
Block a user