Page 1 of 1

Notification from WB Icon

Posted: Fri May 26, 2023 10:47 pm
by NathanH
Hi,

When my program is run it places a special icon on the Workbench using SetWBIcon(). I'm using MUIRoyale with a Hollywood gadget within the display. I want to open the MUI window when the WBIcon is double-clicked and close the MUI window when the close button is pressed. I thought that double-clicking the WBIcon would send a ShowWindow event so this would be easy. Unfortunately, if you run the following code and double-click the WBIcon you'll see that you get no notification. I've worked a couple of days now on this using multiple displays (like a 1x1 white pixel in the menu bar) and such but to no avail so far. How do I get notified when the WBIcon is double-clicked? Thanks.

NathanH

Code: Select all

@DISPLAY {Hidden=True}

SetWBIcon(#AMIGAICON_SHOW)

Function p_EventFunc(msg)
	Switch msg.Action
		Case "HideWindow":
			DebugPrint("HideWindow")
		Case "ShowWindow":
			DebugPrint("ShowWindow")
	EndSwitch
EndFunction
			
InstallEventHandler({ShowWindow=p_EventFunc, HideWindow=p_EventFunc})

Repeat
     WaitEvent
Forever

Re: Notification from WB Icon

Posted: Sun May 28, 2023 8:54 pm
by airsoftsoftwair
You shouldn't use SetWBIcon() in a MUI program. When using MUI you should use Application.Icon instead.

Re: Notification from WB Icon

Posted: Mon May 29, 2023 10:36 pm
by NathanH
Thanks, but that's unfortunate. Application.Icon doesn't have as good a feature set as SetWBIcon().

NathanH

Re: Notification from WB Icon

Posted: Sun Jun 04, 2023 11:30 am
by airsoftsoftwair
What feature are you missing?

Re: Notification from WB Icon

Posted: Wed Jun 07, 2023 12:39 am
by NathanH
Hi,

From what I can tell MUIRoyale's Application.Icon for MUI 3.8 doesn't allow mui.Set() to set an icon programmatically (it is I; set at creation time), doesn't allow changing the name under the icon, and doesn't allow it to be permanently displayed; it is only present when the app is iconified. SetWBIcon() allows all of these things.

NathanH

Re: Notification from WB Icon

Posted: Tue Jun 13, 2023 8:54 pm
by airsoftsoftwair
Oh, actually, this seems to be a Hollywood bug. I've just seen that your MCVE doesn't use MUI Royale at all but still it doesn't work. It only works if the display is not hidden initially but as soon as you set "Hidden" to TRUE the events won't come through. That's definitely a Hollywood bug. Will be fixed.

Re: Notification from WB Icon

Posted: Wed Jun 14, 2023 1:54 am
by NathanH
Thanks

Re: Notification from WB Icon

Posted: Mon Jul 22, 2024 9:01 pm
by airsoftsoftwair

Code: Select all

- Fix [Amiga]: When using an initially hidden display with an app icon, the display didn't receive the
  "ShowWindow" event when clicking the app icon installed by SetWBIcon()