• DListView_Column:SetFixedWidth works the way I expect but not DListView_Column:SetWidth
    0 replies, posted
What's the deal with setting the width of columns in a DListView? Does the SetFixedWidth method differ from the SetWidth method in argument? I tried some shit but got no results. I am disappoint. [B]Edit:[/B] Some code for people wanting to see what I mean... [code]menu_frame = vgui.Create("DFrame") menu_frame:SetSize(menu_width, menu_height) menu_frame:Center() menu_frame:ParentToHUD() menu_frame:SetDraggable(false) menu_frame:SetTitle("Buy Menu") menu_frame:MakePopup() menu_list = vgui.Create("DListView", menu_frame) menu_list:StretchToParent(5, 30, 5, 30) menu_list:AddColumn("ID"):SetFixedWidth(25) -- get rid of Fixed to see GMod not do what I want menu_list:AddColumn("Name") menu_list:AddColumn("Price"):SetFixedWidth(45) -- get rid of Fixed to see GMod not do what I want menu_list:AddLine(1, "Gravity Gun", PRICE_PHYSCANNON) menu_list:AddLine(2, "9mm Pistol", PRICE_PISTOL) menu_list:AddLine(3, ".357 Magnum", PRICE_357) menu_list:AddLine(4, "SMG", PRICE_SMG1) menu_list:AddLine(5, "Pulse-rifle", PRICE_AR2) menu_list:AddLine(6, "Shotgun", PRICE_SHOTGUN) menu_list:AddLine(7, "Crossbow", PRICE_CROSSBOW) menu_list:AddLine(8, "Grenade", PRICE_GRENADE) menu_list:AddLine(9, "RPG", PRICE_RPG) menu_list:AddLine(1, "Gravity Gun", PRICE_PHYSCANNON) menu_list:AddLine(2, "9mm Pistol", PRICE_PISTOL) menu_list:AddLine(3, ".357 Magnum", PRICE_357) menu_list:AddLine(4, "SMG", PRICE_SMG1) menu_list:AddLine(5, "Pulse-rifle", PRICE_AR2) menu_list:AddLine(6, "Shotgun", PRICE_SHOTGUN) menu_list:AddLine(7, "Crossbow", PRICE_CROSSBOW) menu_list:AddLine(8, "Grenade", PRICE_GRENADE) menu_list:AddLine(9, "RPG", PRICE_RPG) menu_list:SetMultiSelect(false) [/code]
Sorry, you need to Log In to post a reply to this thread.