Re: NEWT :: selecting an item from a listbox
- Posted by ghaberek (admin) Dec 26, 2012
- 1962 views
K_D_R said...
Thanks, Greg, for the sample code. I am still having problems - here is the code I have been working with, the comments will show variations I have tried.
<snip>
Any suggestions will be appreciated!
Interesting. Maybe it's returning a string pointer? I'm completely unsure here. As the documentation states, the Listbox is the most complicated control in Newt. What happens if you do this instead?
-- get the selected "item" atom ptr = newt:ListboxGetCurrent( listbox ) -- peek the string from the pointer sequence item = peek_string( ptr ) -- display the result printf( 1, "you selected: %s\n", {item} )
-Greg