Page 1 of 2

MouseMove, MouseLeft

Posted: Thu Apr 17, 2025 9:22 pm
by bitRocky
Hi

does anyone have an example using MouseMove, MouseLeft ?

The docs says its only supported for Image and ScrollCanvas.
I tried it with an Image object, but if I use notify="MouseMove", Hollywood says "Unknown notification "MouseMove"!

Is is not support under MorphOS RapaGUI?

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 2:18 am
by plouf
notify in RapaGui manual goes to XML attributes
EventHandler "gathers" them in generic "rapaGUI" event handler

try this example,

Code: Select all

@REQUIRE "RapaGUI",{link=True}
CreateBrush(1,200,200,#RED)

Function p_EventFunc(msg)
	Switch(msg.attribute)
		Case "MouseMove"
			moai.Set("result","text","Mouse X="..msg.x.." Mouse Y="..msg.y)
		Case "MouseLeft"
			moai.Set("result","text","MouseLeft")
	EndSwitch
EndFunction

moai.CreateApp([[
<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
	<window title="Image">
		<vgroup>
					<image id="image" brush="1" notify="mouseleft;mousemove"/>
					<textentry id="result">text</textentry>
		</vgroup>
	</window>
</application>
]])

InstallEventHandler({RapaGUI = p_EventFunc})

Repeat
	WaitEvent
Forever


Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 7:16 am
by Redlion
@ plouf

Your example works on my SAM460 but not with Windows.

I get an error "unknown notification mouseleft" inline 5.

Maybe an oversite, not included in all versions of RapaGUI.

Cheers
Leo

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 8:16 am
by plouf
I write it under windows !!!
Maybe your texteditor cut off ; (up comma?)

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 11:40 am
by Flinx
Redlion wrote: Fri Apr 18, 2025 7:16 am
Your example works on my SAM460 but not with Windows.

I get an error "unknown notification mouseleft" inline 5.
Maybe you don't have the current RapaGUI version? Try 2.2.

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 2:43 pm
by Redlion
@Plouf

Your right, I was using RapaGUI 2.1 did not notice the update to 2.2.
Cheers
Leo

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 5:48 pm
by bitRocky
Same here, didn't knew there is an update for RapaGUI!
Now with v2.2 this works!
Thanks!

Hmm, how about a Hollywood-Updater program to check, notify and install an update if there is something new?

Re: MouseMove, MouseLeft

Posted: Fri Apr 18, 2025 10:51 pm
by airsoftsoftwair
bitRocky wrote: Fri Apr 18, 2025 5:48 pm Same here, didn't knew there is an update for RapaGUI!
Make sure to subscribe to the newsletter to never miss an update again :)
bitRocky wrote: Fri Apr 18, 2025 5:48 pm Hmm, how about a Hollywood-Updater program to check, notify and install an update if there is something new?
Not as trivial as it looks, see here: viewtopic.php?p=21209#p21209

Re: MouseMove, MouseLeft

Posted: Fri Apr 25, 2025 8:39 pm
by bitRocky
Is it a bug that a MouseMove object only triggers when the mouse is over an object but not if it leaves an object?

Would be good if I could get a notify if the mouse is not anymore over an MouseMove object, maybe only one time with TriggerValue 0?

Because I use this MouseMove notify to display some infos of an object while the mouse is over such an object.
But I would also clear the info-object when the mouse is not anymore over an MouseMove object.

Re: MouseMove, MouseLeft

Posted: Fri Apr 25, 2025 11:17 pm
by plouf
Maybe a good idea to trigger with mouseleave or something
In rhe mean time activate mousecapture
https://hollywood-mal.com/docs/html/rap ... eMove.html

Then you can check if event happens inside your object by comparing mousepos vs objectpos