Pastey EuGTK TreeView Issues
- Posted by euphoric
(admin)
Aug 22, 2019
------------------------------------------------------------------------
--# GtkTreeStore
------------------------------------------------------------------------
include GtkEngine.e
object store = create(GtkTreeStore,{gSTR})
sequence os = {
{
"Appliances",
{
"Loading..."
}
},
{
"Apps & Games",
{
"Loading..."
}
},
{
"Arts, Crafts & Sewing",
{
"Loading..."
}
},
{
"Audible Books & Originals",
{
"Loading..."
}
},
{
"Automotive",
{
"Loading..."
}
},
{
"Baby",
{
"Loading..."
}
},
{
"Beauty & Personal Care",
{
"Loading..."
}
},
{
"Books",
{
"Loading..."
}
},
{
"CDs & Vinyl",
{
"Loading..."
}
},
{
"Camera & Photo",
{
"Loading..."
}
},
{
"Cell Phones & Accessories",
{
"Loading..."
}
},
{
"Clothing, Shoes & Jewelry",
{
"Loading..."
}
},
{
"Collectible Currencies",
{
"Loading..."
}
},
{
"Computers & Accessories",
{
"Loading..."
}
},
{
"Digital Music",
{
"Loading..."
}
},
{
"Electronics",
{
"Loading..."
}
},
{
"Entertainment Collectibles",
{
"Loading..."
}
},
{
"Gift Cards",
{
"Loading..."
}
},
{
"Grocery & Gourmet Food",
{
"Loading..."
}
},
{
"Handmade Products",
{
"Loading..."
}
},
{
"Health & Household",
{
"Loading..."
}
},
{
"Home & Kitchen",
{
"Loading..."
}
},
{
"Industrial & Scientific",
{
"Loading..."
}
},
{
"Kindle Store",
{
"Loading..."
}
},
{
"Kitchen & Dining",
{
"Loading..."
}
},
{
"Magazine Subscriptions",
{
"Loading..."
}
},
{
"Movies & TV",
{
"Loading..."
}
},
{
"Musical Instruments",
{
"Loading..."
}
},
{
"Office Products",
{
"Loading..."
}
},
{
"Patio, Lawn & Garden",
{
"Loading..."
}
},
{
"Pet Supplies",
{
"Loading..."
}
},
{
"Prime Pantry",
{
"Loading..."
}
},
{
"Smart Home",
{
"Loading..."
}
},
{
"Software",
{
"Loading..."
}
},
{
"Sports & Outdoors",
{
"Loading..."
}
},
{
"Sports Collectibles",
{
"Loading..."
}
},
{
"Tools & Home Improvement",
{
{
"Air Tools",
{
"Loading..."
}
},
{
"Appliances",
{
"Loading..."
}
},
{
"Electrical",
{
"Loading..."
}
},
{
"Hardware",
{
"Loading..."
}
},
{
"Safety & Security",
{
"Loading..."
}
},
{
"Building Supplies",
{
"Loading..."
}
},
{
"Lighting & Ceiling Fans",
{
"Loading..."
}
},
{
"Storage & Home Organization",
{
"Loading..."
}
},
{
"Paint, Wall Treatments & Supplies",
{
"Loading..."
}
},
{
"Kitchen & Bath Fixtures",
{
"Loading..."
}
},
{
"Rough Plumbing",
{
"Loading..."
}
},
{
"Power & Hand Tools",
{
"Loading..."
}
},
{
"Measuring & Layout Tools",
{
"Loading..."
}
}
}
},
{
"Toys & Games",
{
"Loading..."
}
},
{
"Video Games",
{
"Loading..."
}
}
}
set(store,"data",os)
constant
col1 = create(GtkColumn,"title=OS,type=text,markup=1,sort_column_id=1,text=1")
constant tv = create(GtkTreeView,{
{"model",store},
{"append columns",{col1}},
{"enable tree lines",TRUE},
$})
constant selection = get(tv,"selection")
constant
win = create(GtkWindow,"size=250x400,border=10,$destroy=Quit"),
panel = create(GtkBox,"orientation=vertical,spacing=10"),
btn1 = create(GtkButton,"gtk-quit","Quit"),
box = create(GtkButtonBox)
add(win,panel)
pack(panel,tv,TRUE,TRUE,5)
add(box,{btn1})
pack(panel,-box)
show_all(win)
main()