Jump to content

Want a programmatic way to trigger an event using only a VI reference

Recommended Posts

Hi all,

So I'm trying to create a general use UI framework. One of the things this framework can do is load VIs by file path into subpanels or dialogs, then switch the behavior of the launched VIs between subpanel and dialog.

If the VI is currently running as a dialog and is closed, then cleanup is easy: I use the "Panel Close" event.

But for the subpanel case, I don't know if there's a handy event ready like that. Any suggestions? I want the framework to be as generic as possible.

If I can't come up with a good solution I might just require that all subpanel VIs being run like this must be an Actor and simply use a Send Stop Msg.


Link to post
Share on other sites

I'm trying to create functionality similar to browser tabs. The main containing VI is a split pane with a tab control in the top pane and a subpanel in the bottom pane. If the user hits a "close" button for a given tab, I want to stop that VI's execution and (if it's currently being displayed) unload it from the subpanel.

I wanted the framework to be as flexible as possible, so even programmers unfamiliar with Actor Framework could use it to launch any VI into a tab simply by feeding in a path name or reference.

Basically I need a way for the VI to detect if it's "done." When it's been torn out of the Tab Container into a separate dialog, everything's fine. But when it's "x'd out" as a subpanel, then I don't know what option I have other than explicitly defining a reference for it (such as by launching it as an Actor and restricting the framework to only loading Actors).

Link to post
Share on other sites

I don’t think you can meaningfully get a generic system, beyond a straight “front-panel manager” thing that has no concept of anything beyond front panels.  You’ve already mentioned specific concepts like “launch” and “done” and assigned Panel Close to meaning some kind of “cleanup” is required.  Any implementation of that, however done, will make your framework non-generic.  I looked into the VIBox XControl that smithd linked to, and I could not use it because it has specific assumptions and implementations of “stoping” a VI.

My own Front Panels that go in subpanels-that-look-like-tabs are a mix of Messenger-Library actors, on the one hand, and subVIs with no internal loop on the other, so no system that assumes Front Panels be “launched” or “done” can ever be generic enough for me to use.

Now you COULD do a framework for "actors with one front panel each (not necessarily AF Actors)”.

Edited by drjdpowell
Link to post
Share on other sites
17 hours ago, smithd said:

Probably not that helpful but just in case you weren't aware of this, someone out there already made a decent looking tab xcontrol:


I swore off XControls because they don't play nicely with classes. I untangled one too many corruption issues from using an XControl with a class...

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.