How can I execute this code by clicking on the jl file on windows?
using Gtk
ls = GtkListStore(String, Int, Bool)
push!(ls,("Peter",20,false))
push!(ls,("Paul",30,false))
push!(ls,("Mary",25,true))
insert!(ls, 2, ("Susanne",35,true))
tv = GtkTreeView(GtkTreeModel(ls))
rTxt = GtkCellRendererText()
rTog = GtkCellRendererToggle()
c1 = GtkTreeViewColumn("Name", rTxt, Dict([("text",0)]))
c2 = GtkTreeViewColumn("Age", rTxt, Dict([("text",1)]))
c3 = GtkTreeViewColumn("Female", rTog, Dict([("active",2)]))
push!(tv, c1, c2, c3)
for (i,c) in enumerate([c1,c2,c3])
GAccessor.sort_column_id(c,i-1)
end
selection = GAccessor.selection(tv)
# selection = GAccessor.mode(selection,Gtk.GConstants.GtkSelectionMode.MULTIPLE)
signal_connect(selection, "changed") do widget
if hasselection(selection)
currentIt = selected(selection)
# now you can to something with the selected item
if ls[currentIt,3]
ls[currentIt,3] = false
else
ls[currentIt,3] = true
end
end
end
win = GtkWindow(tv, "List View")
showall(win)