GithubHelp home page GithubHelp logo

Comments (4)

meowgorithm avatar meowgorithm commented on May 20, 2024 4

Hi! Lip Gloss is strictly for rendering only. That said, it works wonderfully with Bubble Tea, a terminal user interface framework which features mouse support.

from lipgloss.

unikzforce avatar unikzforce commented on May 20, 2024 3

Wow, How cool is this ecosystem :) thanks man

from lipgloss.

 avatar commented on May 20, 2024

@meowgorithm I'm struggling with how to detect mouse clicks in a bounding box of something generated by Lipgloss. I believe it's not possible in Bubbletea's current state, but I'd love to be wrong about this:

Let's say you wanted to make those fancy tabs in the Lipgloss demo respond to clicks. You'd have to calculate the bounding box of each tab, but mouse events get passed through the Update method, while all of the Lipgloss work happens in the View method. I tried some unmentionable ugly hacks that break the functional nature of the Elm architecture for storing bounding boxes in the model that are computed during the View cycle, but clearly not a sustainable way to continue. The only other thing I can imagine is abstracting the view rendering code into a function that gets recomputed on both View and optionally Update when required, that attaches additional hitbox data to each cell to compare a mouse event with some identifier (some 3D games work this way).

Any suggestions or ideas?

from lipgloss.

meowgorithm avatar meowgorithm commented on May 20, 2024

@winduptoy Hi! I know exactly your plight, and you're correct that it's not an easy task at the moment. We're actually putting the finishing touches on updates for both Lip Gloss and Bubble Tea that will address exactly what you want to do here. I'll update this issue with progress, but expect a release soon.

(Related: charmbracelet/bubbletea#79)

from lipgloss.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.