blawson Posted June 2, 2011 Report Share Posted June 2, 2011 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? Quote Link to comment
Jon Kokott Posted June 2, 2011 Report Share Posted June 2, 2011 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 Quote Link to comment
blawson Posted June 2, 2011 Author Report Share Posted June 2, 2011 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. Quote Link to comment
blawson Posted June 2, 2011 Author Report Share Posted June 2, 2011 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.) Quote Link to comment
blawson Posted June 3, 2011 Author Report Share Posted June 3, 2011 bah! I thought I had it right and then it stopped responding to one of two of the dynamic events, but only in the exe. I declared it a waste of time trying to get undocumented stuff to work and rewrote it without the dynamic events. Quote Link to comment
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.