mirror of
https://github.com/Insality/druid
synced 2025-06-27 10:27:48 +02:00
Fix init function in 03-styles.md
This commit is contained in:
parent
07101355c8
commit
9c37582f2b
@ -14,7 +14,7 @@ You can pass _nil_ or _empty_table_ to use default values for all components (no
|
|||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
local my_style = require("my.amazing.style")
|
local my_style = require("my.amazing.style")
|
||||||
|
|
||||||
local function init(self)
|
function init(self)
|
||||||
druid.set_default_style(my_style)
|
druid.set_default_style(my_style)
|
||||||
end
|
end
|
||||||
```
|
```
|
||||||
@ -24,7 +24,7 @@ Setup custom style to specific druid instance:
|
|||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
local my_style = require("my.amazing.style")
|
local my_style = require("my.amazing.style")
|
||||||
|
|
||||||
local function init(self)
|
function init(self)
|
||||||
-- This druid instance will be use my_style as default
|
-- This druid instance will be use my_style as default
|
||||||
self.druid = druid.new(self, my_style)
|
self.druid = druid.new(self, my_style)
|
||||||
end
|
end
|
||||||
@ -35,7 +35,7 @@ Change component style with _set_style_ function
|
|||||||
local druid = require("druid.druid")
|
local druid = require("druid.druid")
|
||||||
local my_style = require("my.amazing.style")
|
local my_style = require("my.amazing.style")
|
||||||
|
|
||||||
local function init(self)
|
function init(self)
|
||||||
self.druid = druid.new(self)
|
self.druid = druid.new(self)
|
||||||
self.button = self.druid:new_button("node", function() end)
|
self.button = self.druid:new_button("node", function() end)
|
||||||
-- Setup custom style for specific component
|
-- Setup custom style for specific component
|
||||||
|
Loading…
x
Reference in New Issue
Block a user