Re: Lin32Lib?

new topic     » goto parent     » topic index » view thread      » older message » newer message

Irv Mullins wrote:

> That leaves GTK, which is written in C, and
> is fairly high level with a reasonable set of
> widgets. Unfortunately, no one has wrapped it
> for Euphoria. Dave Cuny made a try, but if he
> was unsuccessful, there's no point in me even
> trying. ;)

Actually, the reason I dropped it had little to do with being able to wrap
GTK. It was more that I ran into conceptual difficulties with resolving
paint issues between Win32Lib and GTK. I'll give more details on that if
people are interested. The gist is that Windows lets you draw anywhere on
the window that you want, while GTK doesn't - you are only really allowed to
draw on canvas objects, or you end up resorting to writing directly in XLib.

I ended up trying to develop a module for SWIG to help wrap stuff like GTK
and wxWindows, but I was having major problems with BCC of my machine. I
eventually took a break from the whole thing and started working on another
project, and never got back to wrapping GTK.

If anyone is interested, I still have the tools I used to parse the files in
order to generate the files. They work OK, but require a *lot* of hand
editing of the results. I think that if went the other way around and
scrubbed the GTK include files so the parser didn't have to contend with
every obscure bit of C syntax known to man, you'd be much more successful.

Be warned that there are a *lot* of GTK include files - the more people you
have helping you on the task, the better!

In addition, if instead of directly converting the wrappers from C to
Euphoria, you generated a C file that in turn generated the Euphoria
wrappers, you'd have a much easier time building the zillions of constants
that you would need. In fact, the best approach would probably be just that:
write one program to wrap the functions, and another to generate constants
and structures.

At the time that I had written my wrappers, you still had to resort to
working with structures quite a lot - for example, just to set colors.
Hopefully, there are a lot more helper functions available that make this
unnecessary.

GTK is a great toolkit, and (as mentioned), one of the few that is written
in C. It is possible to wrap C++ libraries (such as wxWindows), but there's
a bit more hassle involved.

I've also looked at EzGTK, and it's pretty neat as well. But if you are
trying for a Win32Lib approach to things, you'll probably want to use a
bulletin-board sort of widget manager instead of the defaults provided but
EzGTK.

While GTKLib is a great idea, I don't think that it will ever be more than
50% compatible with Win32Lib. There's just too much Win32 specific stuff in
Win32Lib for that to happen. Still, I think that the general Win32Lib
framework (since it's based on VB) is fairly platform independant, and would
serve you well.

I'll be glad to answer any more questions!

-- David Cuny

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu