Post by Rod on Jun 14, 2022 4:41:26 GMT -5
This code was discussed on another forum. It would appear that a radiobutton's handler is called immediately on opening the window. No user interaction takes place. I assume it is the system setting the radiobuttons to their default setting. If a combobox is part of the control set it fails to update and show its status.
Here we set the index to index 1 but the combobox does not show this. The program sets trapclose, combobox and radiobutton on opening. The radiobutton update shows but to force the combobox to show its update we need to insert a scan command.
Even if we remove the radiobutton set command the handler is still called once on startup and the scan is still required to force the combobox to show its update.
This other combobox problem can also be fixed by adding an additional scan statement
libertybasiccom.proboards.com/thread/1427/use-comboboxcolor
All just for info, I am not expecting a fix. Not had time to see if LB5 is impacted.
Here we set the index to index 1 but the combobox does not show this. The program sets trapclose, combobox and radiobutton on opening. The radiobutton update shows but to force the combobox to show its update we need to insert a scan command.
Even if we remove the radiobutton set command the handler is still called once on startup and the scan is still required to force the combobox to show its update.
dim clueNumbers$(6)
clueNumbers$(0) = "1"
clueNumbers$(1) = "2"
clueNumbers$(2) = "3"
clueNumbers$(3) = "4"
clueNumbers$(4) = "5"
clueNumbers$(5) = "6"
call openCluesWnd
wait
sub openCluesWnd
radiobutton #clueWnd.rowRB, "Row", handler, handler, 30, 56, 45, 20
radiobutton #clueWnd.colRB, "Col", handler, handler, 30, 96, 45, 20
combobox #clueWnd.clueNumbersCB, clueNumbers$(), handler, 30, 126, 40, 25
open "Set Clues" for dialog_nf_modal as #clueWnd
#clueWnd "trapclose [quitclue]"
#clueWnd.clueNumbersCB "selectindex 1"
#clueWnd.rowRB "set"
'scan
wait
[quitclue]
close #clueWnd
end sub
sub handler buttonhandle$
print "Button Handle is ";buttonhandle$
#clueWnd.clueNumbersCB, "selection? selectedClueNo$"
print "Clue number is "; selectedClueNo$; "."
end sub
This other combobox problem can also be fixed by adding an additional scan statement
libertybasiccom.proboards.com/thread/1427/use-comboboxcolor
All just for info, I am not expecting a fix. Not had time to see if LB5 is impacted.