Re: [gtk-list] C++ Wrappers



Jay Painter wrote:
> 
> Here's a problem that I'm sure has been solved elegantly by someone.
> I've been porting some software (more like re-writing it) from Qt to GTK,
> and in the process I've played around with some basic C++ wrappers.
> Since GTK uses inhertance, I thought that the wrapper classes could be
> inherited also.  So the problem is how to initalize somthing like this.
> I can't make constructors virtual.  The first solution I thought of was
> to create a _GTKObject which is the object which is the base object which
> gets inherited by derived classes.  _GTKObject has a blank constructor,
> and the functional GTKObject would be created by inheriting _GTKObject
> and adding the proper constructer, which would contain the gtk_new_object
> call or whatever.
> 
This can be solved using templates, too lazy to type in the example,
just
pass a widget creation function as a class template parameter. This
sucks
big time though as I hate templates. BTW, someone said the code gets
very 
bloated by using templates. Not really. Of course the code gets
regenerated
for different template parameters, but there's no other way. The real
problem
is that g++ produces and links the same code for every template instance
with the same parameter in different compile units. Except for ELF
format,
where it places the code into a common section and duplicate code gets
eliminated
during link time. Argh, this is not a C++ list. Anyway, I would
volunteer to
do the C++ wrappers once my exams are over if someone cares for that. Or
we could unify forces with someone who's already doing it. Just please
make
the button label move as you press it!! Please please please. I see no
problem
with the way Windows does it, maybe it's not ABSOLUTELY realistic, but
it's
something most of us are used to and it does RELATIVELY look realistic.

> Also, I haven't noticed any Postscript printing ability with GTK.  Have I
> just missed it?
> 

That's kinda hard to do you know. I think it would be a good idea to
move on
with the technology and use the XPrint extension or R6.3 for that, that
makes
it _damn_ easy compared to "manual" PostScript creation. "Wanna print
from gtk -
get R6.3". Yeah, the right way to force people to move on.


BTW, what about a flashing cursor for line edit widgets? Use the
timeout, and
that's it. I know, I know "do it yourself". It's exams time, man...

Martynas

P.S. I'm glad I started a thread on dnd compatiblity. Arnt "the Troll"
noticed
it and notified the KDE folks and the JX folk, so maybe we'll al come up
with a good dnd protocol. I think the MIME stuf is very cool.

P.P.S. I'm very glad to see really fast development and good response.
COOL!
Also it's very cool that you guys take performance concerns seriously,
that's
not what most C++ guys do (Troll is definitely _not_ an example here).



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