Jump to content

Xcontrol & register for events on first call


Recommended Posts

I'm trying to register for a Mouse Down? event on an element of an array which is on the FP of an xcontrol. I don't need this event to be dynamic, so I put it in a First Call case before the event structure in the facade. The event reg refnum is in an uninitialized shift register, so I expected this to work.

I'm not using the Init and Uninit abilities for this, but side from not unregistering the event, this seems like a simple way to do it. It works in development, but in a built exe the registered-for events aren't firing.

anyone know why this wouldnt work in an exe?

Link to comment

I'm trying to register for a Mouse Down? event on an element of an array which is on the FP of an xcontrol. I don't need this event to be dynamic, so I put it in a First Call case before the event structure in the facade. The event reg refnum is in an uninitialized shift register, so I expected this to work.

I'm not using the Init and Uninit abilities for this, but side from not unregistering the event, this seems like a simple way to do it. It works in development, but in a built exe the registered-for events aren't firing.

anyone know why this wouldnt work in an exe?

Is the event you are registering for on the front panel of the Xcontrol's Facade.vi?

why do you need to register for events in the first place?

~Jon

Link to comment

Is the event you are registering for on the front panel of the Xcontrol's Facade.vi?

why do you need to register for events in the first place?

~Jon

I'm registering for mouse events and a value change event on some controls that are in a cluster which is in an array on the facade FP. The standard events in the event structure don't give you access to array elements or their children, and registering works around this. It can be a convenient way to react to activity in an array. The ctlref data source in the event frame refers to the actual element, Mouse events will fire even on empty array elements, etc.

I think I have it working now that I moved the event registration refnum off the USR into the xcontrol's display state cluster, and added register and unregister code to the Init and Uninit abilities.

I'm still confused as to what was wrong with using either a USR or First Call here.

Link to comment

Aha! I read that dynamically registered events won't wake up an xcontrol's event structure (they'll enqueue the events but not process them). My solution here was to add a case "this vi:mouse enter" that does nothing, but will wake up the event structure.

(I'm thinking this was the problem all along, not a dev vs. exe issue.)

Link to comment

Join the conversation

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

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
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.