[Gambas-user] User Digest, Vol 35, Issue 31

John Rose john.aaron.rose at mailbox.org
Fri Aug 14 18:50:47 CEST 2020


On 14/08/2020 16:40, user-request at lists.gambas-basic.org wrote:
> 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.

Thanks Lee & Bruce for your answers. I've now amended TestApp3 
(attached) in away that ignores clicks on the ComboBox until a 'valid' 
item has been selected. By 'valid' I mean that the user has not clicked 
on the arrow or the textbox part of the ComboBox. The code is quite 
simple, though no doubt some people will disagree:
Public Sub ComboBoxConnectChannel_Change()
   Dim iIndex As Integer
   iIndex = Last.Index
   Print "Channel Index = " & iIndex
   If iIndex < 0 Then
     Return
   Endif
   Last.Text = Last.Current.Text
   sConnectChannel = Trim(Last.Current.Text)
   Print "Channel=" & sConnectChannel
End

Useful to know about the RadioButtons. As I'm a belt & braces man, I'll 
stick with what I have.

I'll also stick with gb.gui. Hopefully that will give a wider audience 
(rather than my using gb.gtk+) when I eventually put the app (from which 
I created TestApp3) on Gambas Farm. Some way off due to problems that I 
won't go into.

Useful to know the simple technique of "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.". The 
actual option in Thunderbird is "Reply to List".

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200814/caaed81c/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: TestApp3.tar.gz
Type: application/gzip
Size: 27602 bytes
Desc: not available
URL: <https://lists.gambas-basic.org/pipermail/user/attachments/20200814/caaed81c/attachment-0001.gz>


More information about the User mailing list