
----------------------------------------------------------------------------------------
--# GtkButtonBox - child_secondary property
----------------------------------------------------------------------------------------

include GtkEngine.e

constant docs = `<u><b>ButtonBox</b></u>

By combining 'layout' and 'child secondary' 
commands, you can separate the Help button from
the others.

`
constant win = create(GtkWindow,"border=10,size=400x100,position=1,$destroy=Quit")

constant panel = create(GtkBox,VERTICAL)
    add(win,panel)

constant lbl = create(GtkLabel)
    set(lbl,"markup",docs)
    add(panel,lbl)

constant 
    btn1 = create(GtkButton,"gtk-quit","Quit"),
    btn2 = create(GtkButton,"gtk-ok"),
    btn3 = create(GtkButton,"gtk-help","Help")
    
    set(btn1,"tooltip text","Click to exit")
    set(btn2,"tooltip text=This button does nothing!,sensitive=FALSE")
    set(btn3,"tooltip text","Click to show layout code")

constant box = create(GtkButtonBox,HORIZONTAL)
    add(box,{btn1,btn2,btn3})
    set(box,"layout",GTK_BUTTONBOX_START)
    set(box,"child secondary",btn3,TRUE)
    pack(panel,-box)

show_all(win)
main()

--------------------------------------------------
global function Help()
--------------------------------------------------
return Info(win,"Help","Code:",
    `constant box = create(GtkButtonBox,HORIZONTAL)
  set(box,"layout",GTK_BUTTONBOX_START)
  set(box,"child secondary",btn3,TRUE)`)
end function
