kostyll / formlayout

Automatically exported from code.google.com/p/formlayout
0 stars 0 forks source link

Drop-down list selection returns [choice - 1] (off by 1) #7

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Start fedit form with one of the widgets being a list (so a dropdown is 
shown on the form)
2. Select an option when running

This happens regardless of when I use this list - simplest case:
>> datalist = [('done', [0, 'No', 'Yes'])]
>> fedit(datalist)

Select 'Yes' from dropdown, Output = 'No'. Select 'No', output is 0

What is the expected output? What do you see instead?
Expect to see the selected option - instead, the option that is returned is the 
item before the option selected.

What version of the product are you using? On what operating system?
Was running 1.0.9, and just downloaded 1.0.12. No change. Running Python 2.7.3 
from Python(x,y) Ver 2.7.3.0 on Win32 (XP). Ran in python cmd shell and in 
iPython QT console, same result.

Please provide any additional information below:
I first noticed issue when using the formlayout.fedit function as part of a 
larger program I was writing. This larger program also uses TKinter for a file 
open dialog and message box (ick, I know, but it was faster than learning 
something new)

Original issue reported on code.google.com by jonathan...@gmail.com on 2 Apr 2013 at 9:50

GoogleCodeExporter commented 9 years ago
Update - used this after several trial iterations. After rebooting, the results 
of the dropdown selection now return index number of the selection minus 1, 
which I can use - still, in the example the output shown gives the list element 
selection, not index. Seems it still has the same off-by-one problem which I'm 
guessing is why a '0' is placed at the beginning of the list but this time 
returns indices instead.

Original comment by jonathan...@gmail.com on 2 Apr 2013 at 10:11

GoogleCodeExporter commented 9 years ago
I have also had this problem, where fedit returns the index from a list input, 
rather than the list item itself. Is there any suggestion of a resolution to 
this problem (since, as you point out, the example output on the formlayout 
home page shows fedit returning the list item), or should I regard this as 
normal behaviour of fedit and just work with it?

Original comment by profsk...@hotmail.com on 29 Jan 2014 at 12:56