[Mudlet] Clickable Buttons

edited December 2016 in Tech Support
Ok, so I'm trying to make an aff/def window on top of eachother. Using labels. So far I've gotten the first label to display but I don't seem to be able to get it to hide and switch with the other button when I click it. Where did I go wrong? Code:

function drawAffLabels()<br>affWindowLabel = Geyser.Label:new({<br>name = "affWindowShow",<br>x = 1, y = 1,<br>width = 75, height = 75,<br>bgColor = "black", fgColor = "white",<br>message = [[<center>Affs</center>]]<br>})<br>setLabelClickCallback("affWindowLabel")<br>end<br><br>function drawDefLabel()<br>defWindowLabel = Geyser.Label:new({<br>name = "defWindowHide",<br>x = 1+10, y = 1,<br>width = 10, height = 10,<br>bgColor = "black", fgColor = "white",<br>message = [[<center>Defs</center>]]<br>})<br>setLabelClickCallback("defWindowLabel")<br>end<br><br>function affWindowLabel()<br>affWindowLabel:hide()<br>defWindowLabel:show()<br>end<br><br>function defWindowLabel()<br>affWindowShow:show()<br>defWindowShow:hide()<br>end<br>

Comments

  • JonathinJonathin Retired in a hole.
    Put your callback after the label you want to be able to click and then use this format

    labelName:setClickCallback("stuff")
    I am retired and log into the forums maybe once every 2 months. It was a good 20 years, live your best lives, friends.
  • Woo got it! If anyone is wondering, and THANK YOU @Jonathin
     
    function drawAffLabel()<br>affWindowLabel_1 = Geyser.Label:new({<br>name = "affWindowShow",<br>x = 1, y = 1,<br>width = 75, height = 75,<br>bgColor = "black", fgColor = "white",<br>message = [[<center>Affs</center>]]<br>})<br>affWindowLabel_1:setClickCallback("affWindowLabel")<br>end<br><br>function drawDefLabel()<br>defWindowLabel_1 = Geyser.Label:new({<br>name = "defWindowHide",<br>x = 1+75, y = 1,<br>width = 75, height = 75,<br>bgColor = "black", fgColor = "white",<br>message = [[<center>Defs</center>]]<br>})<br>defWindowLabel_1:setClickCallback("defWindowLabel")<br>end<br><br>function affWindowLabel()<br>affWindowLabel_1:hide()<br>defWindowLabel_1:show()<br>end<br><br>function defWindowLabel()<br>defWindowLabel_1:hide()<br>affWindowLabel_1:show()<br>end<br>&nbsp;<br>

Sign In or Register to comment.