'hide' attribute does not work on AROS RapaGUI

Report any Hollywood bugs here
Post Reply
ntromans
Posts: 69
Joined: Fri Jan 11, 2013 12:06 am

'hide' attribute does not work on AROS RapaGUI

Post by ntromans »

The 'hide' attribute does not work on AROS RApaGUI but does work on AROS MUIRoyale. So if you:

mui.set(button_id,"hide",TRUE)

this works fine but if you

moai.set(button_id,"hide",TRUE)

it returns with an error that attribute 'hide' is not recgnised (or words to that effect).

Cheers,
Nigel.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: 'hide' attribute does not work on AROS RapaGUI

Post by airsoftsoftwair »

This sounds like a bug in your script because RapaGUI should definitely not report "hide" as an unknown method for the button class and I don't see any way for it to do so which is why I suspect a bug on your side. To check my thesis, please post an MCVE :)
ntromans
Posts: 69
Joined: Fri Jan 11, 2013 12:06 am

Re: 'hide' attribute does not work on AROS RapaGUI

Post by ntromans »

Firsty, many apologies for the delay getting back to you on this.

To show the error, the gui code is:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application>
	<window title="Test Hide" id="MAIN">
		<vgroup>
			<button id="Hide" notify="pressed" >Press to hide button 2</button>			
			<button id="To_Hide">Button 2</button>			
		</vgroup>		
	</window>
</application>
(Saved as Test_Hide_GUI.xml)

MUI program:

Code: Select all

; program to test hide attribute
@REQUIRE "xml"
@REQUIRE "MUIroyale"
escapequit(TRUE)
mui.CreateGUI(FileToString("Test_Hide_GUI.xml"))

function p_hide(msg)

	mui.set("To_Hide","hide",TRUE)

endfunction

InstallEventHandler({MUIRoyale = p_hide})

Repeat
	WaitEvent  
Forever
MOAI program:

Code: Select all

; program to test hide attribute
@REQUIRE "xml"
@REQUIRE "RapaGUI"
escapequit(TRUE)
moai.Createapp(FileToString("Test_Hide_GUI.xml"))

function p_hide(msg)

	moai.set("To_Hide","hide",TRUE)

endfunction

InstallEventHandler({rapaguie = p_hide})

Repeat
	WaitEvent  
Forever
The programs show two buttons; pressing the top one should hide the bottom one. It works for MUI, not for MOAI, although oddly with this program an error message about the hide attribute is not given, it simply doesn't work.

Thanks,
Nigel.
ntromans
Posts: 69
Joined: Fri Jan 11, 2013 12:06 am

Re: 'hide' attribute does not work on AROS RapaGUI

Post by ntromans »

Sorry, obviously ignore the above with the stupid typo in installeventhandler. With this corrected it works, so why the error in my other program (which is way too large to post here)? I'll havew to test further.

Thanks,
Nigel,
ntromans
Posts: 69
Joined: Fri Jan 11, 2013 12:06 am

Re: 'hide' attribute does not work on AROS RapaGUI

Post by ntromans »

Found it - it's just if the button is in a toolbar. For MUI this works:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application>
	<window title="Test Hide" id="MAIN">
		<vgroup>
			<toolbar horiz="TRUE">	
				<button image="1" id="hide" notify="pressed">Hide</button>
  				<button image="2" id="to_hide">To_Hide</button>  
			</toolbar>
		</vgroup>
	</window>
</application>

Code: Select all

; program to test hide attribute

@REQUIRE "xml"
@REQUIRE "MUIroyale"

escapequit(TRUE)

loadbrush(1,"Pointer.ILBM")
loadbrush(2,"Bin.ILBM")
mui.CreateGUI(FileToString("Test_Hide_GUI.xml"))

function p_hide(msg)
	mui.set("To_Hide","hide",TRUE)
endfunction

InstallEventHandler({MUIRoyale = p_hide})

Repeat
	WaitEvent
Forever
Pressing the left button hides the right. (The images are just small ILBMs)

For MOAI this doesn't work, giving the error message that the hide attribute is not recognised:

Code: Select all

<?xml version="1.0" encoding="iso-8859-1"?>
<application>
	<window title="Test Hide" id="MAIN">
		<vgroup>
			<toolbar horiz="TRUE">
				<button icon="1" id="hide" notify="pressed">Hide</button>
  				<button icon="2" id="to_hide">To_Hide</button>
			</toolbar>
		</vgroup>
	</window>
</application>

Code: Select all

; program to test hide attribute

@REQUIRE "xml"
@REQUIRE "RapaGUI"

escapequit(TRUE)

loadbrush(1,"Pointer.ILBM")
loadbrush(2,"Bin.ILBM")
moai.Createapp(FileToString("Test_Hide_MOAI_GUI.xml"))

function p_hide(msg)
	moai.set("To_Hide","hide",TRUE)
endfunction

InstallEventHandler({rapagui = p_hide})

Repeat
	WaitEvent
Forever
Thanks,
Nigel.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: 'hide' attribute does not work on AROS RapaGUI

Post by airsoftsoftwair »

Ok, this is not a bug. As you can see in the docs, RapaGUI's Toolbarbutton class doesn't support the "Hide" attribute. That's why you get the error. It's not an AROS thing, it's just not supported on any platform.
ntromans
Posts: 69
Joined: Fri Jan 11, 2013 12:06 am

Re: 'hide' attribute does not work on AROS RapaGUI

Post by ntromans »

Thanks, I hadn't spotted that in the docs. I guess other systems don't support hide in a toolbar button.

I've a MUI program in which the functionality of tollbar buttons changes depending on the mode set and this is reflected by changing the button image through hiding and un-hiding and I was hoping to use basically the same program through MOAI on Windows, but I guess it's going to need a rather big re-work to allow that to happen. Is it possible to remove a button and re-attach one with a new image into a tolbar? I'll have to experiment.

Thanks,
Nigel.
User avatar
airsoftsoftwair
Posts: 5830
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: 'hide' attribute does not work on AROS RapaGUI

Post by airsoftsoftwair »

ntromans wrote: Mon May 12, 2025 1:57 pm Is it possible to remove a button and re-attach one with a new image into a tolbar? I'll have to experiment.
You could only try detaching and reattaching the whole toolbar but I'm not sure if that's going to work because on non-Amiga systems toolbars are some sort of special widgets that have all sorts of limitations when it comes to where they can be placed in a window etc. With MUI a toolbar is just a widget like all the others which is why they are very flexible. On other systems it's not like that I'm afraid.
Post Reply