discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Cocotron used for a real-world app


From: Christopher Armstrong
Subject: Re: Cocotron used for a real-world app
Date: Thu, 30 Oct 2008 11:07:52 +1100

Hi all

I thought I'd add my two cents :-)

On 30/10/2008, at 3:51 AM, discuss-gnustep-request@gnu.org wrote:

I agree that allowing for native-appearing GNUstep apps under Windows is a great idea... but I don't think that's doable in the context of a theme. Theming support is essential for GNUstep (obviously), but with Windows, I think we need to really be using native widgets. There are just so many ways that a Windows machine can be customized visually, that a theme will almost always feel out of place (not to mention what we make that GNUstep theme look like: XP or Vista or... something else). I have no idea how this would be done technically, but it's most certainly the best way to give the feel
of a truly native application.

I thought this had already been technically proven - we don't need to use native widgets. Instead, Microsoft provide the uxtheme library, which lets us *paint* different parts of the native widgets through a difficulty but powerful API. I've already shown this is possible in my themeing patches a year or two ago (sorry, I've had no time to work on this further). You basically hook the GNUstep drawing using the GNUstep themeing, and draw the elements of a Windows control with uxtheme where we would draw a GNUstep control. This is exactly the way java SWING and GTK+ draw their widgets, and I'm guessing toolkits like wxWidgets and Qt do exactly the same. We don't need to create pixmaps out of the Windows controls (nor should we). It provides the ability to draw all the Windows controls. Microsoft provide it so that applications can pseudo-subclass the standard Windows Controls and add their own customisations to them.

The uxtheme API only exists on Windows XP and Vista, and it only works for the Royale/Bubble look on XP and Glass look on Vista. The traditional Windows look on XP/Vista, and Windows 2000 require us to "imitate" the old Windows look. However, when I was doing my work, I didn't know about the DrawFrameControl API you showed below - somehow I completely missed it. It would be able to draw the Windows 2000 look for buttons, panels etc that I was painting by hand.

The only problem is that we need to allow access to the HDC that the backend uses to draw at the theme level, which is a violation of the layering in gnustep-gui / gnustep-back. I think we can compromise on this point without much problem :-)

Regards
Chris

-----
Christopher Armstrong
carmstrong@fastmail.com.au









reply via email to

[Prev in Thread] Current Thread [Next in Thread]