<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<div class="moz-cite-prefix">Le 22/10/2021 à 12:56, P M a écrit :<br>
</div>
<blockquote type="cite"
cite="mid:CACf7ODvGckLAdtKuKbUEPFWW-kRfQDqctbBxi9RQnymjW+-iTA@mail.gmail.com">
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<div dir="ltr">
<div>Dear,</div>
<div><br>
</div>
<div>in a messagebox:<br>
</div>
<div><br>
</div>
<div>Is it possible to have a button other than the first one
pre-selected?</div>
<div><br>
</div>
<div>e.g.: I'd like to have "No" pre-selected in the example
below?</div>
<div><br>
</div>
<div>In my application the buttons must stay in their order as
they are...so simply changing the order (button label) is no
option.<br>
</div>
<div><br>
</div>
<div>Thank you,</div>
<div>Philipp<br>
</div>
<div><br>
</div>
<div><img src="cid:part1.QfhQIJ54.ZRUJVVd1@free.fr"
alt="grafik.png" class="" width="275" height="136"></div>
</div>
</blockquote>
<p><br>
</p>
<p>
</p>
<div class="moz-text-html" lang="x-unicode">
<blockquote type="cite"
cite="mid:CACf7ODvGckLAdtKuKbUEPFWW-kRfQDqctbBxi9RQnymjW+-iTA@mail.gmail.com">
<div dir="ltr">
<div>Is it possible to have a button other than the first one
pre-selected?</div>
</div>
</blockquote>
<p>Almost :-/ So, AFAIK, unfortunately no.<br>
There is a
CallScilabBridge.setMessageBoxDefaultSelectedButtons(id, k) java
method (*)<br>
that should set it, where k is the index of the preselected
button.<br>
But in the code it is apparently implemented only for
x_choices()</p>
<p>As well,<br>
<br>
<font face="monospace">messagebox("Have you seen this beautiful
message", "info", ["Yes" "No"]);<br>
jimport org.scilab.modules.gui.utils.UIElementMapper ;<br>
m = UIElementMapper.getCorrespondingUIElement(1);<br>
m.setDefaultSelectedButtons(1); // First is #0</font></p>
<p>does nothing<br>
<br>
Samuel<br>
</p>
<p>(*)<br>
jimport org.scilab.modules.gui.bridge.CallScilabBridge<br>
jgetmethods(CallScilabBridge)<br>
<br>
</p>
</div>
</body>
</html>