So, is NexTk a next generation exploration of Tk ? Just trying to understand what it actually is. I don't have a machine available to try the code right now.
It's a next generation implementation of Tk. -GPS
NexTk is available with a massive collection of code here: http://code.google.com/p/megapkg/
Steps to get it running (albeit with a silly demo at the moment):
You can also try the NexTk_image_viewer.vfs that uses ntk (it's only a few days old). After running the previous steps do:
(Corrected Oct 4, 2007)
C'est la vie
I regret to some extent getting involved with Tcl and Tk years ago.
RLH Why would you say something like that?
George, I understand your frustration. However, note that little attention to anything related to Tcl/Tk 9 has been given, to date. Right now, the focus has been Tcl/Tk 8.5 (and probably 8.6).
Hang in there - hang onto the code. I suspect that, once 8.6 is out, attention will begin to turn towards 9.x series.
George Peter Staplin 2007.09.20 : I plan to do that. Thank you. NexTk is alive, and I'm working on improve Tcl again, and especially extending it for amazing graphical capabilities.
KJN 2007.09.20 : Are the Enlightenment E17 libraries of any use? They are BSD licensed, and do 2D graphics with transparency and animation. The Enlightenment live CD has some good demos, but the best item is not switched on by default (you have to search for it) - an animated taskbar like the one in OS X.
George Peter Staplin 2007.09.20 : Hi KJN, are the Enlightenment libraries portable? I've been working the last week or 2 on a new Tcl extension called ntk in megapkg. It provides Win32, X11, and hopefully in the future Mac OS X compatibility. More on ntk below (under NEWS).
I haven't tried to build and run Evas with any of these engines, so I don't know how complete they are - but it is clear that the project is actively developing backends for several different platforms.
George Peter Staplin 2006.07.11 : As the Tcl/Tk core team is taking their time with Tk 8.5, I've been working on my own Tk9 for a few months. (Now named NexTk) It implements a window system using Tcl, and some C extensions from megapkg (megaimage, megaimagetk, structure). It has full support for alpha transparency in any widget. You can rotate windows, and every color in Tk9 consists of [list R G B A].
Features so far include (from megaimage):
George Peter Staplin 2007.11.06 : The NexTk_image_viewer now uses the ntk_panedwindow widget. The panedwindow widget is new and supports -orient horizontal and vertical. The scrollbar has had a lot of polishing done.
Some other new widgets are ntk_checkbox and ntk_spinbox. They are pretty much complete, and work well.
The text widget is now using some ideas from Zarutian. He suggested separating the data from the metadata. I think it's cleaner this way, and much easier to program. I'm slowly improving the text widget, as its design evolves.
I took input from KBK on the listbox widget, and added a 3D appearance to the listbox. I updated the image viewer screenshot below.
I found a way to reduce the memory requirements by almost a third, by reducing the temporary buffers used in rendertree.tcl. One thing to keep in mind is that NexTk in combination with ntk keeps most of the buffers that Tk would use, on the client side. It may seem at times like NexTk is using more memory than a typical app, but that's because, Pixmap and Window buffers in X11 are stored on the server side with most toolkits.
I have some ideas for improving the speed of tclTimer.c that will probably be implemented soon and I hope make it into 8.6.
apw is working a lot on ntkWidget. I've tried some of his demos, and they work. He's been spending a lot of time on OpenGL ideas. He has taken a thing called GLFW and added multiple window support, and other features, to enable working with megaimages. Based on what we've talked about FBOs or frame buffer objects are in the future. He also wrote a cool script for his tclGL that translates the OpenGL API from header files to Tcl commands.
I'm also working occasionally on glimage, which is meant to have a higher level API and not look so much like OpenGL.
Slow, but steady progress. I'm not going to burn out.
Here's a screenshot of NexTk's panedwindow, checkbutton, button, label, and spinbox:
George Peter Staplin 2007.10.16 : Well, we now have the NexTk image viewer working quite well. It views JPEG and PNG images, and supports drag scrolling of large images.
The listbox has had a lot of changes, as well as the scrollbar since the last update. I've also been working a lot on ntk. The ntk_listbox and ntk_scrollbar now do proper scrolling in all of the cases of the image viewer. Left to add are page-relative scrolling (if desired), I'm still not sure. We also need to theme the scrollbar sliders. At the moment they are just rectangles.
apw has been doing a lot of work on his version of NexTk based on mine. We're working together to improve the future Tks.
I've been also working on megaimage3d, and structure. I made ntk display its first window in NT 4, and it works in XP as well. The Over and Out game has been reimplemented. It's now much cleaner/simpler.
Here's a screenshot of the image viewer:
George Peter Staplin 2007.09.27 : Some of the NexTk extensions helped power the 2007 Tcl Conference! Yay! megaimage has some new features that rmax requested. The extensions used were megaimage, jpegext2, and freetypeext.
I've done a lot of work on the freetypeext recently, and ntk.
Ntk is moving along. I now have it displaying megaimages in X11, calling Tcl-side callbacks on buttonpress, buttonrelease, keypress, motion, and configure events, redrawing automatically on Expose, and more. I have a TODO setup for anyone that wants to help here: http://megapkg.googlecode.com/svn/trunk/csrc/ntk/TODO
I've talked with Pat Thoyts about Win32 support. I'm hoping he will be able to help. If not, I'll just continue on my path to use the DIB layer in Windows. I'm hoping that someone more experienced with Win32 will be able to help with DirectX.
I rewrote the rendertree extension in Tcl, and I've managed to get better performance. The code is also more understandable. You can see how I've done it here: http://megapkg.googlecode.com/svn/trunk/NexTk_demo.vfs/rendertree.tcl
I have started work on the NexTk scrollbar. The buttons work well so far. I'm using ntk_grid to manage the scrollbar components. More work will be done on this soon.
Here is a screenshot of the latest revision of the demo (using megaimagetk under X11):
George Peter Staplin 2007.09.20 : I fixed widget destruction handling, and a long standing bug that went unnoticed in the structure extension. A new extension called ntk is being written for Win32 and X11. Ntk is going to replace the Tk layer currently used by NexTk and the megaimagetk widget.
Ntk (.dll/.so) provides:
I've started writing a game like Richard's Over and Out for NexTk. I also have the start of a 3D rotating box that is kind of neat. The text widget data structure code has been tested, and I believe I found a good solution that is very scalable based on my measurements. The format for a line is:
set line [list $linewidth $lineheight [list $context text] [list $anothercontext text]]
And each line is a member of a list. So it's like:
set body [list $line1 $line2]
Then the body gets stored in a structure. I've tested it with over 10,000 lines of text from one of Edgar Allen Poe's works, and it's quick, so I think it's scalable enough. The real cost and difficulty may be getting freetypeext to be fast enough at measuring, that we can have proper scrolling even with wrapped text.
The grid manager has been rewritten, and with some input from the Tk core grid maintainer I have fixed some bugs. It doesn't use any idle handlers, so I think it's superior to Tk's grid.
I started on a scrollbar, and ended up writing some generic code in theme.img for drawing 3D reliefs. Eventually the button.img should use that code in theme.img.
Caveat the demo is kind of a mess of unfinished code, and once the ntk extension is finished I'll write some real applications that are better than the demo.
If any of you are in the Tcler's Chat occasionally you may have noticed I've improving the performance of NexTk drastically.
A few things of interest: I fixed a bug in the structure extension. It wasn't freeing the internal rep of some shimmered objects, so this fixed a few leaks. I rewrote proc rendertree in C. I've drastically improved the speed of megaimage_blend, and megaimage_rotate. We now have an optional -DFAST_BLEND that uses a rather large lookup table for alpha blending. I wrote a listbox widget. It's still somewhat primitive, but it works. I added a -fullscreen flag. New Starkits will probably appear soon, once I've made a bit more progress. There have been changes throughout the tk9.vfs/NexTk tree that are too numerous to mention. The grid manager is used with the image selection window in the demo, and I'm pleased by grid.img for the first time.
Only parts of the tree changed will be re-rendered now. This has greatly improved performance.
I've got a working, but slow, megaimage3d. This may soon showup in the demo.
I'm working on an Nvidia driver for my GeForce 2 card. This will allow me to run NexTk without X.
Here's a screenshot:
After some help testing from Tcler's Chat people, I now think I have fixed the bug that occured sometimes with Xv (X video extension) and some video cards. I worked on my initial prototype program again to figure out the bug. This is the prototype: http://www.xmission.com/~georgeps/engineering/prototype/Xv_prototype-8.tar.bz2
I then added that code and did a round of builds. This time I did the Linux builds in Debian Sarge within Qemu. There was a bit of a strange libm issue that Torsten noticed otherwise I think. I tested in Windows, NetBSD, and with SuSE Linux emulation in NetBSD.
The latest demo is here and requires Tclkit >= 8.5a4: http://www.xmission.com/~georgeps/implementation/software/demo/NexTk_demo5b.kit
If the Xv code still fails, don't fret, because you can run the demo! (Please let me know if it does fail, because it's supposed to automatically fallback to MIT-SHM.) You can do:
export NEXTK_DISABLE_XV=1 tclkit8.5 NexTk_demo5b.kit
(for further changes see the megapkg CHANGES file)
Here's a new screenshot:
Here is a screenshot from that Starkit:
Here's a new screenshot:
Items left to do:
I have ported the base widget that hosts Tk9 within Tk8.x to Windows. I'm now regularly building Windows DLLs with the MinGW cross compiler from pkgsrc. There are many changes I've made to the C extensions. I also had to modify the tk9_demo.vfs files to work in Windows, and created an archmap.tcl for having the Starkit support multiple platforms.
Here's a link to the Starkit that supports NetBSD x86, Linux x86, and Windows for 8.5a4 tclkits:
DKF suggested that I change the name to NexTk1. I like the sound of NexTk.
I'm thinking seriously about finishing my notes on the nv driver for X, so that I can mmap the memory, setup the card, and use this as my window system. I was thinking that I could use a modified Xvfb with this code to support X11 apps in my own window system.
It's probably time to profile the code in the demo. Some hot spots may exist in the C code or the demo itself. The grid engine is basically finished for now I think. Once I get it working in real world apps I think that will be the real test of it.
Freetypeext was almost completely rewritten recently. I also added more tests for it, and leak tests that have eliminated all leaks.
I created a new demo for x86 Linux (requires an 8.5 tclkit):
The mouse input and dragging works perfectly now with rotated tk9_windows. Now you can rotate any window in the demo. Just select the window and click the Tk8.x Rotate button at the bottom. This release is the first that demonstrates the Freetype font feature (only used if you have Vera.ttf).
Thanks to Gerald W. Lester for his help with the rotated-window-mouse-input algorithm, and the developers of the tcllib math package for the excellent point-in-polygon code that I used.
We can also now rotate windows over and over again with only a single rotations loss. This is the first tk9_demo to use the tk9.vfs and what will become the standard window.img.
I've updated the plans here: http://www.xmission.com/~georgeps/documentation/plans/Tk9-13.tar.bz2
Thanks to rdt for testing the demo in Linux. I build the starkits with qemu, and test with an 8.5 Tclkit from Linux via NetBSD's Linux emulation.
The grid manager is also at revision 4 in the 2nd prototype. It's moving along and the results are good.
I have a working prototype of freetypeext.so:
Sample code that generated that is available here:
I plan to add kerning support, so that the text has better spacing between chars. Also see the text_playground.tcl file for further features I want to add that will be required for things like entry and text widgets.
I've started on my second prototype of a grid manager in Tcl. It now has -columnspan, -rowspan, and -sticky.
A little work everyday adds up to a lot.
At the moment it uses megaimagetk's megaimage.frame (in the demo) for fast shared memory image display. Future performance will be even better.
I have a demo/prototype that you can drag around the windows in, and watch as the alpha transparency works flawlessly with the windows.
Here's an example of the Tk9 demo (prototype WIP):
Download the demo (for x86 Linux (built in Debian Sarge)): (removed due to lack of disk quota space) http://www.xmission.com/~georgeps/implementation/software/demo/tk9_demo.kit
Design Plans for Tk9 http://www.xmission.com/~georgeps/documentation/plans/
I'm open to new developers helping. Are any of you interested in a mailing list?
I'm looking forward to this when I get one of them thar' round toits.
How on earth do you get this thing running on Win2k?