Re: XP Dialogs


Subject: Re: XP Dialogs
From: Michael D. Crawford (crawford@goingware.com)
Date: Sun Feb 11 2001 - 13:10:10 CST


> I'd be happy if we had a utopian world where you could code the
> dialog in XP land completely

Hi, Uh, I hate to pipe up with things like this as you might take it as a
criticism, but such things as completely cross-platform dialogs work just fine
in ZooLib:

http://zoolib.sourceforge.net

and it has platform-appropriate widget sets, so it looks like Mac on Mac and
Windows on Windows. On the Mac it uses the Appearance Manager if it's
available.

Don't take this as a suggestion that it would be easy to port to ZooLib, but
rather a proof by existence that such things as you wish for _can_ be done and
are available in open source form (ZooLib uses the MIT License, same as
XFree86's license).

Also see this application framework page, there might be something to learn from
other frameworks:

http://www.geocities.com/SiliconValley/Vista/7184/guitool.html

I wrote a commercial application of some substantial size on Mac OS and Windows
in ZooLib last year. I could switch my development effort from my Mac to my PC
as the urge took me. I don't think there were more than a few dozen lines of
platform specific client code in the whole thing, and most of those are either
for parsing pathnames or doing raw pixel manipulation in a "ZPixmap" and having
to handle the whacky upside-down windows bitmaps.

I know Mozilla gets a lot of heat for having written its own widget set, but
writing your own widget set doesn't necessarily equal a bloated program. Each
widget set that you may choose from in ZooLib takes about 40 KB of code space,
and I don't think that much data space (there are some hardcoded bitmaps for
checkboxes and radio buttons and the like).

It's just a matter of having a clue how to write efficient code, which I think
was lost on the Netscape engineers long before Mozilla was released as open
source.

From the zoolib-demo-binaries packages, two minimal ZooLib applications that
contain the majority of the framework in their executables, but not a lot of
client code, we have:

http://sourceforge.net/project/showfiles.php?group_id=5156&release_id=15399

ZHelloWorld: 299 to 717 kb
ButtonMessage: 262 to 682 kb

interestingly, Win32 has the smallest executable and BeOS x86 the largest, with
Linux x86 in between at about 480 kb for each. Note that there is quite a lot
more in the ZooLib framework than the widget set - there's the thread and mutex
classes, a BMP format decoder for reading GUI graphics, quite a rich pixmap
class and so on.

I found that I could work with a ZooLib application for a whole year and add
oodles of functionality while the overall executable grew very little. With
some work, you could probably reduce the executable size by making sure unneeded
features aren't inadvertently linked in.

By the way, I once hacked a complex Metrowerks CodeWarrior dialog into a custom
StandardGetFile on the Mac OS. I got it to work just fine in the end but
ultimately the client said that it was a mistake to have even tried. I did it
because the Windows version of the program I was rewriting for the Mac OS did it
that way with native windows widgets.

Mike

-- 
Michael D. Crawford
GoingWare Inc. - Expert Software Development and Consulting
http://www.goingware.com/
crawford@goingware.com

Tilting at Windmills for a Better Tomorrow.



This archive was generated by hypermail 2b25 : Sun Feb 11 2001 - 18:07:15 CST