Why isn't this working. It makes the label but....

Post Reply
Desolation
Posts: 9
Joined: Sat Sep 25, 2010 5:47 pm

Why isn't this working. It makes the label but....

Post by Desolation »

It makes the label but it doesn't apply the style sheets... been working on my gui for 2 days now and it's given me the biggest headache ever
Code: [show] | [select all] lua
function GetRoomExits()
        roomexits = nil
        for i,v in pairs(gmcp.Room.Info.exits) do
                if not roomexits then
                        roomexits = string.upper(i)
                else
                        roomexits = roomexits..","..string.upper(i)
                end
        end
        roomexits = roomexits or "TRAPPED!"
roomlabel: setFgColor("red")        
roomlabel:echo("Exits - <br>" ..roomexits, nil, "c")
roomLabel.front:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #ADADAD, stop: 1 #9E9E9E);
    border-top: 1px black solid;
    border-left: 1px black solid;
    border-bottom: 1px black solid;
    border-radius: 7;
    padding: 3px;
]])
roomLabel.back:setStyleSheet([[background-color: QLinearGradient( x1: 0, y1: 0, x2: 0, y2: 1, stop: 0 #575757 stop: 1 #454545);
    border-width: 1px;
    border-color: black;
    border-style: solid;
    border-radius: 7;
    padding: 3px;
]])
end
 
 roomlabel = Geyser.Label:new({name="Room Exits",x=1200, y=410,width=150, height=30,})
 roomlabel : setFgColor("red")
 
registerAnonymousEventHandler("gmcp.Room.Info", "GetRoomExits")
Last edited by Oneymus on Mon May 26, 2014 3:15 am, edited 1 time in total.
Reason: Added Lua tags. Please, for the love of those helping you, format your code and use the tags.

User avatar
Angie
Posts: 51
Joined: Fri May 02, 2014 11:43 pm

Re: Why isn't this working. It makes the label but....

Post by Angie »

Two reasons I can think of - first, capitalization matters (roomLabel vs. roomlabel). Second, aren't the .front and .back styles only for gauges?
Angie @ Midnight Sun 2
Alayla @ God Wars 2

Post Reply