Login
Username:

Password:

Remember me



Lost Password?

Register now!
Sections
Who's Online
59 user(s) are online (47 user(s) are browsing Forums)

Members: 0
Guests: 59

more...
Support us!
Recent OS4 Files
OS4Depot.net
Report message:*
 

Re: BOOPSI Menu Class: first update

Subject: Re: BOOPSI Menu Class: first update
by Chris on 2014/7/4 10:47:50

@trixie

If you do it via NewMenu you can do other funky stuff, like menu callbacks, which is probably what you want in a OO based system.

So, it should be - create menu, attach menu to window, the menu calls the hook functions and the user doesn't need to manually handle any menu events (other than writing the functions they call).

IIRC the UserData field is used to specify the hook function, but there's a second UserData field (which is called something else but can be used for user data) that can hold any useful data the user might want.

You could even do your own hook function which handles *all* menu items, and then pass that through to the application's callback with the userdata as one of the args.

(edit: the way I'm doing it is I'm holding my own data in the hook's data field, so the second userdatary field I'm thinking of must be to do with something other than menus)

(edit2: turns out the hooks are a window.class feature, so you might not be able to use them - I suppose it depends if you are tying the menu.class to window.class or allowing it to be used for standard Intuition windows too. WINDOW_MenuUserData, WGUD_HOOK)
Powered by XOOPS 2.0 © 2001-2016 The XOOPS Project