Skip to content

Commit 5f8cbc9

Browse files
committed
small docs fix
another small update for docus
1 parent 31cda3d commit 5f8cbc9

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

docs/objects/Frame.md

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ local basalt = require("basalt") -- we need basalt here
2424
local main = basalt.createFrame():setTheme({FrameBG = colors.lightGray, FrameFG = colors.black}) -- we change the default bg and fg color for frames
2525

2626
local sub = { -- here we create a table where we gonna add some frames
27-
main:addFrame():setPosition(1, 2):setSize("parent.w", "parent.h - 1"), -- obviously the first one should be shown on program start
28-
main:addFrame():setPosition(1, 2):setSize("parent.w", "parent.h - 1"):hide(),
29-
main:addFrame():setPosition(1, 2):setSize("parent.w", "parent.h - 1"):hide(),
27+
main:addFrame():setPosition(1, 2):setSize("{parent.w}", "{parent.h - 1}"), -- obviously the first one should be shown on program start
28+
main:addFrame():setPosition(1, 2):setSize("{parent.w}", "{parent.h - 1}"):hide(),
29+
main:addFrame():setPosition(1, 2):setSize("{parent.w}", "{parent.h - 1}"):hide(),
3030
}
3131

3232
local function openSubFrame(id) -- we create a function which switches the frame for us
@@ -39,7 +39,7 @@ local function openSubFrame(id) -- we create a function which switches the frame
3939
end
4040

4141
local menubar = main:addMenubar():setScrollable() -- we create a menubar in our main frame.
42-
:setSize("parent.w")
42+
:setSize("{parent.w}")
4343
:onChange(function(self, val)
4444
openSubFrame(self:getItemIndex()) -- here we open the sub frame based on the table index
4545
end)
@@ -71,15 +71,14 @@ This example illustrates how to create a sidebar with buttons that can be used t
7171
<details>
7272
<summary>Click here to show code</summary>
7373

74-
7574
```lua
7675
local basalt = require("basalt") -- we need basalt here
7776

7877
local main = basalt.createFrame():setTheme({FrameBG = colors.lightGray, FrameFG = colors.black})
7978

8079
--[[
8180
Here we create the sidebar, on focus it should change the position to parent.w - (self.w-1) which "opens the frame"
82-
when the focus gets lost we simply change the position to "parent.w"
81+
when the focus gets lost we simply change the position to "{parent.w}"
8382
As you can see we add :setZIndex(25) - this makes sure the sidebar frame is always more important than our normal sub frames.
8483
:setScrollable just makes the sidebar frame scrollable (in case you're adding more frames)
8584
]]

0 commit comments

Comments
 (0)