33 lines
676 B
Elixir
33 lines
676 B
Elixir
|
|
--# 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
|
|
|