Jump to content

Xcontrol: get events into facade.vi


Wim

Recommended Posts

Hi Lava,

I've a problem with my xcontrol and hope you can help me.

My X-control is an array combined with a few buttons.

I want to use the mouse scroll wheel to scroll through the array.

I've made a 'Thread' that runs parallel and generates a user event when the user is scrolling. (Thread: while loop that polls the 'acquire data from device (=mouse))

I even detect if the mouse is on the xcontrol or not (mouse enter, mouse leave events in facade.vi)

When i open the FP of my Thread it does what it should be doing. Boolean is true when mouse is on array ... false when it leaves and I get the scroll value from the mouse.

But ....

I was hoping that LV will run the facade.vi when a user event is generated but it doesn't ...

it builds a buffer and when another event is called in the facade, my array starts dancing (buffer of user events)

What I do:

- create user event in init.vi

- register for events: first call of display state change in facade.vi

- generate user events in parallel thread (detect scrolling)

Sorry but i cannot attach the LV-code because of company policy.

I hope my problem is clear and that someone can give me some tips.

Thanks in advance.

Wim

Link to comment

All,

i have a work arround. ( Thx to my boss )

Now I take a reference to a 'scroll control' in my thread and I write through a prop node val(sgnl) to get a value change event in the facade.

However ... info on using user events is appreciated ;)

Link to comment
  • 2 weeks later...

I had exactly the same problem... :(

I wanted to send an event to a group of XControls.

I also had the idea tried to send a Value(sgnl) to my XControls to wake them up,

but these events were also forwarded to my toplevel event handler: It was flooded with events and caused the frontpanel to freeze...

So I ended up in not using custom events for this task. There are many things you can do with a control when

you have its control refnum without the need of sending events. For my XControl I had just to store the refnum

to the main control on the Facade FP and use it later for setting properties. Perhaps you can try a similar trick.

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
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.