[Mono-list] OT: GTK+ on windows

Jaroslaw Kowalski jarek@atm.com.pl
Fri, 10 Jan 2003 07:53:59 +0100


Exactly. This approach gives you the "look", not the "feel" of Windows. At
least it looks like the menus in this theme are painted correctly.

One theoretical question to gtk+ win32 aware programmers (gurus, please
verify it):

Under Windows, GTK obviously uses window handles (HWND) to manage its
output. Simply because there's no other way to do it under Win32.
A standard method for creating windows and controls (like buttons, etc.) is
to do:

CreateWindow(windowClass, windowTitle, style, x,y,cx,cy, parentWindow,
menuBar, instance, parameter);

I was wondering if GTK could ever be capable of maintaining a list of
win32-managed child windows (i.e. windows created with (style & WS_CHILD)
and parentWindow pointing to GTK frame window) and make them act as
first-class GTK controls. They would have the following properties:

1. They should get events and signals like all standard GTK widgets do
2. They should move and scale along with their parent window
3. They should paint themselves using standard Win32 provided methods
(WM_PAINT message handled inside their windows procedure).
4. They should totally cover whatever is beneath them (i.e. no transparency)

I'm not gtk api guy, but for example by looking at "gtk/gtkbutton.h" I find
that there's nothing in GTK that cannot be done with (possibly subclassed)
standard Win32 BUTTON control.

STUPID IDEA: Under Win32 it should be possible to modify "gtk_button_new*()"
functions and to just add Win32 control to the "native hierarchy" instead
off adding GTK-drawn control to the hierarchy of widgets.

I have similar ideas for dealing with menus and scrollbars. It might be
possible to use other native lightweight controls like "edit", "checkbox",
etc.

Other than this concern (and perhaps some annoying flicker issues that could
be easily avoided using double-buffering), I find GTK a great idea, and the
fact that it is C, not C++ makes it even better since we have C# and all the
great stuff.

Can anybody verify my ideas?

Jarek

----- Original Message -----
From: "Carl R. Witty" <cwitty@newtonlabs.com>
To: "Guenther Roith" <groith@tcrz.net>
Cc: "Jaroslaw Kowalski" <jarek@atm.com.pl>; "Daniel Morgan"
<danmorg@sc.rr.com>; <mono-list@ximian.com>; <gtk-sharp-list@ximian.com>
Sent: Friday, January 10, 2003 1:54 AM
Subject: Re: [Mono-list] OT: GTK+ on windows


> groith@tcrz.net (Guenther Roith) writes:
>
> > Hello!
> >
> > There is a theme available, that makes use of the native windows
widgets.
> > Really impressive!!!!
> >
> > http://neugierig.org/software/gtk/nativewin/
>
> Note that this is the exact opposite of what Jaroslaw wanted.  He
> wanted to use Windows widgets with the Gtk+ drawing routines (to be
> sure to duplicate the Windows feel, with the Gtk+ look).  As far as I
> can tell, the above link uses the Gtk+ widgets with the Windows
> drawing routines.
>
> Carl Witty
>
> _______________________________________________
> Mono-list maillist  -  Mono-list@ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-list
>