added eugtk examples
This commit is contained in:
58
eugtk/examples/glade/calendar.ex
Normal file
58
eugtk/examples/glade/calendar.ex
Normal file
@@ -0,0 +1,58 @@
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
--# Display a nice calendar using EuGTK and Glade
|
||||
-----------------------------------------------------------------------
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
add(builder,"~/demos/glade/calendar.glade")
|
||||
|
||||
-- PATCH: Gtk 3.14 forgets to add a quit button to the about.dialog!
|
||||
if minor_version = 14 then
|
||||
set("aboutdialog1","add button","gtk-quit",0)
|
||||
end if
|
||||
|
||||
main()
|
||||
|
||||
---------------------------------------------------------------------
|
||||
global function on_calendar1_day_selected_double_click()
|
||||
---------------------------------------------------------------------
|
||||
return Info("window1",,"Calendar Clicked",
|
||||
get("calendar1","date"),,
|
||||
"~/demos/thumbnails/cal.png","x-office-calendar")
|
||||
end function
|
||||
|
||||
---------------------------------------------------------------------
|
||||
global function on_OK_button_clicked()
|
||||
---------------------------------------------------------------------
|
||||
return Info("window1",,"Button Clicked",
|
||||
sprintf("Date is %s",{get("calendar1","date")}),,
|
||||
"~/demos/thumbnails/cal.png","x-office-calendar")
|
||||
end function
|
||||
|
||||
---------------------------------------------------------------------
|
||||
global function on_About_button_clicked()
|
||||
---------------------------------------------------------------------
|
||||
set("aboutdialog1","run")
|
||||
set("aboutdialog1","hide")
|
||||
return 1
|
||||
end function
|
||||
|
||||
---------------------------------------------------------------------
|
||||
global function check_link()
|
||||
---------------------------------------------------------------------
|
||||
if networked() and inet_connected() then
|
||||
return 0 -- go ahead and try the link;
|
||||
else
|
||||
Warn(,,"Network Error","No connection to Web!",,"~/demos/thumbnails/net0.png")
|
||||
return 1 -- don't try to connect the link;
|
||||
end if
|
||||
end function
|
||||
|
||||
---------------------------------------------------------------------
|
||||
global function on_aboutdialog1_response()
|
||||
---------------------------------------------------------------------
|
||||
set("aboutdialog1","hide")
|
||||
return 1
|
||||
end function
|
||||
|
||||
Reference in New Issue
Block a user