trixie wrote:
Yes, you are right. This is indeed stupid. EDIT: On the other hand, my testing suggests that manually closing the client window does not free the AMIGAGUIDECONTEXT, as allocated by OpenAmigaGuide(), so calling CloseAmigaGuide() actually does make sense here.
I had forgotten about my original post but I'm glad someone finally noticed it. You may be right about the freeing of AMIGAGUIDECONTEXT but I have to wonder about the fact that the context is returned even if there is an error.
Talking about AmigaGuide Library bugs and features - is it normal that OpenAmigaGuide() opens my client window just right, while OpenAmigaGuideAsync() opens nothing, despite me receiving an AmigaGuideMsg with agm_Type == ActiveToolID (indicating that the AmigaGuide asynchronous process has been started successfully)? The autodoc suggests, and existing code examples clearly show, that both functions should do the same, the only difference being the synchronous/asynchronous access. Is there a bug in the OS4 implementation of OpenAmigaGuideAsync() or what? I know that Tom Breeden has been struggling with this too, when working on his GuideMaker.
Since the individual who brought these issues to my attention at Amigans.net wanted to open an AmigaGuide at a
specified node from a shell or script, I wrote a command to accomplish his goal and uploaded the command to OS4Depot (OpenGuide). He also wanted to change nodes through ARexx but I discovered that there were actually 2 ARexx ports associated with the opened AmigaGuide. For example there would be GUIDE.1 and GUIDE.1.1 if you choose the name GUIDE for the ports. Some of the commands must be sent to the primary port and others to the secondary port. Here are the examples I included in the short docs for my OpenGuide command:
rx "ADDRESS OPENGUIDE.1.1;NEXT" (move to next node)
rx "ADDRESS OPENGUIDE.1.1;PREVIOUS" (move back one node)
rx "ADDRESS OPENGUIDE.1.1;RETRACE" (move to last viewed node)
rx "ADDRESS OPENGUIDE.1;LINK mylink" (move to specified node)
rx "ADDRESS OPENGUIDE.1;LINK main" (move to main node)
rx "ADDRESS OPENGUIDE.1;QUIT" (Close the AmigaGuide)
I don't know if there is a reason for having 2 ports or if it is a "bug". Either way, the asynchronous mode may need a command sent to a message port to actually open the window. You might try running Ranger to identify the ports that are opened in asynchronous mode. The autodocs seem to indicate that an AmigaGuide window will open in asynchronous mode but maybe some command may be required. Once again, is it a bug or inadequate documentation? If amigaguide datatype in Multiview worked as documented, we probably wouldn't need to use amigaguide.library. According to the amigaguide_dtc.doc autodoc the same ARexx commands I show in the above examples should work with an AmigaGuide in a Multiview window but they don't. Some work, some don't. Unfortunately, the most important command for program controlled documentation (i.e. LINK) doesn't seem to
work with Multiview.
What I also loathe is that the AmigaGuide Library uses internal values for the client window and doesn't allow customizing its dimensions and position. While in the olden days it was normal, even necessary to open an AmigaGuide window fully sized across the screen, with today's resolutions it lacks sense and only hinders access to the screen. Also, the window opens (vertically) in the middle of the screen bar, not just below it (as used to be the case in OS3) so it appears that the Top position is hardcoded with a value from OS3 times.
Actually there is a way to customize the client window but it is a user setting. If you open an AmigaGuide window with amigaguide.library, adjusting the window position & size and selecting the "Prefs/Save as defaults" menu item will save an environmental variable that specifies the window dimensions. The variable is set on a per screen basis. The Multiview variables are in a Multiview directory in ENVARC: and AmigaGuide variables are in an AmigaGuide directory in ENVARC: so the user may get different window dimensions depending on whether he opens a guide with Multiview or a program using amigaguide.library.