| Store | Cart

Re: [TCLCORE] Tcl GSoC 2011 - Ideas anyone ? [Tk]

From: Andy Goth <andr...@gmail.com>
Wed, 23 Mar 2011 12:15:56 -0500
On 3/15/2011 8:45 PM, Kevin Walzer wrote:
> That's a key point> in Tk's favor--it's so easy to extend. Extending wxWidgets is a lot> harder, and I imagine that extending Qt would be even harder. That's> ultimately why I stay with Tk.

I have a lot of experience extending Qt, though it's been a year or two 
since I've done any Qt work.  Extending Qt requires C++ subclassing. 
Giving a widget behavior often requires subclassing (though signals and 
slots may work too, more on that later).  Making a dialog in Qt is like 
making a megawidget; subclass the QDialog or QWindow class (or whatever 
it's called) and put in code to create, configure, bind, and position 
the interior widgets.  There's a program called Designer that generates 
this code for you, though I prefer to do it by hand when management permits.

It's not quite as bad as you'd expect, since only a subset of C++ is 
used.  Exceptions are never used.  I don't recall virtual or diamond 
inheritance either.  Templates are rare.  In fact, I think the Qt 
approach to C++ is a good illustration of what's wrong with C++.  In 
many ways, it uses C++ in a manner that makes it more like C.  For 
example, the class definitions rarely contain private members; instead 
they contain what's called a "d pointer" that points to a separate 
structure containing the private stuff.  This is the C++ analog of C's 
incomplete structs.

So I've talked about using C++ to extend Qt.  But did you know that Qt 
extends C++?  It uses a mechanism called signals and slots to do event 
notification.  Slots are programmer-written functions that receive 
events as arguments.  Signals are MOC-generated functions that consult 
the connection tables and call all the currently connected slot 
functions.  Signal/slot connections are dynamically established using 
the connect() and disconnect() functions.  MOC is the Qt Meta-Object 
Compiler.  It scans your source code to find special Qt keywords such as 
signal and slot, which the C++ compiler ignores 'cuz they're #defined 
away, then generates code based on what it finds.

All this together made me wonder how to possibly make a Tcl binding for 
Qt.  Maybe there's some Tcl/C black magic that can take the place of the 
C++ subclassing and code generation required by Qt, but it's beyond me.

-- 
Andy Goth | <andrew.m.goth/at/gmail/dot/com>

------------------------------------------------------------------------------
Enable your software for Intel(R) Active Management Technology to meet the
growing manageability and security demands of your customers. Businesses
are taking advantage of Intel(R) vPro (TM) technology - will your software 
be a part of the solution? Download the Intel(R) Manageability Checker 
today! http://p.sf.net/sfu/intel-dev2devmar
_______________________________________________
Tcl-Core mailing list
Tcl-...@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tcl-core

Recent Messages in this Thread
Andreas Kupries Mar 10, 2011 10:52 pm
Larry McVoy Mar 11, 2011 01:15 am
Robert Mar 11, 2011 01:35 am
Kevin Walzer Mar 11, 2011 01:52 am
Larry McVoy Mar 11, 2011 02:12 am
sigzero Mar 11, 2011 02:22 am
Jeff Hobbs Mar 16, 2011 12:52 am
Damon Courtney Mar 16, 2011 01:07 am
Kevin Walzer Mar 16, 2011 01:45 am
Alexandre Ferrieux Mar 16, 2011 08:13 am
Gustaf Neumann Mar 16, 2011 10:57 am
Kevin Walzer Mar 16, 2011 02:25 pm
Larry McVoy Mar 17, 2011 01:21 am
Kevin Walzer Mar 17, 2011 02:15 am
Jeff Hobbs Mar 17, 2011 06:18 pm
Andy Goth Mar 23, 2011 05:15 pm
Larry McVoy Mar 23, 2011 06:03 pm
L.W...@surrey.ac.uk Mar 23, 2011 06:12 pm
Jeff Hobbs Mar 23, 2011 06:14 pm
Massimo Manghi Mar 24, 2011 08:43 am
Kevin Walzer Mar 24, 2011 01:51 pm
Adrian Robert Mar 23, 2011 09:18 am
Andreas Kupries Mar 23, 2011 04:37 pm
Larry McVoy Mar 23, 2011 04:47 pm
Adrian Robert Mar 26, 2011 10:48 am
Larry McVoy Mar 26, 2011 04:05 pm
Pat Thoyts Mar 26, 2011 10:05 pm
Twylite Mar 27, 2011 03:22 pm
Donal K. Fellows Mar 24, 2011 06:47 am
L.W...@surrey.ac.uk Mar 24, 2011 07:49 am
Kevin Walzer Mar 11, 2011 02:41 am
Larry McVoy Mar 11, 2011 02:49 am
L.W...@surrey.ac.uk Mar 11, 2011 11:03 am
Robert Mar 11, 2011 02:56 am
Larry McVoy Mar 11, 2011 04:07 am
Karl Lehenbauer Mar 11, 2011 05:37 am
Neil Madden Mar 11, 2011 06:59 am
Massimo Manghi Mar 11, 2011 10:45 am
Larry McVoy Mar 11, 2011 02:24 pm
Frédéric Bonnet Mar 14, 2011 10:43 pm
Jeff Hobbs Mar 16, 2011 12:45 am
jemptymethod Mar 12, 2011 12:44 am
Mark Roseman Mar 15, 2011 05:00 pm
Damon Courtney Mar 15, 2011 09:06 pm
Steve Landers Mar 15, 2011 10:54 pm
Jeff Hobbs Mar 16, 2011 12:16 am
Harald Oehlmann Mar 16, 2011 08:03 am
Arnulf Wiedemann Mar 16, 2011 10:14 am
Twylite Mar 11, 2011 07:37 am
Pat Thoyts Mar 13, 2011 10:25 pm
Thomas Perschak Mar 13, 2011 07:48 am
Arnulf Wiedemann Mar 13, 2011 03:52 pm
Will Duquette Mar 13, 2011 04:20 pm
Arnulf Wiedemann Mar 13, 2011 04:39 pm
Arjen Markus Mar 11, 2011 07:53 am
Andy Goth Mar 11, 2011 05:30 pm
Andreas Kupries Mar 11, 2011 05:29 pm
Joe English Mar 13, 2011 05:49 pm
Will Duquette Mar 13, 2011 08:51 pm
Messages in this thread