Jump to page: 1 25  
Page
Thread overview
Could Tk be D's ideal widget set?
Oct 08, 2006
Mars
Oct 08, 2006
Hasan Aljudy
Oct 09, 2006
Jeff
Oct 09, 2006
Don Clugston
Oct 09, 2006
Walter Bright
[OT] Re: Could Tk be D's ideal widget set?
Oct 09, 2006
Kirk McDonald
Oct 09, 2006
Walter Bright
Oct 09, 2006
Mars
Oct 09, 2006
Josh Stern
Oct 09, 2006
Josh Stern
Oct 09, 2006
Josh Stern
Oct 10, 2006
Jeff
Oct 10, 2006
Josh Stern
Oct 10, 2006
Don Clugston
Oct 10, 2006
Sean Kelly
Oct 10, 2006
Josh Stern
Oct 11, 2006
Don Clugston
Oct 12, 2006
Bill Baxter
Oct 11, 2006
Fredrik Olsson
Oct 15, 2006
Georg Wrede
Oct 08, 2006
Mars
Oct 08, 2006
Mars
Oct 09, 2006
Mars
Oct 08, 2006
Hasan Aljudy
Oct 09, 2006
Josh Stern
Oct 09, 2006
Josh Stern
Oct 09, 2006
Josh Stern
Oct 10, 2006
Josh Stern
Oct 10, 2006
Josh Stern
Oct 10, 2006
Josh Stern
Oct 09, 2006
I.Lam
October 08, 2006
Hello,

It seems many people is trying to give D a decent widget set without
much success. However I'm wondering why nobody has tried with Tk. It
seems to have all the features that would make it an ideal widget set for D:

Cross platform: Windows, Mac, Unix/X11

Native look and feel, native widgets, support for themes. Screenshots:

http://tktable.sourceforge.net/tile/screenshots/windowsxp.html
http://installbase.sourceforge.net/screenshots.shtml
http://hem.fyristorg.com/matben/examples/index.html
http://tkabber.jabber.ru/screenshots/0.9.6

Written in plain C, not C++
http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.4/tcl/tk_9_contents.htm

Open source under an extremely permissive BSD license.

Complete, large number of widgets available.

Mature, well documented, several books available.
http://wiki.tcl.tk/

Several GUI builders available (no idea how well could they be integrated with D):
http://vtcl.sourceforge.net/ (free)
http://www.activestate.com/Products/ActiveTclProStudio/ (commercial)
others (?)

Actively developed. It's the default widget toolkit for Tcl and Python, and one of the best supported under Perl, which has two implementations, one that uses Tcl as a bridge (Tcl::Tk) and one that access the C API directly (Perl/Tk).

So... could Tk become D's GUI library of choice too? Or am I missing something?

More info: http://wiki.tcl.tk/477
October 08, 2006
(I assume that by "widget set" you actually mean "gui library")

I think a GUI for D should be written with D in mind from the start.
I didn't look at tk/tcl/whatever-it-is-called, but just when you say that it's written in C, this says to me it's not what D should adopt as an official gui library.

Having said that, I'm personally of the opinion that Harmonia is the GUI library that has the most potential.

Mars wrote:
> Hello,
> 
> It seems many people is trying to give D a decent widget set without
> much success. However I'm wondering why nobody has tried with Tk. It
> seems to have all the features that would make it an ideal widget set for D:
> 
> Cross platform: Windows, Mac, Unix/X11
> 
> Native look and feel, native widgets, support for themes. Screenshots:
> 
> http://tktable.sourceforge.net/tile/screenshots/windowsxp.html
> http://installbase.sourceforge.net/screenshots.shtml
> http://hem.fyristorg.com/matben/examples/index.html
> http://tkabber.jabber.ru/screenshots/0.9.6
> 
> Written in plain C, not C++
> http://aspn.activestate.com/ASPN/docs/ActiveTcl/8.4/tcl/tk_9_contents.htm
> 
> Open source under an extremely permissive BSD license.
> 
> Complete, large number of widgets available.
> 
> Mature, well documented, several books available.
> http://wiki.tcl.tk/
> 
> Several GUI builders available (no idea how well could they be integrated with D):
> http://vtcl.sourceforge.net/ (free)
> http://www.activestate.com/Products/ActiveTclProStudio/ (commercial)
> others (?)
> 
> Actively developed. It's the default widget toolkit for Tcl and Python, and one of the best supported under Perl, which has two implementations, one that uses Tcl as a bridge (Tcl::Tk) and one that access the C API directly (Perl/Tk).
> 
> So... could Tk become D's GUI library of choice too? Or am I missing something?
> 
> More info: http://wiki.tcl.tk/477
October 08, 2006
Mars wrote:

> It seems many people is trying to give D a decent widget set without
> much success. However I'm wondering why nobody has tried with Tk.

It used to be that much of the actual GUI still ran in Tcl, inside it...
Normally when I think of Tcl/Tk, I think of those horrible gray boxes.

I think it is more stand-alone these days, and it also seems prettier ?
Didn't see any high-level widgets like HTML or OpenGL containers, but.

> So... could Tk become D's GUI library of choice too? Or am I missing something?

An initial implementation, perhaps ?

Porting tcl.h/tk.h and a "Hello World" over to D, would be nice start.
(I think using embedded Tcl would be the simplest way to get started...)

http://www.algonet.se/~afb/d/tkhelloworld.c

This is what it looks like on Mac OS X, linking to Tcl/Tk frameworks:
(I used the "Wishkit" binary distribution, using libs would work too)

