[Scilab-users] graphics .uid : usage (& display)

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

[Scilab-users] graphics .uid : usage (& display)

Dear co-scilabers,

I am wondering about the hidden "uid" property of all graphical objects :
--> plot()
--> gcf().uid
 ans  =
--> gca().uid
 ans  =
--> gce().uid
 ans  =

It is a protected property, and it's OK:
--> gca().uid=500
Unknown property: uid.

Question #1: this property is not displayed. Is it on purpose?

Question #2: What can we do with this property? In particular, can we call directly some java routines with it, and then: How (example)?

I was digging around this uid, because i am searching for a robust -- and if possible built-in -- way to declare that a graphical component relies on another one. Examples :
  • a label of a contour line is "ascribed" to this line
  • a colorbar (that is an axes in its own) is related to a given other axes
  • etc.

Of course, it is possible to use the .tag property of the "parent" object (the line, the colored axes,..), and register it in the .userdata property of the "child" (the label, the colorbar..). And may be i will finally do things in this way.

But since there is this ".uid" that has the main advantage to be unique, with which we are sure that there was no id collision, i was wondering about it.

From here to there, i was wondering about the robustness of these uid values when saving in a file a figure or a graphical component, and then reloading it 2 months later. It comes that  .uid values ascribed to the reloaded objects are NOT the original ones. So, unfortunately, referring to uid to link objects is not robust...

So, if anyone knows

  • something about questions #1 and #2
  • how to avoid using the .tag to declare robust links between graphical objects
Hope reading you.

Best regards

users mailing list
[hidden email]