[Scilab-users] How to keep figure active with x_mdialog window open?

Izabela Wójcik-Grząba iwoj at il.pw.edu.pl
Mon Jul 23 17:43:34 CEST 2018


I am trying to substitute my x_mdialog() by 3 listboxes put in a graphic 
window. My code is a slightly remodelled version of a Demo "Listboxes 
and popupmenus":

f = figure("dockable", "off" ,"infobar_visible", "off", 
"toolbar_visible", "off", "menubar_visible", "off", "default_axes", 
"off", "visible", "off", "layout", "gridbag");
set(f, "figure_id", 1);
set(f, "figure_name", "Listboxes and Popupmenus");
set(f, "axes_size", [850 120]);
kier_x = [
"W 1 x", "#000000", "#FFFFFF";
"W 2 x", "#FFFFFF", "#000000";
"W 3 x", "#000000", "#FFFFFF";
"W 4 x", "#FFFFFF", "#000000";
"W 5 x", "#000000", "#FFFFFF";
"W 6 x", "#FFFFFF", "#000000"];
c = createConstraints("gridbag", [1, 1, 1, 1], [1 1], "both");
list1=uicontrol(f, "style", "listbox", "constraints", c, "margins", [5 5 
5 5],..
"max",20,"min",0, "string", kier_x);
kier_y = [
"W 1 y", "#000000", "#FFFFFF";
"W 2 y", "#FFFFFF", "#000000";
"W 3 y", "#000000", "#FFFFFF";
"W 4 y", "#FFFFFF", "#000000";
"W 5 y", "#000000", "#FFFFFF";
"W 6 y", "#FFFFFF", "#000000"];
c = createConstraints("gridbag", [2, 1, 1, 1], [1 1], "both");
list2=uicontrol(f, "style", "listbox", "constraints", c, "margins", [5 5 
5 5],..
"max",20,"min",0, "string", kier_y);
kier_z = [
"W 1 z", "#000000", "#FFFFFF";
"W 2 z", "#FFFFFF", "#000000";
"W 3 z", "#000000", "#FFFFFF";
"W 4 z", "#FFFFFF", "#000000";
"W 5 z", "#000000", "#FFFFFF";
"W 6 z", "#FFFFFF", "#000000"];
c = createConstraints("gridbag", [3, 1, 1, 1], [1 1], "both");
list3=uicontrol(f, "style", "listbox", "constraints", c, "margins", [5 5 
5 5],..
"max",20,"min",0, "string", kier_z);
set(f, "visible", "on");

I have two questions:
1. How to make the lists to be multiselect (now it seems that this 
option doesn't work despite the max and min values)?
2. How to write the selected values into the vectors and then close the 
window?

I know that these are simple questions but I am rather a beginner in 
Scilab and I get more and more confused with every new problem.

Regards,
Iza





W dniu 20.07.2018 12:47, Izabela Wójcik-Grząba napisał(a):
> Thank you for the explanation and suggestions. I will have to put my
> x_mdialog into another graphic window.
> 
> Iza
> 
> 
> 
> 
> W dniu 19.07.2018 20:43, Samuel Gougeon napisał(a):
>> Hello Izabela,
>> 
>> What you wish to do is not possible with x_mdialog(), that is a modal
>> dialog: it pauses everything else until the dialog is quit.
>> 
>> To do what you want, it's possible to create your own dialog box based
>> on uicontrol("style", "edit") or other interactive components.
>> Basically, you may have a look at the demos demo_gui(): GUI =>
>> Uicontrosl1 or Uicontrols2. Both have a "View-code" link in their menu
>> bar.
>> 
>> Best regards
>> Samuel
>> 
>> Le 19/07/2018 à 14:13, Izabela Wójcik-Grząba a écrit :
>>> Hi all,
>>> 
>>> I have another problem. In my program I create an initial plot which 
>>> is a basis for the input implemented by x_mdialog command. The 
>>> problem is that when the x_mdialog window pops up the figure window 
>>> bocomes inactive. It means that I can't zoom or rotate the plot which 
>>> is necessary to correctly enter the data to x_mdialog matrix. Is 
>>> there any solution to this? Is it possible to keep the figure active 
>>> when other windows occur?
>>> 
>>> Thanks in advance,
>>> Iza
>>> _______________________________________________
>>> users mailing list
>>> users at lists.scilab.org
>>> http://lists.scilab.org/mailman/listinfo/users
>>> 
>> 
>> _______________________________________________
>> users mailing list
>> users at lists.scilab.org
>> http://lists.scilab.org/mailman/listinfo/users
> _______________________________________________
> users mailing list
> users at lists.scilab.org
> http://lists.scilab.org/mailman/listinfo/users



More information about the users mailing list