[Scilab-users] Messagebox - button pre-selection

Samuel Gougeon sgougeon at free.fr
Sat Jan 7 23:26:42 CET 2023


Le 22/10/2021 à 12:56, P M a écrit :
> Dear,
>
> in a messagebox:
>
> Is it possible to have a button other than the first one pre-selected?
>
> e.g.: I'd like to have "No" pre-selected in the example below?
>
> In my application the buttons must stay in their order as they 
> are...so simply changing the order (button label) is no option.
>
> Thank you,
> Philipp
>
> grafik.png


> Is it possible to have a button other than the first one pre-selected?

Almost :-/  So, AFAIK, unfortunately no.
There is a CallScilabBridge.setMessageBoxDefaultSelectedButtons(id, k) 
java method (*)
that should set it, where k is the index of the preselected button.
But in the code it is apparently implemented only for x_choices()

As well,

messagebox("Have you seen this beautiful message", "info", ["Yes" "No"]);
jimport org.scilab.modules.gui.utils.UIElementMapper ;
m = UIElementMapper.getCorrespondingUIElement(1);
m.setDefaultSelectedButtons(1); // First is #0

does nothing

Samuel

(*)
jimport org.scilab.modules.gui.bridge.CallScilabBridge
jgetmethods(CallScilabBridge)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.scilab.org/pipermail/users/attachments/20230107/9a60e7d1/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: grafik.png
Type: image/png
Size: 7370 bytes
Desc: not available
URL: <https://lists.scilab.org/pipermail/users/attachments/20230107/9a60e7d1/attachment.png>


More information about the users mailing list