Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

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

(1/4) > >>

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()' :

--- Code: --- wxString cat = cmb->GetValue();
bool isAll = cmb->GetSelection() == 0;

--- End code ---

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 :

--- Quote ---wxControlWithItems::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.

--- End quote ---

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 ??)

--- End quote ---
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 ??)

--- End quote ---
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 !!)

--- End quote ---
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 ???

--- End quote ---
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.

--- End quote ---
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 :)

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

--- End quote ---

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 ??)

--- End quote ---

yes, it changed to icc.


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

--- End quote ---

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 ... , ...°

--- End quote ---

as you said.


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

--- End quote ---

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 ???

--- End quote ---

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.

Navigation

[0] Message Index

[#] Next page

Go to full version