1. wxEuphoria: get_string_selection() Not Working
- Posted by euphoric (admin) Apr 01, 2015
- 1753 views
In my own code, get_string_selection() is not working. I did a search and found this example using get_string_selection(). The program runs fine, but the selection doesn't work as expected.
-- example6-a.exw -- This opens a window with a list in it. without warning include wxeu/wxeud.e constant WINFRAME = create( wxFrame,{ 0,-1, "List", -1, -1,300,220} ) ,WINPANEL = create( wxPanel,{WINFRAME } ) ,LIST1 = create(wxListBox,{WINPANEL,-1, 10,010,300,140} ) ,BUTTON1 = create( wxButton,{WINPANEL,-1,"Info...", 10,150,060,032} ) ----------------------------------------------------------------------------------------------- procedure Click_BUTTON1(atom this, atom event_type, atom id, atom event) sequence index index = get_selection( LIST1 )+1 -- get index if length(index)=0 then return end if event_type = message_box( sprintf( "List Count = %d \n", {list_count( LIST1 ) } ) &sprintf( "Selected Item Index = %d \n", { index[1] } ) &sprintf( "Selected Item Text = %s ",{get_string_selection( LIST1 )} ),"List Information", 0 ) end procedure ----------------------------------------------------------------------------------------------- set_event_handler(BUTTON1, get_id(BUTTON1), wxEVT_COMMAND_BUTTON_CLICKED, routine_id( "Click_BUTTON1" )) ----------------------------------------------------------------------------------------------- procedure Drop_LIST1() sequence files files={"aaa a aaa","bbb bb bbbb","ccc c cccccccccc","ddd dd ddddd dddd","eeee ee eeeeee"} for i = 1 to length(files) do add_item( LIST1, files[i] ) end for end procedure ----------------------------------------------------------------------------------------------- Drop_LIST1() wxMain( WINFRAME )
2. Re: wxEuphoria: get_string_selection() Not Working
- Posted by ghaberek (admin) Apr 01, 2015
- 1759 views
That example works fine for me. ¯\_(ツ)_/¯
List Count = 5 Selected Item Index = 3 Selected Item Text = ccc c cccccccccc
Can you post (a sample of) your code?
-Greg
3. Re: wxEuphoria: get_string_selection() Not Working
- Posted by euphoric (admin) Apr 01, 2015
- 1724 views
That example works fine for me. ¯\_(ツ)_/¯
List Count = 5 Selected Item Index = 3 Selected Item Text = ccc c cccccccccc
Can you post (a sample of) your code?
-Greg
What the hey? Using the example I posted, I get a list count of -1, selected item index is normal, and selected item text is 0 or somesuch.
Maybe my dlls need updating.
4. Re: wxEuphoria: get_string_selection() Not Working
- Posted by ghaberek (admin) Apr 01, 2015
- 1795 views
Maybe my dlls need updating.
wxEuphoria-0.17.0-win32-alpha3.exe (3.61 MB)
wxEuphoria-0.17.0-win32-alpha3.zip (4.72 MB)
-Greg
5. Re: wxEuphoria: get_string_selection() Not Working
- Posted by euphoric (admin) Apr 02, 2015
- 1761 views
Maybe my dlls need updating.
wxEuphoria-0.17.0-win32-alpha3.exe (3.61 MB)
wxEuphoria-0.17.0-win32-alpha3.zip (4.72 MB)
-Greg
Works for me now! Thanks, Greg!