Comments (6)
I could probably do this soon, sure. (Right now my Go bindings keep track of child controls and manually calls Destroy()
on them as well. Perhaps with this commit I wouldn't need to do that...?)
from libui.
This may also be a problem for a python wrapper..
from libui.
I have started along a similar venue, but that was getting way too complicated. An ondestroy handler seemed like a much simpler approach to me. As all control calls go through one function, this shouldn't be too hard.
from libui.
It should be per-widget. A global handler is not sufficiently flexible.
from libui.
This is wanted for my Rust bindings as well.
What I'm doing now as a workaround is (a) maintaining a list of windows; (b) leaking all controls until uiUninit()
is called, at which point I iterate over all the windows and destroy them; (c) having every method that calls into the FFI ensure that uiInit()
has been called and uiUninit()
has not been called. This essentially creates a weak reference semantics for controls, but it's one that leaks controls until the entire UI system has been shut down.
Another alternative to this approach would be to reference count controls. Effectively, this would make Control
objects have strong reference semantics instead of weak reference semantics (as in this proposal). In GTK and Cocoa, all controls are already reference counted anyway, so this doesn't add much overhead.
from libui.
Merged with #325.
from libui.
Related Issues (20)
- Timer example doesn't compile HOT 1
- Crashes in example 'test'
- .
- .
- Language agnostic documentation for libui? Tutorial?
- [Feature request] .move() the main window/widget in a cross-platform manner
- Setting Custom Fonts on Controls
- Another C++ binding HOT 4
- Where is the Tutorial? HOT 2
- Key Location
- How to constrain area redrawing to clip region? HOT 1
- Geometric Algorithms HOT 4
- Questions about the table
- Aggregate "TODO" list - or hopeful TODO listing as-is HOT 8
- What's the object ownership model? HOT 5
- Is someone updating this repo but in another github repo/profile? HOT 20
- Glimmer DSL for LibUI Wins Fukuoka Ruby 2022 Special Award HOT 2
- <NOTE> Active fork `libui-ng` HOT 4
- MSYS will drop Windows 7; find an alternative to it for MinGW-w64 HOT 2
- macos m2 build fail HOT 4
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 libui.