[Iup-users] Problem with the GTK dropdown list.
Brought to you by:
scuri
From: Paul G. <aq...@gm...> - 2009-10-31 23:49:23
|
Hi, I'm using IUP with Lua on a project at the moment, and discovered a strange problem which I think I've tracked down the solution to. When using an IupList control, with DROPDOWN="YES", and populated with a single value, if I do... mylistctrl.value = 1 to programmatically select the first (and only) entry, it fails, leaving the selection empty. I tracked this down to line 352 in the file src/gtk/iupgtk_list.c (this is on a copy of the source from version 3.0rc3. The line checks that the specified value is >0 and < the number of values in the list, but doesn't take into account that the GTK indices are 0 based, but the IUP indices are 1 based. The code at line 354 correctly takes this into account, so it's possible to programmatically select any but the last entry in the list. As an aside, I'm really enjoying working with this toolkit, much moreso than many others I've had experience with, especially the Lua binding, congratulations to all involved on a nice, clean interface. Cheers Paul |