JJgogo
JJgogo

Reputation: 41

How do win32 apps using sigc and glib implements Message loop

If an Win32 app has its UI designed using sigc and glibmm, how does it implement its message loops? does it still use win32 API such as GetMessage, DispatchMessage, TranslateMessage, etc? or they use other functions to finish this? And the default WinProc is still there?

Upvotes: 2

Views: 287

Answers (2)

Lothar
Lothar

Reputation: 13093

sigc+glibmm is the C++ level on top of the GTK C Framework callbacks/main loop which is on top of the native callback/main loop (NSRunLoop for MacOSX and GetMessage on Windows).

GetMessage must be called by every GUI application on Windows to get the absolute basics like a window handle, key presses and mouse movements.

TranslateMessage is not required because accelerator keys are handled with GTK's own implementation.

SendMessage is used very rare, most calls that require SendMessage are calls to a client control like a button or text field widget. In GTK they are implemented as GtkButton and GtkEntry and GTK can directly use the C implementation without going through the windows message dispatching.

Upvotes: 3

David Heffernan
David Heffernan

Reputation: 613461

All Windows GUI apps have to run a message pump based on GetMessage, TranslateMessage, DispatchMessage. Frameworks typically shield you from the implementation details, but somewhere in the framework will be a message pump.

The same is true for window procedures. Although you may never have to write one or interact with one, the framework will have to provide window procedures for top-level windows, and possibly for child windows depending on how the framework is implemented.

Upvotes: 2

Related Questions