Sign in to follow this  
Guest

UI BUTTONS

Recommended Posts

Hi Fly!SimFriends,Is there someone here, who can tell me how to use buttons in a UI window ?There is no API feature like 'APIGetUIButtonState'. The only thing I found was 'DLLEventNotice' but I couldn't made it work...Thanks for the help,Laurent

Share this post


Link to post
Share on other sites
Help AVSIM continue to serve you!
Please donate today!

Hi Laurent,I was having the same sort of problem. The window gets created fine. You can do things to it (i.e., APISetUILabelText(), APIAddUIPopupItem(), etc., all work fine). Yet you never get callbacks to DLLEventNotice() for button presses and the like. It turns out that Fly! II has some interesting behaviors. For instance, if you call APICreateWindow2() passing an uninitialized SDLLObject pointer as the third parameter, Fly! II will happily create the window for you and consume all of that window's events. What you need to do is call APICreateDLLObject() just prior to calling APICreateWindow2(), as in...SDLLObject *notify = APICreateDLLObject();notify->dllObject = 0; // or a pointer to some useful structure.APICreateWindow2( '~tcA', "SimpleButton.win", notify );Just so long as notify points to a valid Fly! II DLLObject structure, you will get callbacks to DLLEventNotify().Hope this helps...Cheers, Tony

Share this post


Link to post
Share on other sites

Thanks Tony,I will try your solution...If I can get something I will send an example code...CheerLaurent

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this