Re: cross platform GUI suggestions for Euphoria

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

Kenneth Rhodes wrote:


> Isn't WxWindows also in C++?

Yes. The issue with the C++ toolkits isn't that you can't write interfaces
to them - see my prior e-mail for details. The problem is when they rely on
extending virtual functions to add functionality (like Java's Swing does).

For example, imagine you had a PushButton class in a C++ library. The coder
was nice enough to create hooks to events, such as onPush:

   class PushButton {
   public:
      virtual onPush();
   }

If you want a pushbutton that prints "Hello" when you push it, you just
derive a new PushButton class:

   class HelloPushButton: public PushButton {
   public:
      onPush() { puts( "Hello, World!\n" ); }
   }

Wrapping something like this is a royal pain. It's possible, but you
basically have derive classes for the interfaces, and put hooks in them:

   class wrap_PushButton: public PushButton {
   public:
      onPush() { /* callback hook goes here */ };
      setOnPushHook( ... ) { /* set hook for onPush */ };
   }

Bleah!

In wxWindows, you have a top-level class called wxApp that needs hooks like
this. But you can create lower level objects and attach callback code to
them *without* having to go in hand manually adding the hook code. This
makes it a lot easier to work with than most C++ libraries (like V).

Plus, there are a number of languages (like wxPython) that have built
interfaces to wxWindows, so I know that it's possible to do so. That doesn't
mean that I personally have the skill to do it, however. The more I work on
this project, the more it feels like I'm treading water at best. sad

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu