Re: [Scilab-users] Graphics: Current figure and current entity

2022-06-07 Thread Samuel Gougeon

Le 07/06/2022 à 11:39, CRETE Denis a écrit :


Hello,

I have several graphic windows and in some of them, there are several 
“Axes” (and several curves for each “Axes”).


I can’t find in “Scilab Help” if the “current axes” is always in the 
hierarchy of the “current entity”, and similarly if the “current 
figure” is always in the hierarchy of the “current axes”.



Good question. Let's test it :

1. sca(ax) sets the current figure to the one homing the ax axes:
   --> scf(0); plot(1:10); e0 = gce(); ax0 = gca();
   --> scf(1); plot(1:10); e1 = gce(); ax1 = gca();
   --> sca(ax0);
   --> gcf().figure_id
 ans  =
   0.
   --> sca(ax1);
   --> gcf().figure_id
 ans  =
   1.

2. set("current_entity", h) does NOT set the current figure to the one
   homing the targeted entity:
   --> scf(0); plot(1:10); e0 = gce(); ax0 = gca();
   --> scf(1); plot(1:10); e1 = gce(); ax1 = gca();
   --> set("current_entity", e0);
   --> gcf().figure_id
 ans  =
   1.
   --> gca().parent.figure_id
 ans  =
   1.

So now we can answer to your questions:

I can’t find in “Scilab Help” if the “current axes” is always in the 
hierarchy of the “current entity”,

Almost never.

and similarly if the “current figure” is always in the hierarchy of 
the “current axes”. 

Yes it is.


If this was true, I suggest to mention it in the “Graphics Entities” 
section.



Right, the sca() and set() pages could be clarified about this.

If not, is there a simple way to obtain the handle of the figure where 
the “current entity” is ?

I tried the following, which seems to work :

G_f = gce().parent;

while get(G_f,”type”)~=”Figure”,

  G_f =  G_f.parent;

end;


Yes, in short:

G_f = gce();

while G_f.type ~= ”Figure”,   G_f =  G_f.parent; end


that will work even when the initial G_f is already a figure.

Samuel
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


[Scilab-users] Native file and directory chooser under macOS

2022-06-07 Thread Stéphane Mottelet

Hi,

I think that macOS have been bothered by the Swing file/directory 
chooser since Java is used in Scilab. Under Windows or Linux these 
widgets are native (or almost native) and allow to simply select a disk, 
go to home directory, ... I have been working on this problem and found 
a solution which took some time to be applied to every places where it 
may be applicable (Scinotes, Xcos, graphical export, ...). You can 
experiment this new feature by downloading the new build, available at 
the usual macOS Scilab page:


https://www.utc.fr/~mottelet/scilab/download/branch-6.1/scilab-branch-6.1-x86_64-nativeFileChooser.dmg

Enjoy !

--
Stéphane Mottelet
Ingénieur de recherche
EA 4297 Transformations Intégrées de la Matière Renouvelable
Département Génie des Procédés Industriels
Sorbonne Universités - Université de Technologie de Compiègne
CS 60319, 60203 Compiègne cedex
Tel : +33(0)344234688
http://www.utc.fr/~mottelet

___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users


Re: [Scilab-users] Graphics: Current figure and current entity

2022-06-07 Thread Clément David
Hello Denis,

I don’t think Scilab provide a function to retrieve the parent figure of an 
entity ; could you open a bug with this wish ?

Note: internally, there is already a non-iterative O(1) way to retrieve it.

Regards,
Clément

From: users  On Behalf Of CRETE Denis
Sent: Tuesday, June 7, 2022 11:39 AM
To: Users mailing list for Scilab 
Subject: [Scilab-users] Graphics: Current figure and current entity

Hello,

I have several graphic windows and in some of them, there are several “Axes” 
(and several curves for each “Axes”).
I can’t find in “Scilab Help” if the “current axes” is always in the hierarchy 
of the “current entity”, and similarly if the “current figure” is always in the 
hierarchy of the “current axes”.
If this was true, I suggest to mention it in the “Graphics Entities” section.
If not, is there a simple way to obtain the handle of the figure where the 
“current entity” is ?
I tried the following, which seems to work :
G_f=gce().parent;
while get(G_f,”type”)~=”Figure”,
  G_f= G_f.parent;
end;

Did I reinvent the wheel ?-)

Thank you in advance
Denis
___
users mailing list
users@lists.scilab.org
http://lists.scilab.org/mailman/listinfo/users