Thread Tools Display Modes
05-25-22, 01:56 PM   #1
onesock
A Murloc Raider
Join Date: May 2021
Posts: 6
Small help with AceGUI layout

I am trying to follow a simple example posted by the AceGUI author. I think I am missing something simple.
Ultimately I am trying to have an independent frame that contains large textbox that scales to size.

Code:
function CreateScrollFrame(widget, height)
    local scrollcontainer = AceGUI:Create("SimpleGroup") -- "InlineGroup" is also good
    scrollcontainer:SetFullWidth(true)
    if height then
        scrollcontainer:SetHeight(height)
    else
        scrollcontainer:SetFullHeight(true)
    end
    scrollcontainer:SetLayout("Fill")

    widget:AddChild(scrollcontainer)

    local scrollFrame = AceGUI:Create("ScrollFrame")
    scrollFrame:SetLayout("Flow")
    scrollcontainer:AddChild(scrollFrame)

    return scrollFrame
end

initImportGui = function ()
    local frame = AceGUI:Create("Frame")
    frame:SetWidth(500)
    frame:SetHeight(600)
    frame:SetTitle("Import/Export List")

    local scrollFrame = CreateScrollFrame(frame)
    
    local editBox = AceGUI:Create("MultiLineEditBox")
    editBox:DisableButton(true)
    editBox:SetLabel("")
    editBox:SetFullWidth(true)

    scrollFrame:AddChild(editBox)
    editBox:SetFullHeight(true)

    return frame
end
I commented out the actual editbox and the frame defined as "SimpleGroup" that has "SetFullHeight(true)" does not scale to the height of the containing frame. Any idea what I'm missing?
Attached Thumbnails
Click image for larger version

Name:	WowClassic_2022-05-25_15-53-31.png
Views:	92
Size:	451.0 KB
ID:	9734  
  Reply With Quote
05-25-22, 06:58 PM   #2
myrroddin
A Pyroguard Emberseer
 
myrroddin's Avatar
AddOn Author - Click to view addons
Join Date: Oct 2008
Posts: 1,240
Lua Code:
  1. widget:SetNumLines(integer)
  2. widget:SetRelativeWidth(1.0)

You can see how I did it by looking at lines 43-53 of Main.lua of TradeSkillMaster_StringConverter.
  Reply With Quote
05-27-22, 09:27 PM   #3
onesock
A Murloc Raider
Join Date: May 2021
Posts: 6
Thanks that helped to scale the editbox itself to 1:1 ratio for height. I was actually wondering if it could be automatically done or if I had to hook into the container's resize event. I found OnHeightSet digging into the codebase.

Thanks
  Reply With Quote

WoWInterface » Developer Discussions » Lua/XML Help » Small help with AceGUI layout

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off