LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I make text selection(Text.SelStart) be persistent across VI calls?

I have a string indicator that I want to programatically select portions of the text using the Text.SelStart and have it "remember" what the selection is.  The problem seems to be that this VI is not running a conventional loop, that is, the VI is called from inside a loop in another VI and so the KeyFocus, and therefore my SelStart are not persistent across calls.  Does anyone know how I can make this work or another method by which I can highlight a portion of the text in my string indicator and have it be persistent across calls to the VI?
0 Kudos
Message 1 of 5
(3,174 Views)
One way to do this is to save the values of interest before the VI finishes and save them to someplace convenient (like a custom key in the ini file). Then when the VI reopens, read the values back in and reset them. This technique can also be used to provide user-specific defaults.
 
Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 2 of 5
(3,170 Views)

Thanks for the input but I forgot to mention something which I believe is crucial.  The VI in question is not running but is displayed and visible to the user at all times for it contains subpanels that contain running VIs.  Now the string in question resides in this VI that is not running but is called periodically (only when needed).  What I'm trying to do is to highlight a portion of this string when the VI is called and leave it highlighted even when the VI is not running.  Is this posible?

-Mike

0 Kudos
Message 3 of 5
(3,162 Views)
Wait a minute, if the VI is not running, how is it showing other VI's in its subpanel?

Mike...

Certified Professional Instructor
Certified LabVIEW Architect
LabVIEW Champion

"... after all, He's not a tame lion..."

For help with grief and grieving.
0 Kudos
Message 4 of 5
(3,149 Views)
I'll try to explain the implementation; as to the why it works, I'm not a LabView expert so that's beyond me at this point.  A top-level VI calls my GUI vi to initialize it during which the GUI programatically starts and loads into subpanels other VIs which run on different threads.  The GUI finishes the initialization state and stops but the front panel is not closed.  At this point, the GUI VI front panel is displayed and shows the sub VIs running in the panels but itself not actually running.  
 
I have a manager vi, also initialized by the top-level VI mentioned above, that is running an event loop to capture hardware keypress events; it composes an operation from each event and calls the GUI VI with the new operation.  The GUI VI then can process the operation as needed and perform some work like navigating the subpanel VIs or opening an "editor" (this editor is where I need the text selection).  This is for an embedded system and there is no input that does not come through the manager VI's event loop.
 
 
-Mike
0 Kudos
Message 5 of 5
(3,140 Views)