3 ms·
Just in case you can do that with Sciter already. In your CSS to define div.my { behavior:my-widget; } While loading HTML that contains <div class="my">
by c-smile 8y ago
Just in case you can do that with Sciter already.
In your CSS to define
div.my { behavior:my-widget; }
While loading HTML that contains <div class="my"> you will get SC_ATTACH_BEHAVIOR callback with the DOM event handler reference. By handling SC_ATTACH_BEHAVIOR you will return DOM event handler (a.k.a. behavior) - just a native function pointer that receives all DOM events on that element: mouse, keyboard, etc.
That's the same mechanism as HWND and WndProc but with lightweight DOM elements instead of Windows.
Example of such behavior that implements panels with tabs container: https://github.com/c-smile/sciter-sdk/blob/master/include/behaviors/behavior_tabs.cpp https://github.com/c-smile/sciter-sdk/blob/master/include/be...