Comments (7)
It seems to only happen with a columns widget. Pile widgets don't have this behavior. In a way, mouse hovering causing focus events is a nice feature, just inconsistent with the library. A separate mouse focus widget might be kind of cool.
I came up with a fix for the columns widget, but I don't know if it's the right way to approach it. What do you think of this?
On widgets/columns/columns.go line 300:
Original
if evm, ok := ev.(*tcell.EventMouse); ok {
My proposal
if evm, ok := ev.(*tcell.EventMouse); ok && evm.Buttons() != 0 {
from gowid.
Hang on, that proposed fix causes other issues with mouse clicks in columns. I'll see if I can work out a better solution.
from gowid.
Thanks :) I'll take a look at your examples this weekend
from gowid.
Hi @r-smith - could you try your example again with gowid updated to commit 30a0793? Let me know!
from gowid.
Err, I changed my mind 😕 Could you try the branch mousefocus
instead? I'm not 100% sure of these changes yet, though so far they seem well-behaved. I put them on a branch for a couple of days out of caution. You can make your app use this branch with something like this, assuming your example above is called myapp.go
:
mkdir myapp
mv myapp.go myapp/
cd myapp
go mod init myapp
export GO111MODULE=on
go get github.com/gcla/gowid@mousefocus
go run myapp.go
I think this also addresses issue #16.
from gowid.
I tried the mousefocus branch and it seems to work well. It fixes both issues I reported and so far I can't find any unwanted side effects. I think it looks good. Thanks for taking the time to look into this.
from gowid.
np, thanks for the bug report :) I'll close this now
from gowid.
Related Issues (20)
- When running hello world code: 30:22: undefined: text.TextContentSegment HOT 6
- Second example on gowid/docs/Tutorial.md doesn't compile HOT 1
- gowid.UrwidColor is invalid HOT 2
- How implement event 'lost focus' on IWidget? HOT 2
- gowid-terminal example hangs on DEL (xterm/vt220 backspace) HOT 3
- apps run slowly on weak systems when there's lots of mouse movement
- Create a new release HOT 3
- Some utf8 character widths were miscalculated in the terminal component HOT 4
- broken on go 1.15.2? HOT 3
- Release new version HOT 3
- How to implement this layout HOT 6
- Most of the images/screenshots in Widgets.md are missing HOT 1
- Application crashes - "integer divide by zero" HOT 4
- Terminal widget crashes: invalid memory address or nil pointer dereference HOT 1
- [Feature request] Handling mouse double-click in button widget HOT 3
- [Feature Request] Scroll support in terminal widget HOT 19
- [ QUESTION ] Update widget NOW HOT 2
- Application crashes sometimes in RedrawTerminal HOT 2
- Crash in RedrawTerminal: index out of range HOT 1
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 gowid.