LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Find Tab page name with scripting

Solved!
Go to solution

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it and some more buttons on pages of the tab control.
I want to use VI scripting to perform some tasks (in this case static code tests) on the buttons.
I can split out the split out the controls using traverse FP for GObjects into those of ClassName=Boolean and then sub divide them into those whose Owner is ClassName=Panel or Page...
However from here I can't seem to get a reference to allow me to determine the tab control page name on which the controls actually sit

James_W_0-1648736099486.png


Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James

CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 1 of 23
(3,048 Views)

@James_W wrote:

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it ......
Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James


James my friend, the obvious thing you're doing wrong it using those Tab Containers.  I HATE THEM!

 

I suspect that the owning class is pane or container 

 

Class hierarchy should be vi fp panel, pane (if there is a splitter) container of type tab. Pages/panes of tab names.


"Should be" isn't "Is" -Jay
0 Kudos
Message 2 of 23
(3,036 Views)

Seems like you would have to get the reference to your tab control in question, and make a list of which controls are on which page as so, and then look each control up

 

I'm not sure of your specifics or what you're trying to do, but if you don't really care about the Booleans not on the tab control, then I feel like you'd be better off traversing to find that tab control ref, then from it you can neatly get an array of references for the controls of each page.

 

Spoiler
FireFistRedhawk_1-1648738647618.png

 

Redhawk
Test Engineer at Moog Inc.

Saying "Thanks that fixed it" or "Thanks that answers my question" and not giving a Kudo or Marked Solution, is like telling your waiter they did a great job and not leaving a tip. Please, tip your waiters.

0 Kudos
Message 3 of 23
(3,031 Views)
Solution
Accepted by topic author James_W

You can use the To More Specific Class function to cast the Owner reference to the Page class, then read properties of the page:

 

tab.png

Message 4 of 23
(3,019 Views)

@JÞB wrote:

@James_W wrote:

Looking for a pointer or to finish me off please.

I've got a UI with buttons (boolean) on it.
I've also got a tab control on it ......
Ideas please? - I'm missing something fundamentally obvious I think.

Thanks

James


James my friend, the obvious thing you're doing wrong it using those Tab Containers.  I HATE THEM!

 

I suspect that the owning class is pane or container 

 

Class hierarchy should be vi fp panel, pane (if there is a splitter) container of type tab. Pages/panes of tab names.


The fact that you hate tab controls doesn't make it wrong to use them.

"If you weren't supposed to push it, it wouldn't be a button."
Message 5 of 23
(3,012 Views)

@James_W wrote:

Looking for a pointer or to finish me off please.


In general, 'finishing someone off' means to kill that person.

"If you weren't supposed to push it, it wouldn't be a button."
0 Kudos
Message 6 of 23
(3,010 Views)

@paul_cardinale wrote:

@James_W wrote:

Looking for a pointer or to finish me off please.


In general, 'finishing someone off' means to kill that person.


Or, "la petite mortae" but I'm not going to help with either of those.


"Should be" isn't "Is" -Jay
Message 7 of 23
(2,996 Views)

Thanks Darren,


@Darren wrote:

You can use the To More Specific Class function to cast the Owner reference to the Page class, then read properties of the page:

 

tab.png


That's exactly what I was looking for.
for some reason I didn't try the obvious - I thought I should have been there easily.
I tried to more specific Tab class and an Open VI Object reference on the Page, but that didn't give me the correct PageLabel.

James


CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
0 Kudos
Message 8 of 23
(2,966 Views)

@paul_cardinale wrote:

@James_W wrote:

Looking for a pointer or to finish me off please.


In general, 'finishing someone off' means to kill that person.


If you're going to be picky, Paul, that's only the general case! And English is my mother tongue (not American) 😉, so I'm going to allow myself that leeway when tired and when the meaning is very clear. This is not a forum of hitmen or dog salesmen either, so lets leave it at that.

James_W_0-1648799320333.png

(I keep looking for a dog - maybe you've just guided me to the correct breed for a programmer😂)


Jay, that sort of language has no place on this forum surely you should know! 😂

James




CLD; LabVIEW since 8.0, Currently have LabVIEW 2015 SP1, 2018SP1 & 2020 installed
Message 9 of 23
(2,962 Views)

Did you really post a reference to a pointer?

And you say I abuse the LabVIEW Forum!

😆🤣😂


"Should be" isn't "Is" -Jay
Message 10 of 23
(2,948 Views)