Comments (11)
That would be an OnChecked(), but I haven't implemented that yet. I could...
(Are you on Windows, by the way?)
from ui.
I'm on Debian/GNOME. I didn't realize it wasn't implemented yet. My problem was that when I tried to access the Checkbox object, I only succeeded in accessing the Enabled bool from the DisplayAccounts struct. Is there a way to access the Checkbox (even though I can't get the method I'm looking for).
from ui.
Could you be a little more clear? When the user checks the checkbox, the structure itself is changed for you...
from ui.
I understand that ui.NewTable() creates a Checkbox from the Enabled bool in the DisplayAccount struct. What I don't understand is how, in the code, I access the "checked" or "unchecked" value of that Checkbox. I can use the Table's Selected() and OnSelected() methods to see when I particular row is selected, but I do not know how to determine if a Checkbox embedded in a row is checked.
from ui.
Oh! You acquire the RLock and examine the boolean field of the structure. The Table code changes that field's value for you.
from ui.
Ok, that makes sense. But if I want to call some function when that value changes, I probably need to start a goroutine to watch the bool for changes, right?
from ui.
No; I'll need to add an OnChecked() to Table. Will add soon (tomorrow?)
from ui.
Thanks for the explanation! Looking forward to having access to OnChecked(), but I'm not in a huge hurry -- I have plenty of other work to do before I need it too badly :)
from ui.
Just a quick update: once I finish the newctrl/ stuff I'm going to start doing a rewrite of Table on Windows to use an entirely custom control; once that's feature-complete I can add these features.
from ui.
I guess not
First the event system would need to be overhauled to allow passing the checked row and column in. But the current implementation of package ui is already being stretched too thin to be stable. I plan on redoing the backend a third (and hopefully) final time, so I'm not interested in doing any major changes to the backend just yet.
I could add these as methods to Table, but I'd rather not have too many API breaking changes at once. One other thing I want to do is switch to a more generic model interface-based system (with the current struct-based system as an implementation provided by package ui instead). I would need to figure out how this would work with that.
I still need to add this, but we'll see when...
from ui.
Replaced with andlabs/libui#310.
from ui.
Related Issues (20)
- 希望能加入菜单和居中功能,谢谢 HOT 5
- Twitching progress bar HOT 2
- use go module
- Can you create Window center func ? HOT 1
- 有2个问题需要帮助/Two questions ask for help HOT 3
- Add Linux/ARM64 support to ‘andlabs/ui’
- how to add a new row to a table?
- Open file dialog crashes HOT 1
- ld: library not found for -lstdc++ HOT 2
- How can we fix windows size ? HOT 2
- How to remove a row from table properly HOT 1
- Avoid cgo HOT 2
- Cross-compilation on Linux for Windows HOT 1
- System notification message
- Reopen a closed window
- Is this project still alive? HOT 2
- collect2.exe: error: ld returned 1 exit status
- Win10下gocv+andlabs/ui同时使用出现以下错误
- possible to use ui load a webview to load html/js/css or remote url as ui HOT 1
- 如何在ui中嵌入式一个浏览器窗口
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 ui.