/* * Listbox * ------- * An example which shows how to create and use a listbox. */ #include window w; char *words[] = { "Apples", "Oranges", "Lemons", "Mandarin", "Banana", "Nashi", "Pear", "Apricot", "Watermelon", "Rockmelon", "Kiwi Fruit", "Mango", "Pineapple", NULL }; void quit(button b) { exitapp(); } void hit_list(listbox l, int where) { printf("Listbox hit: %d\n", where); } int main(int argc, char **argv) { window w; w = newwindow("Hi", rect(0,0,300,300), StandardWindow); newbutton("Exit", rect(10,10,80,30), quit); newlistbox(words, rect(10,110,260,150), hit_list); show(w); mainloop(); return 0; }