LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do you access the properties of a decorations?

Using references of a vi server class, i noticed there is an ability to access properties of decorations and panels. How do you create a reference to these?
0 Kudos
Message 1 of 6
(3,861 Views)
The VI server function Open VI reference returns a reference to a specific VI. There are a couple of flavors of how you open it. If the decorations that you are refering to are the title, close box etc, then yes you can manipulate these features, however, front panel decorations from the pallet do not have references.
Stu
0 Kudos
Message 2 of 6
(3,861 Views)
Front panel decorations DO have references (in LV 6):

here is how to access them:

place a property node on the diagram, right click in the top part of the
node and ->Select VI Server class->VI
in the element part of the node select 'Front Panel' and you get a ref to
the VI's front panel
connect a new property node to this ref, it should automatically change to
VI Server class->Generic->GObject->Panel
in the element field of this prop node choose Decorations[], you will get
an array of refnums to the decorations
select an array element and connect a third prop node to it, it will
change to VI Server class->Generic->GObject->Decoration->Decoration
in the element field of this this prop node you can access the
decoration's properties Position, Bounds, S
ize, Color and the visibility
attribute


-Franz


Stu wrote:

> The VI server function Open VI reference returns a reference to a
> specific VI. There are a couple of flavors of how you open it. If
> the decorations that you are refering to are the title, close box etc,
> then yes you can manipulate these features, however, front panel
> decorations from the pallet do not have references.
> Stu
0 Kudos
Message 3 of 6
(3,861 Views)
Franz,

your method works when there is only one decoration, I can control its visibility. but if there are more than one, an error will be reported at the third prop, code 1055, object references is invalid.
0 Kudos
Message 4 of 6
(3,861 Views)
Sorry I may cause confusion. what I am doing is that when I use Tab control and put decorations on different pages, I cannot use your method to access decoration prop. error code is 1055.but if I move the deco to "front panel", your method is correct.
0 Kudos
Message 5 of 6
(3,861 Views)
Actually, you can control multiple decorations in LV 7.0. The reference is an ARRAY of refs to the decorations, and they are indexed by front-to-back order. Did you get the invalid ref due to the array, not a single ref? Works for me.
Certified LabVIEW Associate Developer
0 Kudos
Message 6 of 6
(3,861 Views)