<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
</head>
<body>
On 8/13/20 2:55 PM, John Rose wrote:
<br>
<blockquote type="cite" style="color: #000000;">I'm a baffled by how
to monitor a ComboBox's usage. I have the Text property of
ComboBoxConnectChannel equal to 'Please Select Channel' with its
List property empty. I then fill the list as follows:
<br>
With ComboBoxConnectChannel
<br>
.Clear
<br>
.Add("BBC One")
<br>
.Add("BBC Two")
<br>
.Add("BBC Four")
<br>
.Add("CBBC")
<br>
.Add("CBeebies")
<br>
.Add("BBC News")
<br>
.Add("BBC Parliament")
<br>
End With
<br>
<br>
I then want the user to select an item from the list (which is
displayed with the correct list of values as a popup) after the
user clicks on the arrow to the right of the textbox part of the
ComboBox) and have the textbox (part of the ComboBox) set equal to
the value of the selected item. At runtime, the user selects one
of the items from the popup but its value is *not *shown in the
text box part of the ComboBox:
<br>
Public Sub ComboBoxConnectChannel_Change()
<br>
sConnectChannel = Trim(ComboBoxConnectChannel.Text)
<br>
Print "Channel=" & sConnectChannel
<br>
End
<br>
<br>
So for example if the user has clicked on the arrow followed by
clicking on the 'BBC Four' item, the variable sConnectChannel is
set equal to 'BBC Four' correctly but the textbox part of the
ComboBox still shows 'Please Select Channel'. What do I change in
the above Public Sub coding to achieve this?
<br>
<br>
</blockquote>
<br>
<p>It works fine here with Qt5. Perhaps you should attach a project
that duplicates the behavior you've described. <br>
</p>
<p><br>
</p>
<p>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:</p>
<p>Channel=Please Select Channel<br>
<br>
(TestApp3:23871): Gtk-CRITICAL **: 07:15:07.602:
gtk_box_gadget_distribute: assertion 'size >= 0'<br>
failed in GtkRadioButton<br>
<br>
(TestApp3:23871): Gtk-CRITICAL **: 07:15:07.931:
gtk_box_gadget_distribute: assertion 'size >= 0'<br>
failed in GtkRadioButton<br>
Channel=CBBC</p>
<p><br>
</p>
<p>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. <br>
</p>
<p>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)?<br>
</p>
</body>
</html>