Re: Design question for a cross platform GUI (FLTK)

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

Ray Smith wrote:

> I have to make a decision as to how I will
> expose the classes and methods of FLTK.

I chose to make Win32Lib look a lot like Visual Basic because I think it VB
does a good job of hiding complexity from the end user. Other than having to
know about how to repaint a window, you don't need a lot of information
about the underlying toolkit.

The problem with this approach is that the wrappers are a bit more complex.
You end up having to do a bit of work behind the scenes to get things to
work, and this gets in the way of the 'power user'. A good example of this
is the font system - it's convenient for the end user, but not especially
efficient. If you're trying to emulate a rich text display that needs to
display a lot of fonts in a lot of styles, it's much more efficient to write
your own wrappers.

Other factors include the size of the toolkit, and how often it changes. If
you are autogenerating your wrappers with something like SWIG, it's much
simpler if you use the 'native' approach. You just create a wrapper
generator that, given a file of C++ function prototypes, spits out C
wrappers. Much less "hands on', an you can concentrate on other things. If
the toolkit is large, or has a nice API, this is the way to go.

-- David Cuny

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

Search



Quick Links

User menu

Not signed in.

Misc Menu