Notification from WB Icon

Discuss any general programming issues here
Post Reply
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Notification from WB Icon

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notification from WB Icon

Post by airsoftsoftwair »

You shouldn't use SetWBIcon() in a MUI program. When using MUI you should use Application.Icon instead.
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Notification from WB Icon

Post by NathanH »

Thanks, but that's unfortunate. Application.Icon doesn't have as good a feature set as SetWBIcon().

NathanH
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notification from WB Icon

Post by airsoftsoftwair »

What feature are you missing?
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Notification from WB Icon

Post 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
User avatar
airsoftsoftwair
Posts: 5433
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Notification from WB Icon

Post 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.
NathanH
Posts: 107
Joined: Sun Jul 05, 2015 1:29 am
Location: Caldwell, Idaho

Re: Notification from WB Icon

Post by NathanH »

Thanks
Post Reply