[Gambas-user] ComboBox usage

T Lee Davidson t.lee.davidson at gmail.com
Fri Aug 14 15:23:35 CEST 2020


On 8/14/20 2:35 AM, John Rose wrote:
> When I run the attached stripped-down TestApp3 app, the app enters ComboBoxConnectChannel_Change before I select an item 
> (possibly due to clicking on the combobox's arrow or because the SetAvailableConnectChannels procedure has been executed in 
> order to populate the combobox). This can be seen in the Console output shown below:
> 
> Channel=Please Select Channel

The ComboBox Change event is raised when the text in the combo box is modified. This happens at line 78 of the 
SetAvailableConnectChannels procedure which is called upon Form_Open before any user interaction. So, Bruce is correct on this.

However, I disagree that ComboBoxConnectChannel.Text will return the string in the textbox, not the item in the combobox list 
that the user has selected. While technically correct, the string in the textbox *should* have been set to the text of the 
currently selected item so the result should be the same. This is how the ComboBox behaves on my system even when using GTK3 
instead of Qt5.

On a side note, it is not necessary to explicitly set the values of the RadioButtons as you have done at lines 34 & 35 and 44 & 
45 in the RadioButton_Click event handlers. Since the RadioButtons have the same parent, they are mutually exclusive. Clicking 
one will set its value to true and all others (with the same parent) to false.


> Please note that I'm using the gb.gui component as I've been told that the better of QT and GTK+ will be selected according to 
> the machine it's being run on.

It's not a matter of which one is better. It is a matter of which one is available. If you intend to share your project, you 
should make it compatible with systems that use either one exclusively. Using gb.gui accomplishes that. If you will be the only 
one using your project, you can use whichever component you wish.


> PS I find it difficult to get the 'quoting' of previous messages correct when I reply to someone else's post. Is this due to my 
> using Digest Mode (which I prefer in order to get fewer emails where I'm not interested in the topic)?

Not necessarily. I don't know what you consider to be correct quoting. But, simply highlighting the text of a singular message 
in the digest and using the Reply To function (button?) should place the highlighted text as a quote in a new message.


-- 
Lee

[System]
Gambas=3.15.1
OperatingSystem=Linux
Kernel=4.12.14-lp151.28.59-default
Architecture=x86_64
Distribution=openSUSE Leap 15.1
Desktop=KDE5
Theme=breeze
Language=en_US.UTF-8
Memory=16030M

[Libraries]
Cairo=/usr/lib64/libcairo.so.2.11600.0
Curl=/usr/lib64/libcurl.so.4.5.0
DBus=/usr/lib64/libdbus-1.so.3.19.4
GStreamer=/usr/lib64/libgstreamer-1.0.so.0.1205.0
GTK+2=/usr/lib64/libgtk-x11-2.0.so.0.2400.32
GTK+3=/usr/lib64/libgtk-3.so.0.2200.30
OpenGL=/usr/lib64/libGL.so.1.0.0
Poppler=/usr/lib64/libpoppler.so.73.0.0
QT4=/usr/lib64/libQtCore.so.4.8.7
QT5=/usr/lib64/libQt5Core.so.5.9.7
SDL=/usr/lib64/libSDL-1.2.so.0.11.4
SQLite=/usr/lib64/libsqlite3.so.0.8.6


More information about the User mailing list