Does anyone have a (preferably) small, tangible example of how to create and manipulate a simple docky? I am looking at the autodocs, and it is gibberish to me... Call me stupid (or lazy) ;).
I want to implement the QSystemTrayIcon stuff with dockys if possible.
You write a docky just like you'd write a standard Exec library. In your code you must implement certain specifically-named functions like DockyGet(), DockyProcess(), DockySet() etc. The docky manager (AmiDock) calls these functions when it needs to.
See the datetime.docky source code (on os4depot.net) to get started.
One shortage of the current docky system is that AmiDock only provides your docky with a rastport pointer to render data into the dock. You get no window pointer, which makes it impossible to build your docky interface from Intuition gadgets.
Ignore everybody else , if you're implementing QSystemTrayIcon then what you need is an "application docky". These are dead easy: 1. Open application.library. Note the interface is called "application" NOT "main". 2. Register your application using RegisterApplication() 3. Get the application.library port through GetApplicationsAttrs 4. Get events from that port in the usual fashion (the messages are detailed in the autodoc) 5. Unregister the application, close the library etc.
Set the icon type to APPICONT_Docky; but you'll need to create a real docky as well then. If it doesn't need to be truly active it is possible just to change the icon's imagery (I think you have to unreg/re-reg to get it to change though, so no good for frequent changes)
After looking a bit longer at the issue, several issues spring to mind:
1) Is it possible to add items to the app docky context menu without creating a compoletely new docky class? 2) How are context menus created? I don't see any contextmenu example in the SDK examples, but DOCKYGET_ContextMenu takes en Object * as data. What kind of Object are we talking about? 3) Well, that's mostly it...
So, I tried RegisterApplication, and after a few attemps (where apparently icon type ProgramIcon doesn't work without identification of the program file path), I managed to get an icon in the AmiDock. BUT when I try UnregisterApplication it hangs, and the appdocky is not removed. What am I missing? Do I need to call UnlockApplicationIcon or smth??
No idea about context menus, there are a few default options you can add (new document, quit, etc), not sure if this has changed since the SDK was last updated - it seems a bit overkill to have to write a full docky for that.
Now another question: Is it possible somehow to change the Icon, when using DOCKYRENDERTYPE_Icon?? I have tried with IApplication->SetApplicationAttrs(..., APPATTR_IconType, myappinfo, TAG_DONE), but it just removes my icon from the dock...