Widget Test Example
This example creates a window with various widgets and a change handler.
using Tk
w = Toplevel("Test window", false)Tk widget of type Tk.Tk_Toplevelpack in tk frame for themed widgets
f = Frame(w)
configure(f, Dict(:padding => [3,3,2,2], :relief=>"groove"))
pack(f, expand=true, fill="both")""widgets
b = Button(f, "one")
cb = Checkbutton(f, "checkbutton")
rg = Radio(f, ["one", "two", "three"])
sc = Slider(f, 1:10)
sl = Spinbox(f, 1:10)
e = Entry(f, "starting text")
widgets = (b, cb, rg, sc, sl, e)(Tk widget of type Tk.Tk_Button, Tk widget of type Tk.Tk_Checkbutton, Tk widget of type Tk.Tk_Radio, Tk widget of type Tk.Tk_Scale, Tk widget of type Tk.Tk_Spinbox, Tk widget of type Tk.Tk_Entry)packing
map(u -> formlayout(u, "label"), widgets)("", "", "", "", "", "")bind a callback to each widget
change_handler(path, xs...) = println(map(get_value, widgets))
map(u -> callback_add(u, change_handler), widgets)
set_visible(w, true)""This page was generated using Literate.jl.