added eugtk examples
This commit is contained in:
52
eugtk/examples/glade/pref.e
Normal file
52
eugtk/examples/glade/pref.e
Normal file
@@ -0,0 +1,52 @@
|
||||
|
||||
-----------------
|
||||
namespace pref -- used by main.ex
|
||||
-----------------
|
||||
|
||||
include GtkEngine.e
|
||||
|
||||
ifdef WINDOWS then
|
||||
add(builder,"pref.glade")
|
||||
elsedef
|
||||
add(builder,"~/demos/glade/pref.glade")
|
||||
end ifdef
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
export function show(atom ctl, atom data)
|
||||
-----------------------------------------------------------------------
|
||||
set("pref:window1","visible",TRUE) -- use the namespace:name in string form
|
||||
return 1
|
||||
end function
|
||||
|
||||
------------------------------------------------------------------------
|
||||
export function set_color(atom ctl, atom data)
|
||||
------------------------------------------------------------------------
|
||||
if get(ctl,"active") then -- handle 3 buttons, btn name contains color name to use
|
||||
set("pref:label1","color",get(ctl,"label"))
|
||||
end if
|
||||
return 1
|
||||
end function
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
export function value_changed(atom scale, atom data)
|
||||
-----------------------------------------------------------------------
|
||||
set("pref:window1","background",get(scale,"value")) -- use the handles, not names
|
||||
return 1
|
||||
end function
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
export function apply(atom ctl, atom data)
|
||||
-----------------------------------------------------------------------
|
||||
-- apply settings here...then
|
||||
set("pref:window1","visible",FALSE)
|
||||
return 1
|
||||
end function
|
||||
|
||||
-----------------------------------------------------------------------
|
||||
export function cancel(atom ctl, atom data)
|
||||
-----------------------------------------------------------------------
|
||||
-- abandon changes, just hide me;
|
||||
set("pref:window1","visible",FALSE)
|
||||
return 1
|
||||
end function
|
||||
|
||||
Reference in New Issue
Block a user