Comments (4)
Sorry for the late response, I didn't see your issue until now.
As of the beta (the v2
branch), the only way to catch custom events is too create a custom control and handle the events in the base window proc. I really want add the option to easily wrap new system events,
but I can't decide the "best" way to do it.
from native-windows-gui.
How do I create a custom control? Is it worth figuring out how for v2
with v3
on the way?
from native-windows-gui.
I've just added an example on v2: https://github.com/gabdube/native-windows-gui/blob/v2/examples/custom.rs
There won't be a v3
. I had to rewrite the library once because I couldn't implement many features and a few controls (such as timer and menus). This time I made sure that will be able to pack all the fancy features I want to include without any major breaking change.
Edit: it might be worth it to mention that in v2
, the only difference between a custom control and a built-in control is some hardcoded events used internally by NWG (that might be removed)
from native-windows-gui.
v2 is now on master and it will be on cargo soon enough.
Also, there is now Event::Raw
implemented for most controls. Event::Raw
will catch every single Windows message (that are not reserved by NWG) and pass the MSG, WPARAM, LPARAM to the callbacks. Until custom events are implemented, this will be the "best" way.
Closing this...
from native-windows-gui.
Related Issues (20)
- The procedure entry point "GetWindowSubclass" could not be located HOT 1
- Add LVS_AUTOARRANGE to ListView flags
- Cannot set default extension in save dialog
- Async functions as event handlers don't work as expected
- Missing column index parameter for `ListView::column_width()`
- System Tray does NOT disappear on console exit
- Dynamically edit existing menu items HOT 1
- Allow adding icon to Menu and MenuItem HOT 5
- Layout-insensitive menu key accelerators (working with non-latin layouts)
- Attaching a tooltip to a menuitem
- Accept PathBuf as source_file type
- Bitmap builder fails with loading BITMAP embedded images (works with a file.bmp) HOT 3
- Allow seting WS_CAPTION on window creation
- Shouldn't AnimationTimer reset on multiple starts prevent any ticks?
- Align size types for imageframe and its builder
- Window's set_position doesn't seem to take dpi scaling into account
- How to remove padding for a single ImageFrame in a single popup Window
- Avoid GDI DC exhaustion from calling DPI
- Set tray notification duration
- Register global hotkey
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 native-windows-gui.