wxEuphoria add items to list box
- Posted by buzzo Nov 17, 2014
- 1773 views
Having a difficult time adding items to a wxListBox. Latest ver of wxEuphoria.. under Win7.
Here is code to create the list box. It behaves as expected.
constant db_group = create(wxStaticBox, {Win,-1,"",dbGX,dbGY,dbGW,dbGH}), label_db_group = create(wxStaticText,{db_group,-1," Databases ", (140-56)*.5,1,56,14,0}), list2 = create(wxListBox,{db_group,-1,5,24,130,268})
This is the code to populate the list box.. see coments
procedure open_a_DB() --startfold integer result object dbName = {} result = db_open(pathTodbList) if result != DB_OK then message_box("Unable to open a Database .... none exist." & CR & "Close this message box, and select Create A New Family/Surname Database. ", "No Database(s) Exist", #0 ) else db_select_table("databases") x = db_table_size() for i = 1 to x do dbName = db_record_data(i) puts(1,to_string(dbName) & CrLf) -- prints correctly insert_item( list2, i, dbName ) -- nothing is placed in the list box --insert_listctrl_item( list2,i,dbName,0) -- nothing is placed in the list box --set_first_list_item(list2,dbName) -- nothing is placed in the list box --add_item( list2,{dbName}) -- error message indicates add_item does not exist end for refresh_window ( Win) -- nothing changes show_window(db_group,1) -- displays correctly end if end procedure --endfold
Help appreciated

