sydney Posted August 12, 2010 Report Share Posted August 12, 2010 I have a project with a producer-consumer pattern where the producer queues msgs to the consumer via an event structure and a msg queue. The consumer is also a FSM (state machine). I need to add a non-modal dialog box to the GUI so that I can recognize the events from the main GUI as well as the non-modal dialog box. I already have added modal dialog boxes which run OK, but, since they are modal, only the dialog box will receive events until I close the box. I also need to have the ability to hide or minimize the box while I work with the main GUI since I plan on this dialog box showing a list of items that the user will need to see while using the main GUI. If I bring up the non-modal dialog box in the producer event structure, I'll lock out all other events. If I do this in the consumer I'll run into other problems with the existing GUI. What I think I have to do is try to run this in another thread initiated from the event structure, but I have not yet figured out how to do this. I would love to hear some ideas on this one... In the meanwhile I'll be experimenting and checking the examples for more insight. Quote Link to comment
crossrulz Posted August 12, 2010 Report Share Posted August 12, 2010 The most simple way would probably make another consumer loop for showing your non-modal dialog boxes. Have another queue (or notifier) running around to tell the loop to run a certain window. You would be limited to one dialog box opening in the new consumer, but it is a quick and easy way to handle your issue. 1 Quote Link to comment
sydney Posted August 13, 2010 Author Report Share Posted August 13, 2010 That is an interesting suggestion! I will experiment with it this weekend. Silly me, I really just thought that the modal button was going to do all and completely forgot about handling the events........ Quote Link to comment
sydney Posted August 13, 2010 Author Report Share Posted August 13, 2010 I did some experimenting around and found the following things had to be done after using you separate loop/ msg queue idea. I had to make a custom VI that was neither modal or free floating since I wanted the minimize icon to be used. I also had to implement a 'Singleton' pattern idea even though I am not using OOP so that the button event to bring this up will only ever bring one VI up. Then I discovered that the 'look and feel' needed another fix up so that the button event would reopen the front panel via a property node when the event was generated and the VI was in minimized state. Works great! thanks for the pointer. 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.