
----------------------------------------------------------------------------------
--# GtkRevealer
----------------------------------------------------------------------------------

include GtkEngine.e

requires("3.10","GtkRevealer")

constant txt = `<span font='bold 16'>GtkRevealer</span>

The GtkRevealer widget is a container which animates the transition of its child from invisible to visible.

The style of transition can be controlled with gtk_revealer_set_transition_type().

These animations respect the "gtk-enable-animations" setting. 

<i>Click the Euphoria toggle button.</i>
`
constant win = create(GtkWindow,{
    {"border width",10},
    {"default size",500,-1},
    {"position",GTK_WIN_POS_CENTER},
    {"connect","destroy","Quit"}})
    
constant panel = create(GtkBox,VERTICAL,10)
    add(win,panel)

constant revealer = create(GtkRevealer,{
    {"transition type",GTK_REVEALER_TRANSITION_TYPE_CROSSFADE},
    {"transition duration",2000}})

constant img = create(GtkImage,"thumbnails/euphoria.gif")
    add(revealer,img)
    add(panel,revealer)

constant lbl = create(GtkLabel,{
    {"markup",txt},
    {"padding",10,0},
    {"line wrap",TRUE}})
    add(panel,lbl)

constant 
    btn1 = create(GtkButton,"gtk-quit","Quit"),
    btn2 = create(GtkToggleButton,"thumbnails/euphoria-linux.svg# _Euphoria",_("ToggleEu")),
    box2 = create(GtkButtonBox)
    pack(box2,{btn1,btn2})
    pack(panel,-box2)

show_all(win)
main()

----------------------------------
function ToggleEu(atom ctl)
----------------------------------
    set(revealer,"reveal child",get(ctl,"active"))
return 1
end function
