How to chain methods/functions

How would I chan methods/function like this:

thing = thing.new()

:print1()
:print2()

what exactly is the question here?

How would I chain methods like Topbar + does. What it dose is:

icon.new()

:setImage()
:setLabel()

I want to achive something like that.

icon.new():setImage():setLabel()

if you want this to work then return icon in each one

2 Likes

Thanks so much!!! I could never find this !!!

1 Like