http://www.algonet.se/~afb/d/tkhelloworld.png


You could of course internalize the Tcl code into D (or Python or Perl),
but it would still look pretty similar from a high-level usage aspect...

http://www.algonet.se/~afb/d/tkhelloworld.py
http://www.algonet.se/~afb/d/tkhelloworld.pl


I prefer wx over tk myself, but having a little choice never hurts* ?
And as for the offical DMD library, that is already chosen to be DWT.

--anders

* Python also does both of tkInter and wxPython, for example.
October 08, 2006
> It used to be that much of the actual GUI still ran in Tcl, inside it...

Tk can be accessed both from Tcl (which is the usual thing to do) and from C, the canonical example of the latter being Perl/Tk. Embedding Tcl in another language is no big issue, Tcl is no more and no less than an ordinary C library. Embedding Tcl is not different than, for example, embedding SQL in a program written in D (or C++ or Java or whatever.)

The developers of Python, Ruby and Scheme have chosen the "let's link against the tcl library" route, but, as already noticed, it is also possible to call the C routines directly.


> I think it is more stand-alone these days, and it also seems prettier ?

Yes both seem true, and the upcoming v8.5 is focused on making it look even better. See the roadmap at http://wiki.tcl.tk/12753

Tk + The Tile rendering engine uses native widgets in Windows (including support for XP themes) and Mac OS X, the X11 version draws its own widgets in raw xlib following the Motif style, or a new, somewhat improved, look. There is also a project called TileQt that uses Qt as a backend, see http://www.ellogon.org/petasis/index.php?option=com_content&task=view&id=24&Itemid=40

> Didn't see any high-level widgets like HTML or OpenGL containers, but.

tkhtml: http://tkhtml.tcl.tk/
tcl3d: http://www.tcl3d.org/

I think the only reason these are not included as part of Tk itself is to keep the library lean and mean. There are several libraries of third-party widgets available for Tk, see http://wiki.tcl.tk/2352

> An initial implementation, perhaps ?

I'm just getting started with D and Tcl, this is a tad ambitious for me right now.

> And as for the offical DMD library, that is already chosen to be DWT. 

From what I've been reading its development has halted... Java/D developers seem to be scarcer than C/D ones.

October 08, 2006

Anders F Björklund wrote:
> And as for the offical DMD library, that is already chosen to be DWT.

Really? Last time I checked, DWT was a /candidate/ for an official GUI; if that has changed, can you point me to the post that announced DWT as /the/ official GUI library?
October 08, 2006
Hasan Aljudy wrote:

>> And as for the offical DMD library, that is already chosen to be DWT.
> 
> Really? Last time I checked, DWT was a /candidate/ for an official GUI; if that has changed, can you point me to the post that announced DWT as /the/ official GUI library?

Well, about the time that "digitalmars.D.dwt" newsgroup was founded ?
Something about DM putting all the wood behind one arrow, or something.

But neither tk nor wx are really candidates for a GUI written *in* D,
they are more about libraries that are usable *from* D. A difference.

Both DWT and FLTK were actual ports, rather than just simple wrappers.
And I think both of them ran into the "missing system headers" issue ?

i.e. in order to use the system headers, you need to convert these over
to D first (as D import modules), before you can actually use them...

--anders
October 08, 2006
Mars wrote:

>> Didn't see any high-level widgets like HTML or OpenGL containers, but.
> 
> tkhtml: http://tkhtml.tcl.tk/
> tcl3d: http://www.tcl3d.org/
> 
> I think the only reason these are not included as part of Tk itself is to keep the library lean and mean. There are several libraries of third-party widgets available for Tk, see http://wiki.tcl.tk/2352

Ah, must confess I didn't look too hard either - thanks for the links!

This doesn't look very much like the Tcl/Tk that grandfather used to do.
And 8.4 (Tcl/Tk) even comes pre-installed on Mac OS X 10.4 these days...

http://tcltkaqua.sourceforge.net/tiger

>> An initial implementation, perhaps ?
> 
> I'm just getting started with D and Tcl, this is a tad ambitious for me right now.

What I meant was that you probably need a proof-of-concept for D/Tk ?

I'll run the Tcl and Tk through my gc2d script, see how that works...
But all those custom macros (_ANSI_ARGS_, etc) might need some lovin'.

--anders
October 08, 2006
> What I meant was that you probably need a proof-of-concept for D/Tk ? I'll run the Tcl and Tk through my gc2d script, see how that works...
> But all those custom macros (_ANSI_ARGS_, etc) might need some lovin'. 

Someone did a proof-of-concept implementation for C++/Tk, maybe you'll find it useful: http://cpptk.sourceforge.net/

October 09, 2006
Porting either PyQt (including its semi-automatic generation from
Qt headers using he using gcc-xml) or QtJava (including its semi-automatic
generation using a Perl hack called Kalyptus) from either Python or Java
to D seems like a particularly sensible approach to me.   Object
orientation is definitely a good idea for widget sets and Qt itself is
object-oriented, full featured, cross platform, and well documented.






October 09, 2006
I think this one is not a proof-of-concept implementation but the real deal.

"As its core, KWWidgets is an object-oriented C++ layer on top of the Tcl/Tk UI toolkit. It uses the same coding framework and guidelines as VTK. It can interact and co-exist with Tcl/Tk directly from C++, allowing you to load or execute Tcl modules directly from a C++ application."

http://www.kwwidgets.org/Wiki/KWWidgets
« First   ‹ Prev
1 2 3 4 5