Problem aligning an image within a label

Post Reply
User avatar
Akaya
Posts: 414
Joined: Thu Apr 19, 2012 1:36 am

Problem aligning an image within a label

Post by Akaya »

Came across this while browsing the Geyser manual:
http://wiki.mudlet.org/w/Manual:Geyser# ... in_a_label

Thought I'd give it a try and couldn't get it working the way I thought. The image appears fine but its tiled. Shouldn't the no-repeat in the stylesheet prevent this?
Code: [show] | [select all] lua
      gman["header_"..name[iter]] = Geyser.Label:new({
        name = "gman.header_"..name[iter],
      },gman["headerVBox"..i])
      gman["header_"..name[iter].."CSS"] = CSSMan.new([[
        background-image: url("]]..getMudletHomeDir():gsub("\\","/")..[[/CheckBox/checkbox_unticked.png");
        background-repeat: no-repeat; 
        background-position: top left; 
        background-origin: content;
      ]])
      gman["header_"..name[iter]]:setStyleSheet(
        gman["header_"..name[iter].."CSS"]:getCSS()
      )
Here's what it does:
Image

Am I doing something wrong?

Post Reply