Comments (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.
Wow, How cool is this ecosystem :) thanks man
from lipgloss.
@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.
@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)
- feat: flexbox HOT 6
- RTL languages messes the layout! HOT 2
- Span entire terminal width HOT 2
- feat: Better border joining
- No colors when running the example HOT 1
- is boder bug? HOT 2
- Ghost text being left behind when using `Height` HOT 1
- Example to toggle full screen? HOT 7
- random output of ANSI escape sequences with 0.7.1 HOT 11
- Setting `BorderTop(false)` disappears entire border HOT 3
- Unexpected artifacts from lg.JoinVertical
- Renderer-level style rules
- Middle string truncation
- Background style is not rendered when wrapping other rendered styles HOT 4
- TopRight and BottomRight border not showing when rendering an empty string and no left border HOT 1
- OSC 8 (hyperlink) supports. HOT 1
- String transform method
- style.go::Render at 'Render core text' is not ansi aware when using a spaced styler HOT 1
- Text alignment logic is backwards for non-special-cases
- Overlap views HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lipgloss.