Hello,
I have a problem while creating a CUI window. In the scene whose link is below, I already use some CUI windows and they work well. The problem is with the ui3: I need this window to be displayed only when an if-condition is satisfied, but in the way I have written the script, the window appears continuously. I have tried to use another kind of loop, like the while or the repeat...until, but I cannot use them in a non-threaded script, and I cannot break the if statement. Could you please help me to find a solution?
Cheers
https://drive.google.com/file/d/13Zk9w- ... sp=sharing
Custom User Inteface
Re: Custom User Inteface
Hello,
currently you are launching ui3 dialogs in each simulation step (when the if condition is fullfilled).
So you first need to check if that dialog is already open. If not, open it. Otherwise do something else.
E.g. use maybe something like:
and
(do not hide the uis, destroy them instead. Otherwise you can run into tricky situations).
You can also use a modal dialog, if you do not want to user to be able to interact with any other dialog (including V-REP UIs).
Cheers
currently you are launching ui3 dialogs in each simulation step (when the if condition is fullfilled).
So you first need to check if that dialog is already open. If not, open it. Otherwise do something else.
E.g. use maybe something like:
Code: Select all
if not ui3 then
ui3=simUI.create(xml3)
end
Code: Select all
function closeEventHandler(ui)
sim.addStatusbarMessage('Window '..ui..' is closing...')
if ui==ui3 then
ui3=nil
end
simUI.destroy(ui)
end
You can also use a modal dialog, if you do not want to user to be able to interact with any other dialog (including V-REP UIs).
Cheers