Problem with Geyser.VBox

Post Reply
kkerwin1
Posts: 22
Joined: Tue Apr 20, 2010 7:37 am

Problem with Geyser.VBox

Post by kkerwin1 »

Hi. I'm having some difficulty with gui coding in Mudlet. Here's a picture of my problem:

Image

There's this inexplicable black gap between the pink sleep label, and the purple gauge below it. It's inside of a Geyser.VBox, which should expand automatically to fill the gap.

Here's my code:
Code: [show] | [select all] lua
left_mainContainer = Geyser.VBox:new({
	name="left_mainContainer",
	x=0, y=0,
	width="27.4%", height="100%",
})

local main = Geyser.Container:new({
	x=0,y=0,
	v_policy=Geyser.Fixed,
	height="38.3%",
	name="mapper container",
}, left_mainContainer)
 
local mapper = Geyser.Mapper:new({
  name = "mapper",
  x = 0, y = 0, -- edit here if you want to move it
  width = "100%", height = "100%"
}, main)

StatsBox = Geyser.VBox:new({
	name="StatsBox",
	v_policy=Geyser.Fixed,
	height="20%",
}, left_mainContainer)

container_oppTrack = Geyser.HBox:new({
	name = "container_oppTrack"
}, left_mainContainer)

oppTrackWindow = Geyser.MiniConsole:new({
	name = "OppTrackWindow",
}, container_oppTrack)

affBox = Geyser.VBox:new({
	name="AffBox",
}, container_oppTrack)

affBoxMembers = {}

function createAffBoxMember( number, affliction, bgColor, fgColor )
	hbox = Geyser.HBox:new(	{ name= affliction .. "Box" }, affBox)
	
	memberDictionary = {}
	memberDictionary["hbox"] = hbox
	memberDictionary["check"] = Geyser.Label:new({name=affliction .. "Check", h_stretch_factor=0.25, color="black",}, hbox)
	memberDictionary["checkBorder"]	= Geyser.Label:new({name= affliction .. "CheckBorder", h_policy=Geyser.Fixed, width=1,}, hbox)
	memberDictionary["textbox"] = Geyser.Label:new({name= affliction .. "Text",}, hbox)
	memberDictionary["selectBorder"] = Geyser.Label:new({name= affliction .. "SelectBorder", h_policy=Geyser.Fixed, width=1,}, hbox)
	memberDictionary["select"] = Geyser.Label:new({name= affliction .. "Select", h_stretch_factor=0.25, color="black",}, hbox)
	memberDictionary["bottomBorder"] = Geyser.Label:new({name= affliction .. "BottomBorder",v_policy=Geyser.Fixed, height=1, color="black",}, affBox)
	
	affBoxMembers[affliction] = memberDictionary
	
	memberDictionary["textbox"]:setColor(bgColor)
	memberDictionary["textbox"]:echo( tostring(number) .. ": " .. affliction:title(), fgColor)
end

createAffBoxMember( "1","paralyse","red","black" )
createAffBoxMember( "2","impatience","orange","black" )
createAffBoxMember( "3","asthma","dark_green","white" )
createAffBoxMember( "4","anorexia","purple","white" )
createAffBoxMember( "5","reckless","blue","white" )
createAffBoxMember( "6","stupid","orange","black" )
createAffBoxMember( "7","dizzy","orange","black" )
createAffBoxMember( "8","epilepsy","orange","black" )
createAffBoxMember( "9","weariness","dark_green","white" )
createAffBoxMember( "/","sensitivity","dark_green","white" )
createAffBoxMember( "*","clumsy","dark_green","white" )
createAffBoxMember( "0","manaleech","grey","black" )
createAffBoxMember( "+","slickness","grey","black" )
createAffBoxMember( "-","sleep","deep_pink","black" )

GGaugeOppMana = Geyser.Gauge:new({
	v_policy=Geyser.Fixed,
	height = 24,
	orientation = "horizontal",
		name="GGaugeOppMana",
		format = "b",
}, left_mainContainer)
Also, tried changing line #50 in the sample above from

memberDictionary["bottomBorder"] = Geyser.Label:new( { name= affliction .. "BottomBorder",v_policy=Geyser.Fixed, height=1, color="black", }, affBox)

to

memberDictionary["bottomBorder"] = Geyser.Label:new( { name= affliction .. "BottomBorder",v_policy=Geyser.Fixed, height=1, color="red", }, affBox)

in order to see if the black box would get entirely colored red. Instead, I just have a thin red line.

Thanks in advance!

User avatar
kevutian
Posts: 217
Joined: Fri Aug 20, 2010 8:18 pm
Location: United Kingdom
Contact:

Re: Problem with Geyser.VBox

Post by kevutian »

Make sure you draw all containers before any other element.

Post Reply