Re: C++/Tk
From: Sektor van Skijlen (ethouris_at_pl.spamu.lubie.nie.wp.invalid)
Date: 11/02/04
- Next message: Andreas Leitgeb: "Re: need help for an algorithm..."
- Previous message: ulis: "Re: need help for an algorithm..."
- In reply to: Maciej Sobczak: "C++/Tk"
- Next in thread: Maciej Sobczak: "Re: C++/Tk"
- Reply: Maciej Sobczak: "Re: C++/Tk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Tue, 2 Nov 2004 17:59:08 +0000 (UTC)
Dnia Tue, 02 Nov 2004 16:23:46 +0100, Maciej Sobczak skrobie:
> Hello,
> I'm pleased to announce the first release of the C++/Tk library:
> http://cpptk.sourceforge.net/
> This library is a C++ interface to the Tk GUI toolkit and uses some
> advanced coding techniques to achieve the syntactic similarity to Tcl/Tk.
> This library may of interest to those programmers who normally use
> Tcl/Tk to write front-ends to some C or C++ code.
> Thanks to C++/Tk, this kind of integration can be realised entirely in
> C++ code.
> Constructive criticism is welcome!
Great job! That was something that came to my mind some time ago, but looking
at solutions CppTk provides it looks much better. :)
Ok, so some notes from the first look :)
1. Access to each GUI object is through the text-based name. I don't think
this is a good approach in C++. It makes also all "object methods"
global functions or something - which again makes it - I think - hadrly
extensible. It would be good to provide some method to access objects through
pointer or reference; this way you would implement object methods as normal
C++ methods (yes, I know this would require static types for widget objects).
Or you found a better method for making the widget commands extensible (for
example, when I create my own widget class and I want to make it a command
that already exists).
2. What about using function objects (functional instances) instead of pointer
to function in, for example, "command"? Regarding that you already use boost,
I think it would be also nice to use boost::bind and signal-slot mechanisms.
3. I got a feeling that for some commands () are not required. For example,
tk_chooseColor could be used without ():
string newColor(tk_chooseColor -initialcolor("blue") -parent(".")
-title("select color"));
Here, tk_chooseColor could already be an object, for which operator "-"
accepts option objects etc.
I think it would be good also to have some additional Tcl facilities, like
splitting string into a list of words, also commands like split and join; they
would work with std::string and std::vector<std::string>.
Regards,
-- // _ ___ Michal "Sektor" Malecki <sektor(whirl)kis.p.lodz.pl> \\ L_ |/ `| /^\ ,() <ethourhs(O)wp.pl> // \_ |\ \/ \_/ /\ C++ bez cholesterolu: http://www.intercon.pl/~sektor/cbx "Java does not have pointers!"
- Next message: Andreas Leitgeb: "Re: need help for an algorithm..."
- Previous message: ulis: "Re: need help for an algorithm..."
- In reply to: Maciej Sobczak: "C++/Tk"
- Next in thread: Maciej Sobczak: "Re: C++/Tk"
- Reply: Maciej Sobczak: "Re: C++/Tk"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|