Find and access label by name?
Posted: Sun Nov 13, 2016 7:51 pm
I need to clean up a bunch of my gui code that's a total unreadable mess. Question:
Is there an existing function to return the geyser label based on the label name?
Example, my existing code:
gGroupStatusWindow = Geyser.Label:new({name="gGroupStatusWindow", x="0%", y="-1c", width="100%", height="1c",})
gGroupStatusWindow:setOnEnter( "closeNests" )
What i'd like to do is get rid of the gGroupStatusWindow variable, and only access that using the "gGroupStatusWindow" window name. Something so
gGroupStatusWindow:setOnEnter( "closeNests" )
could be replaced with something similar to
label:get("gGroupStatusWindow"):setOnEnter( "closeNests" )
(and yes, I need to rename a bunch of those also)
(edit)
Took a look at the instructions
Geyser.Label:getWindow(label) -- label is the name, the return value is the object
Is there an existing function to return the geyser label based on the label name?
Example, my existing code:
gGroupStatusWindow = Geyser.Label:new({name="gGroupStatusWindow", x="0%", y="-1c", width="100%", height="1c",})
gGroupStatusWindow:setOnEnter( "closeNests" )
What i'd like to do is get rid of the gGroupStatusWindow variable, and only access that using the "gGroupStatusWindow" window name. Something so
gGroupStatusWindow:setOnEnter( "closeNests" )
could be replaced with something similar to
label:get("gGroupStatusWindow"):setOnEnter( "closeNests" )
(and yes, I need to rename a bunch of those also)
(edit)
Took a look at the instructions
Geyser.Label:getWindow(label) -- label is the name, the return value is the object