[Gtk-sharp-list] Theming

Michael Hutchinson m.j.hutchinson at gmail.com
Wed Nov 11 18:57:09 EST 2009


On Tue, Nov 10, 2009 at 11:01 AM, Vladimir Giszpenc
<vladimir.giszpenc at gmail.com> wrote:
> After developing an app on Linux that targeted Linux, I oversold GTK's
> ability to run on Windows and Mac.  It runs but it looks very foreign.  The
> tubes say different things about how theming will/does work.  Is there a
> sample, tutorial or how to on getting my app to look a little more native on
> Windows [and the Mac]?  I thought a native theme would automagically get
> used but I was sadly disappointed.  My next assumption is that Gtk# will
> make this easy and painless.

Make an app appear fully "native" on all platforms isn't really
possible for any toolkit to do completely automatically, since all
platforms have unique aspects. If you want to fit in well, you're
going to need some platform-specific code in places. In MD we have a
platform abstraction and runtime checks to handle platform-specific
things.

That said, there's certainly a lot that GTK# could do to help, in the
form of platform API wrappers for thing like the Mac dock icon, Mac
app events, Mac main menu, Windows 7 jump lists, all platforms' native
file dialogs and recently-used- file lists, etc. It might make sense
to pull this sort of code out of apps like MD, banshee, tomboy etc,
and put it in re-usable libraries, maybe something like
Gtk.Platform.Windows, Gtk.Platform.Mac etc.

The default theme shipped with GTK# for Windows uses the Windows theme
engine to draw parts, and looks pretty good, so I'm not sure why
you're having problem with that. The Mac theme isn't so
native-looking, but we went with something that looked nice and
sort-of fitted in with the Mac colours.

-- 
Michael Hutchinson
http://mjhutchinson.com


More information about the Gtk-sharp-list mailing list