Intuition Menu Class

This forum is for general developer support questions.

Intuition Menu Class

Postby mritter0 » Sun Aug 30, 2015 12:37 am

I was going to update my project's menu from GadTools to Intuition Menu Class from this page
http://wiki.amigaos.net/wiki/Intuition_Menu_Class

I used the SDKBrowser to search for MA_Label to find what includes I need and what other tags exists. Couldn't find it. Manually looked for it. Nope. No Classes/menu.h or Intuition/menus.h.

Is this class still "alive"?
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 186
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: Intuition Menu Class

Postby ssolie » Sun Aug 30, 2015 5:55 am

It is coming in the next SDK... wait for it. ;)
AmigaOS Development Team Lead
Be authentic. Get AmigaOS.
User avatar
ssolie
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 1000
Joined: Mon Dec 20, 2010 9:51 pm
Location: Canada

Re: Intuition Menu Class

Postby mritter0 » Wed Sep 09, 2015 6:07 pm

I was ahead of the game; maybe still am.

With the new SDK I updated my menu. It builds fine, attaches fine, right click it shows the strip, locks up.

intuition.library 54.10.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 186
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: Intuition Menu Class

Postby broadblues » Wed Sep 09, 2015 7:33 pm

Any empty menus in that strip ?

There a bug in 54.10 where they will lock up. Fixed in 54.11 when that becomes available.

Otherwise I'm not sure what the issue might be, so can you post s me code you are using?

menuclass works fne in MultiViewer a part from that lockup I mention above when the scripts menu was empty, and I worked arround that by adding a load script item that was always there. (ie never an empty menu any more).

If your menus are dynamic and there a possibilty of them being empty you could arrange your code to hide any empty menus.

[aside] I'm very interested to know what you might be working on, the range and depeth of your codeing questions makes it seem quite an extensive project.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 504
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: Intuition Menu Class

Postby chris » Wed Sep 09, 2015 7:38 pm

mritter0 wrote:I was ahead of the game; maybe still am.

With the new SDK I updated my menu. It builds fine, attaches fine, right click it shows the strip, locks up.

intuition.library 54.10.


It definitely works... there are examples in the SDK Examples/GUI/MenuClass. Try comparing that to your code.

@ssolie

On the ContextMenu wiki article it says (my emphasis):
wiki wrote:Another significant difference between context menus and normal ones is that a context menu doesn't currently support keyboard shortcuts, as the same context menu can be tied to more than one GUI element, and no way is defined to decide which one of those element should hear the key press. (Intuition still displays the shortcut if you add it to an item, but it will be non-functional.)


This does not appear to be the case. If you define a shortcut with MA_Key, it doesn't show up in the context menu. Is this a bug, or is the article wrong?
chris
 
Posts: 550
Joined: Sat Jun 18, 2011 12:05 pm

Re: Intuition Menu Class

Postby mritter0 » Wed Sep 09, 2015 10:09 pm

It very well may be something I am doing. My menu is very large and customized. The new one I made is just the basic shell. I am still making both (GadTools and BOOPSI) but only IIntuition->SetMenuStrip(MainWindow,(struct Menu *)MenuStripObj); the new one.

All the customization code is still there and acting on the old menu, even though it isn't attached. That may be (probably) what is causing my problem. It doesn't crash at all until I right click for the menu. Only the top strip is shown, no items (at top of screen and vertical menu down in the window (pop up style)).

I am just a little reluctant to rip all the old code out until I got the basic new menu to work. I have to do it any way, just want to do it in small chunks so I know all is well.


@broadblues
I have been working on my project for 18 months. It is quite large. It is nearing time to get it out to some beta testers. Not ready to say what it is yet. Soon. ;)
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 186
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Re: Intuition Menu Class

Postby xenic » Wed Sep 09, 2015 10:22 pm

Disregard first paragraph. Solved. Duh.
When I saw this topic I decided to try adding some menus to one of my personal-use programs. I read the WIKI and added a "Project" menu with 2 menu items using the macro method for creating the menu object and added them using IIntuition->SetMenuStrip(). The menu is added but nothing happens when I select the menus. I added some printf output and my input loop is never receiving a WMHI_MENUPICK. When I click on one of the items in my listbrowser the menus that were previously selected and ignored are activated. It seems like Intuition doesn't generate a message for the menu selection but sends the WMHI_MENUPICK flag along with a message generated by another event (like selecting an item in the listbrowser. Is there something that needs to be done to get menu messages?

I didn't have WA_IDCMP, IDCMP_MENUPICK set in the window object creation. The program I added the menus to is really old and it didn't have any WA_IDCMP settings in the window object. The window close gadget message, iconify message and gadgetup messages work without setting any IDCMP flags in the window object. Why would those not be needed but setting a menu IDCMP flag is needed??
AmigaOne X1000 with 2GB memory - OS4.1 FE
xenic
 
Posts: 1087
Joined: Sun Jun 19, 2011 1:06 am

Re: Intuition Menu Class

Postby broadblues » Wed Sep 09, 2015 11:21 pm

I didn't have WA_IDCMP, IDCMP_MENUPICK set in the window object creation. The program I added the menus to is really old and it didn't have any WA_IDCMP settings in the window object. The window close gadget message, iconify message and gadgetup messages work without setting any IDCMP flags in the window object. Why would those not be needed but setting a menu IDCMP flag is needed??


window.class sets up a few IDCMP_#? that it needs but menus are optional so not automatically added.

If it were a plain intuition window, you would need to add all needed IDCMP youself.
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 504
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: Intuition Menu Class

Postby broadblues » Wed Sep 09, 2015 11:22 pm

Only the top strip is shown, no items (at top of screen and vertical menu down in the window (pop up style)).


Okay so your menus are empty, hence the lockup, that's presumabably not deliberate, unless your really taking small steps as you write the code, so will need some code to help further.

@broadblues
I have been working on my project for 18 months. It is quite large. It is nearing time to get it out to some beta testers. Not ready to say what it is yet. Soon. ;)


I'm guessing filemamanager / workbench replacement am I warm ? :-)
User avatar
broadblues
AmigaOS Core Developer
AmigaOS Core Developer
 
Posts: 504
Joined: Sat Jun 18, 2011 3:40 am
Location: Portsmouth, UK

Re: Intuition Menu Class

Postby mritter0 » Thu Sep 10, 2015 3:46 am

I "ripped out" some GadTools code to see if it would help......it did. Not sure why but it is working now. The two must have been fighting each other at some point, even though only one menu was attached to the window.

So, if you intend on upgrading to the new menu system, go all the way at first. Then build in your custom stuff after the menu is up and running.
Workbench Explorer - A better way to browse drawers
User avatar
mritter0
 
Posts: 186
Joined: Mon Aug 25, 2014 10:41 pm
Location: Bettendorf, IA, USA

Next

Return to General Developer Support

Who is online

Users browsing this forum: No registered users and 2 guests

cron