News:

As usual while waiting for the next release - don't forget to check the nightly builds in the forum.

Main Menu

wxComboBox bug on linux (?) (please do this little test)

Started by killerbot, July 02, 2006, 01:13:56 AM

Previous topic - Next topic

killerbot

In my search and debugging activities to fix a bug in CB ([ Bug #7022 ] Compiler selection lags behind) (bug in linux) I have discovered somthing weird with the wxCombobox. The problem only arises on linux.

For example in the compiler settings there's a category's combobox, and also here the selection is lagging 1 choice behind. The problem occurs in the following code of 'CompilerOptionsDlg::DoFillOptions()' :
wxString cat = cmb->GetValue();
bool isAll = cmb->GetSelection() == 0;


While cmb->GetValue() is returning the (new) current value, after the selection had been modified (with the mouse !!, with arrows no problem), cmb->GetSelection() is returning the 'old' value, not the new(current) one. On windows this does work ok, and as said when selction changing is being done with the arrow keys (up/down) it's also OK.

When you read the actual bug report, it's the same problem but then with the combobox ofthe compiler list.

Has aynone else seen this errounous behaviour in his/her own programs (on linux). I have the impression it's a wx bug. As far as the categories is concerned I already have a work around ready, as fo the compiler combox list, I will create one.

This is the wx documentation :
QuotewxControlWithItems::GetSelection

int GetSelection() const

Returns the index of the selected item or wxNOT_FOUND if no item is selected.

Return value

The position of the current selection.

Remarks

This method can be used with single selection list boxes only, you should use wxListBox::GetSelections for the list boxes with wxLB_MULTIPLE style.

Maybe we shold explicitly state it's a single selection, but normally that's the default, and maybe this doesn't even matter, I am just guessing on what it could (in the assumption it's not a wx bug). As it is now, I thinks it's a wx bug.

kai


the categories combo box works fine here (wxwidgets 2.6.1 on ubuntu). on the other hand i remember that i had some very strange problems with a combo box in one of my own programs. but i've never really investigated it and don't work on that program anymore.

killerbot

can some other linux users give this a little test spin :
These are the steps to reproduce :

1) Settings -> Compiler and debugger (normally the list will contain 3 compilers : GNU, Intel, SDCC)
2) choose the programs tab
    a) C compiler : should be gcc
    b) in the selcet compiler combobox choose with the mouse the second entry (intel), C ompiler should now be : icc ( does it ??)
    c) now select the sdcc compiler : C compiler should be : sdcc (does it ??)
3) cancel out of the settings menu
4) Settings -> Compiler and debugger
5) stay on the compiler tab, and leave the compiler on the GNC GCC,
   a) the categories are on <All categories>, you can see a lot of settings (produce ..., profile .. Enable ... , ...°
   b) in the categories combo box choose debugging --> do you still have as many settings ? (there should be only 1 !!)
   c) in the categories combo box go back to <all categories> --> all settings should be listed again, or is your list empty ???

Please also state yous linux version and wx version.

many thanks for the help,
Lieven

Der Meister

Quote from: killerbot on July 02, 2006, 06:28:19 PM
    b) in the selcet compiler combobox choose with the mouse the second entry (intel), C ompiler should now be : icc ( does it ??)
No. It's still gcc.

Quote from: killerbot on July 02, 2006, 06:28:19 PM
    c) now select the sdcc compiler : C compiler should be : sdcc (does it ??)
No. It's icc.

Quote from: killerbot on July 02, 2006, 06:28:19 PM
   b) in the categories combo box choose debugging --> do you still have as many settings ? (there should be only 1 !!)
Yes, I still have as many settings as before.

Quote from: killerbot on July 02, 2006, 06:28:19 PM
   c) in the categories combo box go back to <all categories> --> all settings should be listed again, or is your list empty ???
The list is empty now.

Quote from: killerbot on July 02, 2006, 06:28:19 PM
Please also state yous linux version and wx version.
Gentoo Linux, Kernel 2.6.16.9, gcc 3.4.6, wxGTK 2.6.2, Unicode, C::B revision 2639

I hope this helps you solving this problem :)
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

oz

Quote from: killerbot on July 02, 2006, 06:28:19 PM
can some other linux users give this a little test spin :
These are the steps to reproduce :

1) Settings -> Compiler and debugger (normally the list will contain 3 compilers : GNU, Intel, SDCC)
2) choose the programs tab
    a) C compiler : should be gcc

yes it is gcc.

Quote
    b) in the selcet compiler combobox choose with the mouse the second entry (intel), C ompiler should now be : icc ( does it ??)

yes, it changed to icc.

Quote
    c) now select the sdcc compiler : C compiler should be : sdcc (does it ??)

yes it changed properly.

Quote
3) cancel out of the settings menu
4) Settings -> Compiler and debugger
5) stay on the compiler tab, and leave the compiler on the GNC GCC,
   a) the categories are on <All categories>, you can see a lot of settings (produce ..., profile .. Enable ... , ...°

as you said.

Quote
   b) in the categories combo box choose debugging --> do you still have as many settings ? (there should be only 1 !!)

