MouseMove, MouseLeft

Discuss GUI programming with the RapaGUI plugin here
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

MouseMove, MouseLeft

Post 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?
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: MouseMove, MouseLeft

Post 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

Christos
User avatar
Redlion
Posts: 125
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

Re: MouseMove, MouseLeft

Post 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
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: MouseMove, MouseLeft

Post by plouf »

I write it under windows !!!
Maybe your texteditor cut off ; (up comma?)
Christos
Flinx
Posts: 342
Joined: Sun Feb 14, 2021 9:54 am
Location: Germany

Re: MouseMove, MouseLeft

Post 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.
User avatar
Redlion
Posts: 125
Joined: Sun Jul 10, 2011 5:05 am
Location: Perth, Western Australia

Re: MouseMove, MouseLeft

Post by Redlion »

@Plouf

Your right, I was using RapaGUI 2.1 did not notice the update to 2.2.
Cheers
Leo
----------------------------------------------------------------------------------------
Redlion
Sam460 Lite
A4000 A3000 A2000 A1200 A1000 A600 A500 CD32
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

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

Re: MouseMove, MouseLeft

Post 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
bitRocky
Posts: 148
Joined: Fri Nov 14, 2014 6:01 pm

Re: MouseMove, MouseLeft

Post 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.
plouf
Posts: 666
Joined: Sun Feb 04, 2018 11:51 pm
Location: Athens,Greece

Re: MouseMove, MouseLeft

Post 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
Christos
Post Reply