Add options to AppDock context menu

This forum is for general developer support questions.
Post Reply
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Add options to AppDock context menu

Post by javierdlr »

Allready have the AppDock (using application_lib & RegisterApplication() ... ) icon (with only one default option 'Quit') and want to add a couple more of options to an AppDocky like on AmiUpdate.
Is there an "easy" way for such thing? Or do I have to add/link a Dummy_Docky.c (like TestApp.c app_lib example).

TIA
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Add options to AppDock context menu

Post by javierdlr »

Ok did some tests, but I don't know where
<code>
..Object *item1 = PopupMenuItemObject, ..
</code>
'PopupMenuItemObject' comes from, can someone enlight me?

Is there a way to add items to AppDock's contextmenu (not a Docky)? :-/

TIA
chris
Posts: 564
Joined: Sat Jun 18, 2011 12:05 pm
Contact:

Re: Add options to AppDock context menu

Post by chris »

javierdlr wrote:Ok did some tests, but I don't know where
<code>
..Object *item1 = PopupMenuItemObject, ..
</code>
'PopupMenuItemObject' comes from, can someone enlight me?

Is there a way to add items to AppDock's contextmenu (not a Docky)? :-/
PopupMenuObject is probably from popupmenu.class.

If you figure out how to do this please can you enlighten the world, as I'd like to know too!
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Add options to AppDock context menu

Post by javierdlr »

chris wrote:
javierdlr wrote:Ok did some tests, but I don't know where
<code>
..Object *item1 = PopupMenuItemObject, ..
</code>
'PopupMenuItemObject' comes from, can someone enlight me?

Is there a way to add items to AppDock's contextmenu (not a Docky)? :-/
PopupMenuObject is probably from popupmenu.class.

If you figure out how to do this please can you enlighten the world, as I'd like to know too!
Now I can add items to contextmenu of the DOCKY/APPDOCKY (not the APPLICATION dock/icon):
http://www.os4coding.net/forum/add-opti ... mment-1645
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Add options to AppDock context menu

Post by javierdlr »

Hi. Now I have contextmenu with some items :-)
But how to "interconnect" the DOCKY (seems it's a separated task/process) with my main (mixer) program/task/process?

Via Messages and Ports? (http://wiki.amigaos.net/index.php/Exec_ ... _and_Ports)

Does amidock/docky has some in-built function for such purpose?

My main problem now, from the AppDocky it works for rising/lowering/muting volume without problem, but to UNICONIFY mixer, it tries to create a new mixer instace, instead of uniconifying the already existing. Or maybe is some bad/missing code inside mixer? (I think this is the culprit)
User avatar
trixie
Posts: 411
Joined: Thu Jun 30, 2011 3:54 pm
Location: Czech Republic

Re: Add options to AppDock context menu

Post by trixie »

@javierdlr
But how to "interconnect" the DOCKY (seems it's a separated task/process) with my main (mixer) program/task/process? Via Messages and Ports?
- In Mixer, create a public named message port.

- Before the program goes into the main event loop, obtain the signal bit for this port:

Code: Select all

yourSigBit = 1 << yourPort->mp_SigBit;
- Add the signal bit to Mixer's signal mask:

Code: Select all

wsig = cxSigMask | SIGBREAKF_CTRL_C | appSigMask| (1<<replymp->mp_SigBit) | yourSigBit;
- In the docky, FindPort() the named public port created by Mixer. Send whatever you want to send it as part of the message structure.

- In Mixer, when a message arrives at the named port, copy whatever data is contained in the structure, and reply to the message. Then use the local copy of the data for whatever is your purpose.
The Rear Window blog

AmigaOne X5000 @ 2GHz / 4GB RAM / Radeon RX 560 / ESI Juli@ / AmigaOS 4.1 Final Edition
SAM440ep-flex @ 667MHz / 1GB RAM / Radeon 9250 / AmigaOS 4.1 Final Edition
User avatar
javierdlr
Beta Tester
Beta Tester
Posts: 389
Joined: Sun Jun 19, 2011 11:13 pm
Location: Donostia (GUIPUZCOA) - Spain
Contact:

Re: Add options to AppDock context menu

Post by javierdlr »

THX trixie, yes it works fine adding my own MsgPort. :-)
Post Reply