I made a simple application with a window and some buttons on it.
Attachment:
main.c.gz [1.26 KiB]
Downloaded 27 times
On my Debian Linux the button looks nice, but if compiled and ran on Windows 7, it is very simple (and "ugly").
I want to use
my own code for drawing the buttons. To do that, I connected a signal to the expose event.
In the event callback function, I draw a decorated rectangle and then call the "child" expose event:
Code:
// Calling the expose event of the button's child (in my case, label)
(*GTK_WIDGET_GET_CLASS(GTK_BIN(widget)->child)->expose_event)(GTK_BIN(widget)->child, event);
This works the same as this:
Code:
// Calling the expose event of a "container" class
(*GTK_WIDGET_CLASS(GTK_BIN_GET_CLASS(widget->parent))->expose_event)(widget, event);
Everything works, but there is a small difference:
On Linux, when the button is pressed down (when you
hold the mouse button), the
label moves to the left and bottom by 1px.
On
Windows it
stays still.
How can I make it consistent?
My idea was to
turn off (remove)
the theme (style). I think it would make the Linux version look like Windows version (with poor button syle), and the label would stay still in both systems.