In wNim, all controls are subclassed internally, so you are right, you can
**use all type of events(aka windows messages) in all type of controls**. For
example:
let button = Button(panel, label="Button")
button.WM_LBUTTONDOWN do (event: wEvent):
# do something.
event.skip() # if you don't skip it, no wEvent_Button will be generated.
Run
Hmm, in fact not every event/message. For example, you cannot connect to
WM_CREATE. Because you had already missed it when you got a button object.
Most useful windows message are already wrapped into wNim event type. But you
can deal with some low-level event by this skill. It also demonstrates in
examples/lowlevel.nim.
All codes about windows message/event handler are in the wWindow.nim.
wWndProc() is WndProc for wWindow object, wSubProc() is WndProc for subclassed
control object. They call processMessage() to generate the event object, and
then pass to processEvent(). The connected event handlers are invoked in
processEvent().