Notification when Amigaguide closed?

This forum is for general developer support questions.
User avatar
trixie
Posts: 410
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: Notification when Amigaguide closed?

Post by trixie »

@chris
ALL it needs to do is send a message to the existing msgport when the async OpenAmigaGuide call returns.
You mean that in the program's main loop you'd Wait() for the AmigaGuide signal, then GetAmigaGuideMsg() to check if you got the guide-was-closed signal, then act accordingly? Yes, that could work.
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
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Notification when Amigaguide closed?

Post by chris »

trixie wrote:@chris
ALL it needs to do is send a message to the existing msgport when the async OpenAmigaGuide call returns.
You mean that in the program's main loop you'd Wait() for the AmigaGuide signal, then GetAmigaGuideMsg() to check if you got the guide-was-closed signal, then act accordingly? Yes, that could work.
Exactly.
User avatar
trixie
Posts: 410
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: Notification when Amigaguide closed?

Post by trixie »

@chris

Well if it was for me, you'd have AmigaGuide sending your notification tomorrow :-) But under the circumstances, you'll have to contact Steven and ask for it. Still there's a good chance, unless it breaks things of course: I needed a special kind of message from the commodities.library, and it was implemented fairly quickly. The commodities update actually did break things but as the only software really affected was Exchange (third-party commodity managers used undocumented features, and were therefore illegal), the situation was easy to remedy.
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
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Notification when Amigaguide closed?

Post by xenic »

@chris
I think something is wrong with amigaguide.library. I found an AmigaGuide example called HyperApp.c on my OS3 developer CD and compiled it for OS4 (with a few changes). HyperApp.c waits for AmigaGuide messages and displays the type of messages received. Even though it checks for ShutdownMsgID, it doesn't show any shutdown message being received. If you have access to an OS3 Amiga, it might be interresting to see if HyperApp.c receives a shutdown message (ShutdownMsgID).
AmigaOne X1000 with 2GB memory - OS4.1 FE
User avatar
trixie
Posts: 410
Joined: Thu Jun 30, 2011 2:54 pm
Location: Czech Republic

Re: Notification when Amigaguide closed?

Post by trixie »

@xenic

I had a quick look at some other examples on the DevCD (aghelp.c and advaghelp.c, in the Orlando 1993 DevCon directory), and it indeed looks like "ShutdownMsgID" from libraries/amigaguide.h refers to a message sent to the AmigaGuide port. The code shows quite clearly that the program's input loop Wait()s on the AmigaGuide signal, then performs GetAmigaGuideMsg() and switch()es for the individual messages, ShutdownMsgID being one of them. So if the message doesn't arrive (as you say), it is likely that something's broken under the bonnet.
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
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Notification when Amigaguide closed?

Post by chris »

xenic wrote:@chris
I think something is wrong with amigaguide.library. I found an AmigaGuide example called HyperApp.c on my OS3 developer CD and compiled it for OS4 (with a few changes). HyperApp.c waits for AmigaGuide messages and displays the type of messages received. Even though it checks for ShutdownMsgID, it doesn't show any shutdown message being received. If you have access to an OS3 Amiga, it might be interresting to see if HyperApp.c receives a shutdown message (ShutdownMsgID).
I tried running it, and it doesn't display any messages. I think it needs compiling with the debug enabled. The other examples (advaghelp being the best looking one) have a similar problem, in that they only display errors after receiving the messages, they don't display reception of the message itself. It certainly appears that the ShutdownMsgID should be sent.

I don't have anything that can usefully compile this old code for 68k, at least not without reworking it, so that's as far as I can investigate for the moment.

(As an aside, there's some nice documentation about AmigaGuide, XRefs and Dynamic Nodes that I've not seen before, and a cool dynamic node example which displays running libraries and things inside an AmigaGuide)
xenic
Posts: 1185
Joined: Sun Jun 19, 2011 12:06 am

Re: Notification when Amigaguide closed?

Post by xenic »

chris wrote: I tried running it, and it doesn't display any messages. I think it needs compiling with the debug enabled. The other examples (advaghelp being the best looking one) have a similar problem, in that they only display errors after receiving the messages, they don't display reception of the message itself. It certainly appears that the ShutdownMsgID should be sent.
I just eliminated clib & pragmas includes, added proto includes for exec, graphics etc. & <string.h>. I replaced all the debug statements with printf() and compiled for OS4 with some defines to use obsolete Intuition stuff. When I ran the resulting binary from a shell, it just comfirmed that the shutdown message was not being received when the guide was closed.

Some time ago I uploaded a command called "OpenGuide" to OS4 depot at the request of another programmer. He wanted to be able to open and control AmigaGuide help from a script. The command opens an AmigaGuide that can be controlled (somewhat) with AmigaGuide ARexx commands. It opens an AmigaGuide synchronously and doesn't return until the guide is closed by the user. You could use similar code in a seperate process that signals your main program when the synchronous AmigaGuide returns after the user closes it.

When I wrote "OpenGuide" I also discovered that some of the AmigaGuide ARexx commands don't seem to work as documented. I only got them working by trial-and-error. I suspect that AmigaGuide library is a low priority for the OS4 devs, so I don't think we can expect fixes any time soon.
AmigaOne X1000 with 2GB memory - OS4.1 FE
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Notification when Amigaguide closed?

Post by chris »

Right, an update. I've compiled HyperApp for 68k with an extra printf in it so I can see the messages that are coming in.
There is no difference between OS4 and OS3.1 amigaguide.library wrt the messages that are sent - there are two:

Code: Select all

Message: 11007
Pressed the big gadget
Pressed the big gadget
Message: 11011
The first is sent on program startup, the second at some point after help is opened.

Furthermore, I replaced amigaguide.library v39 with amigaguide.library v34 from the old DevCon package. Still no shutdown message.

So, either this has never been implemented, it has been broken since forever, or that message has some other purpose. With no useful documentation in this regard, we can only go by the examples:

Code: Select all

	/* Shutdown message */
	    case ShutdownMsgID:
I think it's pretty clear that at the time the example was written, that message was intended to signify that the user had finished with the AmigaGuide session, so either nobody ever checked it actually worked, or it was never implemented. Only somebody with access to the source code will be able to tell us which it is.
User avatar
salass00
AmigaOS Core Developer
AmigaOS Core Developer
Posts: 530
Joined: Sat Jun 18, 2011 3:12 pm
Location: Finland
Contact:

Re: Notification when Amigaguide closed?

Post by salass00 »

chris wrote: I think it's pretty clear that at the time the example was written, that message was intended to signify that the user had finished with the AmigaGuide session, so either nobody ever checked it actually worked, or it was never implemented.
AFAICT it seems to be the latter, i.e. a feature that was never implemented.
chris
Posts: 562
Joined: Sat Jun 18, 2011 11:05 am
Contact:

Re: Notification when Amigaguide closed?

Post by chris »

salass00 wrote:
chris wrote: I think it's pretty clear that at the time the example was written, that message was intended to signify that the user had finished with the AmigaGuide session, so either nobody ever checked it actually worked, or it was never implemented.
AFAICT it seems to be the latter, i.e. a feature that was never implemented.
Does it look easy to add?
Post Reply