Two possible Hyperlink bugs

Discuss GUI programming with the RapaGUI plugin here
Post Reply
User avatar
mrupp
Posts: 147
Joined: Sun Jan 31, 2021 7:44 pm
Location: Switzerland
Contact:

Two possible Hyperlink bugs

Post by mrupp »

I think I found two possible bugs with the Hyperlink widget. Please have a look at the following example:

Code: Select all

@REQUIRE "RapaGUI", {Link = True}
@APPTITLE "Hyperlink-Test"

Function p_EventFunc(msg)
	Switch(msg.ID)
	Case "btn1":
		Local text1$ = moai.Get("link1", "url")
		Local text2$ = moai.Get("link2", "url")
		moai.Set("link1", "url", text2$)
		moai.Set("link2", "url", text1$)
	Case "btn2":
		Local text1$ = moai.Get("link3", "url")
		Local text2$ = moai.Get("link4", "url")
		moai.Set("link3", "url", text2$)
		moai.Set("link3", "label", text2$)
		moai.Set("link4", "url", text1$)
		moai.Set("link4", "label", text1$)
	EndSwitch
EndFunction

InstallEventHandler({RapaGUI = p_EventFunc})

moai.CreateApp([[<?xml version="1.0" encoding="iso-8859-1"?>
<application id="app">
	<window id="mainWindow" width="300" title="Hyperlink-Test">
		<hgroup>
			<vgroup>
				<hyperlink id="link1">https://hollywood-mal.com</hyperlink>
				<hyperlink id="link2">http://amiga-news.de</hyperlink>
				<button id="btn1">Switch URLs</button>
				<rectangle />
			</vgroup>
			<vgroup>
				<hyperlink id="link3" label="https://hollywood-mal.com">https://hollywood-mal.com</hyperlink>
				<hyperlink id="link4" label="http://amiga-news.de">http://amiga-news.de</hyperlink>
				<button id="btn2">Switch URLs and Labels</button>
				<rectangle />
			</vgroup>
			<rectangle />
		</hgroup>
	</window>
</application>]])

Repeat
	 WaitEvent
Forever
The first button switches only the URL, the 2nd both URL and Label:

Starting the script:
Image Image

After clicking both buttons:
Image Image

After resizing the window for a bit:
Image Image

Result:
The links underneath have been correctly switched: clicking them opens the newly set URL.
Windows:
  • a Label that comes automatically from the URL is not updated, no matter what
  • after setting the Label by code, the widget is not properly resized (it is, though, after resizing the window)
MUI:
  • a Label that comes automatically from the URL is updated only after a resize of the window or moving the mouse over it, but not properly resized
  • after setting the Label by code, the widget is not properly resized no matter what
Cheers, Michael
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Two possible Hyperlink bugs

Post by airsoftsoftwair »

Thanks for the report, I’ll check.
User avatar
airsoftsoftwair
Posts: 5425
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: Two possible Hyperlink bugs

Post by airsoftsoftwair »

Code: Select all

- Fix [Windows/macOS/Linux]: Setting Hyperlink.URL didn't automatically update the label in case no custom label was set
The other two issues seem to be MUI and wxWidgets bugs, respectively.
Post Reply