treilik / bubbleboxer

MIT License
64 stars 4 forks source link

Resizing of Bubbles #1

Closed zmnpl closed 2 years ago

zmnpl commented 2 years ago

Hi, I'm trying to understand how this library works and looked through the example. However when applying that to an application with "bubbles" I fail to understand how it works.

I understand that bubbleboxxer consumes the tea.WindowSizeMsg from the main application's Update function and passes the correct sub-size as new WindowSizeMsg recursively to each node and leaf via the leaf's own Update function. This is where I am stuck. Wouldn't that require the leaf (from bubbles library) to actually act on the WindowSizeMsg to work? Most of the "bubbles" don't look at the WindowSizeMsg and Since this is not guaranteed... How does it work? I am certainly missing something, but right now I am getting more confused the longer I look at it :)

See the list's Update function for example where WindowSizeMsg is not acted upon.

Hope my question is clear.

Best regards

zmnpl commented 2 years ago

Hm. Having tried now to implement an example I recognised that bubbles don’t satisfy the tea.Model Interface completely and therefore cannot be directly used as leaf.

So I guess the answer is to abstract bubbles further and implement own types which fulfil the Interface and embed a bubble (?) That way I can define the update function so that it applies the size and passes the message further down to the actual bubble.

amiright?

treilik commented 2 years ago

Hi, Yes that is exactly right! :)