Register forum user name Search FAQ

Gammon Forum

Notice: Any messages purporting to come from this site telling you that your password has expired, or that you need to verify your details, confirm your email, resolve issues, making threats, or asking for money, are spam. We do not email users with any such messages. If you have lost your password you can obtain a new one by using the password reset link.
 Entire forum ➜ MUSHclient ➜ Bug reports ➜ WindowHotspotInfo returns nil for everything

WindowHotspotInfo returns nil for everything

It is now over 60 days since the last post. This thread is closed.     Refresh page


Posted by Darwin   USA  (125 posts)  Bio
Date Sat 09 Aug 2008 02:57 AM (UTC)
Message
I'm trying to get hotspot info so that it can be deleted and replaced/updated, however, WindowHotspotInfo returns nil for everything.
For this test case, the hotspot_id is "HoG_Who_Window:close" with the function who_close_mouseup defined as it's mouseup function.
function who_close_mouseup(flags, hotspot_id)

	Win, action = string.match(hotspot_id, "^([%a_]+):(%a+)")
	
	Note("--- Parse ID and Window Name:")
	Note("action="..action)
	Note("win="..Win)
	Note("hotspot_id="..hotspot_id)

	hotspots = WindowHotspotList(Win)
	
	Note("--- List of hotspots for ".. Win)
	if hotspots then
	  for _, v in ipairs (hotspots) do 
		Note (v) 
	  end
	end -- if any 

	Note("--- Information about the calling hotspot:")
	for i=1,12 do
		Note("WindowHotSpotInfo(\""..Win.."\", \""..hotspot_id.."\", "..i..") = "..tostring(WindowHotspotInfo(Win, hotspot_id, i)))
	end

end

When the hotspot is clicked (mouseup) this is the output:
--- Parse ID and Window Name:
action=close
win=HoG_Who_Window
hotspot_id=HoG_Who_Window:close
--- List of hotspots for HoG_Who_Window
Darwin
HoG_Who_Window:close
TestNewbieFour
TestNewbieThree
TestNewbieTwo
Testnewbieone
--- Information about the calling hotspot:
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 12) = nil

The hotspot_id is a concatenation of the windows's name, ":" and an action. The end result would be a window that will rollup/rolldown when the hotspot was clicked depending on the action.

WindowHotspotList does indeed list all the hotspots defined in the window. Currently most of these are created as hoverover spots to list information on a given character shown in the window.

I'm trying to retrieve the info about the hotspot about to be replaced so that the new hotspot with opposite action can be put in its place. It's not cooperating.
Top

Posted by Darwin   USA  (125 posts)  Bio
Date Reply #1 on Sat 09 Aug 2008 02:59 AM (UTC)

Amended on Sat 09 Aug 2008 03:01 AM (UTC) by Darwin

Message
I tried testing a little more to see if I could get info about the other listed hotspots.
I changed the mouseup function to this:
function who_close_mouseup(flags, hotspot_id)

	Win, action				= string.match(hotspot_id, "^([%a_]+):(%a+)")
	
	Note("--- Parse ID and Window Name:")
	Note("action="..action)
	Note("win="..Win)
	Note("hotspot_id="..hotspot_id)

	hotspots = WindowHotspotList(Win)
	
	Note("--- Info for all hotspots in ".. Win)
	if hotspots then
	  for _, v in ipairs (hotspots) do 
		Note (v) 
		for i=1,12 do
			Note("WindowHotspotInfo(\""..Win.."\", \""..v.."\", "..i..") = "..tostring(WindowHotspotInfo(Win, v, i)))
		end
	  end
	end -- if any 

end


And this was the output when it was called:
--- Parse ID and Window Name:
action=close
win=HoG_Who_Window
hotspot_id=HoG_Who_Window:close
--- Info for all hotspots in HoG_Who_Window
Darwin
WindowHotspotInfo("HoG_Who_Window", "Darwin", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "Darwin", 12) = nil
HoG_Who_Window:close
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "HoG_Who_Window:close", 12) = nil
TestNewbieFour
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieFour", 12) = nil
TestNewbieThree
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieThree", 12) = nil
TestNewbieTwo
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "TestNewbieTwo", 12) = nil
Testnewbieone
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 1) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 2) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 3) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 4) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 5) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 6) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 7) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 8) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 9) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 10) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 11) = nil
WindowHotspotInfo("HoG_Who_Window", "Testnewbieone", 12) = nil
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #2 on Sat 09 Aug 2008 05:02 AM (UTC)
Message
I confirm there is a bug in WindowHotspotInfo in version 4.35. Because of copying and pasting similar code for WindowFontInfo, it was internally looking up a font rather than a hotspot. I would wait for version 4.36 before using that function, you are lucky it didn't crash the client.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Darwin   USA  (125 posts)  Bio
Date Reply #3 on Sat 09 Aug 2008 05:09 AM (UTC)
Message
I've had worse happen. :)
Top

Posted by Nick Gammon   Australia  (23,102 posts)  Bio   Forum Administrator
Date Reply #4 on Sat 09 Aug 2008 05:15 AM (UTC)
Message
As a workaround, just make a helper function that saves all the hotspot info when you create it. The WindowHotspotInfo function really just returns the stuff you gave it earlier.

- Nick Gammon

www.gammon.com.au, www.mushclient.com
Top

Posted by Darwin   USA  (125 posts)  Bio
Date Reply #5 on Sat 09 Aug 2008 05:35 AM (UTC)
Message
I actually figured out a simpler way to go about it. Here's a link to a screen cap of the window rolled up and rolled down... the cursor didn't capture in the screen shot so try to imagine a hand cursor pointing to the little gray button in the upper right of the window.

http://i171.photobucket.com/albums/u302/bin_recycled/HoG_GUI_Who_Window_BOTH.png

Not included in the shots is that if you hover over a name it will show more detail for that character via a tooltip window.
Top

The dates and times for posts above are shown in Universal Co-ordinated Time (UTC).

To show them in your local time you can join the forum, and then set the 'time correction' field in your profile to the number of hours difference between your location and UTC time.


16,053 views.

It is now over 60 days since the last post. This thread is closed.     Refresh page

Go to topic:           Search the forum


[Go to top] top

Information and images on this site are licensed under the Creative Commons Attribution 3.0 Australia License unless stated otherwise.