yep, only one.

Quote
   c) in the categories combo box go back to <all categories> --> all settings should be listed again, or is your list empty ???

yep, it restored correctly.

fedora core 5 Kernel 2.6.17, 2652 nightly(download from this forum, so build with GCC 4.0.2, wx262), GCC411, wx263.

mandrav

Everything works fine here too.
Ubuntu64, wx2.6.1 (from repositories).
Be patient!
This bug will be fixed soon...

killerbot

so far it seems to be related to wx 2.6.2. In the bug report on berlios, feedback has arrived from a user having the problem (with wx 2.6.2), and after upgrading to wx 2.6.3 the problem was gone.

So several of us, who are at wx 2.6.2 are suffering from 'what seems to be' a serious wx bug, all our comboboxes are behaving incorrectly !!!
That means a help of a job, to write workarounds for all those comboboxes.
I am going to provide a least a workaround for the comileroptions, since that's a very important one, and because there are other bugs I have to fix in that area.

TheTuxKeeper

So the reason of bug #7480 seems to be found, too.  :)

Tested for bug #7022 and #7480 on rev2652 and wxGTK 2.6.2 on FC4, and rev2652 and wxGTK 2.6.2 on FC5 and for bug #7022 I have the same as Der Meister described, bug #7480 as described in the bug report.
Nightly builds for openSUSE

killerbot

Today I have tried another workaround for the wxComboBox bug. I have committed it as a first test (revision 2661). (only) For the categorys on the compiler tab of the compiler settings, I have replaced the wxComboBox by a wChoice control.
On windows things keep working, and on my linux (wx 262) it now works ok. Could you linux users who were also suffering from this bug give it a try ?
One strange thing I have is : each time I reenter the choice control every entry I have selected before is now unvisible, it only becomes visible when I (pre)select it with the mouse or up/down keys. I wonder if this is more general, or it is just my display settings (linux suse 10.1 64 bit) ? in the case this is moe general, well then one bad thing get's replaced by another bad thing :-(

PS : If you can think of a reason why it should be a combobox and not a wxChoice, please tell me.

Der Meister

Quote from: killerbot on July 03, 2006, 10:37:12 PM
Could you linux users who were also suffering from this bug give it a try ?
Of course but I wont have access to my linux machine before the weekend, thus you have to be patient ;)
Real Programmers don't comment their code. If it was hard to write, it should be hard to understand.
Real Programmers don't write in BASIC. Actually, no programmers write in BASIC, after the age of 12.

TheTuxKeeper

Replacing the wxComboBox with wxChoice works :)

The wrong compiler flags and program file names are still shown, but changing the compiler flag categories works as expected. The path auto-detection also looks for the right compiler (the selected one, not the displayed one). If gcc is selected and sdcc program file names are shown, it's searching for gcc and finds it :D

I hope that helps to fix it. I can do some more test, if you say what I should do :)

Bug #7480 seems to be fixed. :D

I tested it with rev2680
Nightly builds for openSUSE

killerbot

cool, the compiler combobox will be fixed this weekend.
Did you have the same strang visualiosation issue like I had (first time selection, then no longer  visible ...)
or can that be a wrong setting off my linux system ?

TheTuxKeeper

Quote from: killerbot on July 05, 2006, 01:36:46 PM
cool, the compiler combobox will be fixed this weekend.
Did you have the same strang visualiosation issue like I had (first time selection, then no longer  visible ...)
or can that be a wrong setting off my linux system ?
I had such an issue when changing the template categories (Bug #7480). If I changed selection and wanted to select all categories again, there were no templates displayed.
I didn't check this somewhere else. Wait, I'll downgrade again and check this in the compiler flag settings, but I think I had this, too.
Nightly builds for openSUSE

killerbot

no no I don't mean that:
Compiler tab : categories:

1) first time I open : I see all choices "visible", say I select debug --> now switches ok (no lag)



2) second time now i go to that choice box : the "debug" choice is not visible, it is like I have a blank line, but when I move the ouse over it (so it gets selected) then i can read it again. Say I now choose another entry -> next 2 entries not visible, visible again when mouse is over it, once mouse is longer over it again not visible (but the choice entry is still there : I can select it and things change, no lag, accordingly)

TheTuxKeeper

#14
Quote from: killerbot on July 05, 2006, 01:54:04 PM
no no I don't mean that:
Compiler tab : categories:

1) first time I open : I see all choices "visible", say I select debug --> now switches ok (no lag)



2) second time now i go to that choice box : the "debug" choice is not visible, it is like I have a blank line, but when I move the ouse over it (so it gets selected) then i can read it again. Say I now choose another entry -> next 2 entries not visible, visible again when mouse is over it, once mouse is longer over it again not visible (but the choice entry is still there : I can select it and things change, no lag, accordingly)
No, for me it works as expected. Everything stays visible.

It could be that the gtk-theme changes the text color of the selected item accidentally to the background color. Perhaps try to change the theme.
Nightly builds for openSUSE