Some old and simple screenshots (the default color scheme is different now):
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. -GPSNexTk is available with a massive collection of code here: http://code.google.com/p/megapkg/BUILDINGSteps to get it running (albeit with a silly demo at the moment):
- svn checkout http://megapkg.googlecode.com/svn/trunk/ megapkg
- cd megapkg
- cp build.conf build.conf.whatever
- edit build.conf.whatever (you may need to install development packages for Freetype, libpng, libjpeg, X11, Xv, XShm)
- tclsh8.5 build.tcl build.conf.whatever unix
- tclsh8.5 build.tcl build.conf.whatever NexTk_demo.kit (for historical reasons that doesn't actually generate a starkit. It just copies the build directory contents to NexTk_demo.vfs/lib.
- cd NexTk_demo.vfs
- sh update_nextk_objstructure.sh
- sh update_games.sh
- wish8.5 main.tcl
- Send me patches!
- cd NexTk_image_viewer.vfs
- sh copyext.sh (the script by default copies the Linux build tree, for BSD you'll need to edit it)
- tclsh8.5 main.tcl
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):
- antialiased line drawing using Wu's algorithm (full RGBA support).
- portable antialiased text
- rectangle drawing (full RGBA support)
- polygon drawing (full RGBA support)
- window rotation
- generate buffer rotation
- scaling
- arbitrary pixel put/get
- getrow/putrow
- and much much more! :)
NEWS George Peter Staplin 2008.09.6 : Well, I'm disappointed at this point in some respects. I ran into some performance problems in the 0.6 release due to reference counting that was required for the widget tree, in order to make destroy callbacks not do an early release of a NS_window objstructure. So, I can't see a way around that. Thus I have started on ntk_image, some time ago, in order to resolve and improve the performance, while exposing only a descriptor for each image. The ntk_image extension will store the tree from now on. It's still a work in progress, but the advantages are:
- Faster rendering due to the removal of the need for Tcl_EvalObjEx for objstructure image retrieval. The tree is stored privately.
- Final rendering will be simpler and require a smaller update region, which should improve Win32 and VNC performance.
- The Tcl-level reference counting problem mentioned earlier should be eliminated.
George Peter Staplin 2008.04.11 : I have done a lot of work on ntk.dll. It now uses OpenGL by default for displaying NexTk content. The OpenGL support configurable at runtime, so you can downgrade to a DIB with set ::env(NTK_DISABLE_GL) 1. Ntk.dll is looking much better. I've done a lot of work to make the code more robust.Many more of the extensions are multiple-interp safe now. This will make thread support easier to add in the future too.Windows keyboard support is still something I want to focus on. Right now it's disabled, because I had a fault occur with some related path. I think partly because I don't always have standard channels in NexTkKit. It may be fixed now.Today I made freetypeext support multiple interps. Freetypeext has a slightly different API as of today. It should allow for higher performance, because the struct freetypeext_font and some other information is retained between freetype calls from Tcl. Now you create a freetype font descriptor for use with the freetype command. This also required a flurry of changes to make NexTk work properly after that. I'm so far happier with the design.megapkg now has a webcam server that is powered by some NexTk extensions, as well as a portable client. The server runs in Linux and uses v4limage.so (a new video4linux2-based extension).
George Peter Staplin 2008.03.17 : We now have a working NexTkKit that can be used to create stand-alone executables. I have created 2 test executables that use NexTkKit.For Linux: http://www.xmission.com/~georgeps/implementation/software/demo/NexTkKit_image_viewer.binDependencies:
$ ldd NexTkKit.bin linux-gate.so.1 => (0xffffe000) libX11.so.6 => /usr/lib/libX11.so.6 (0xb7ea4000) libXext.so.6 => /usr/lib/libXext.so.6 (0xb7e96000) libm.so.6 => /lib/tls/i686/cmov/libm.so.6 (0xb7e6e000) libc.so.6 => /lib/tls/i686/cmov/libc.so.6 (0xb7d2d000) libdl.so.2 => /lib/tls/i686/cmov/libdl.so.2 (0xb7d29000) libXau.so.6 => /usr/lib/libXau.so.6 (0xb7d26000) libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0xb7d21000) /lib/ld-linux.so.2 (0xb7fb3000)For Windows NT 4 or greater: http://www.xmission.com/~georgeps/implementation/software/demo/NexTkKit_image_viewer.exeI have added a new feature to ntk for retrieving the total number of toplevel windows. The Win32 version feels slower than X11, because of the ntk-put-image path I think. It could use some loop unrolling, and especially profiling. The X11 version operates on 4 pixels per loop iteration, whereas the Win32 version does 1. I wanted to make it work, and then make it fast. I did the same thing with the original X11 version.The tickmakefile is going to need some thought to work with NexTkKit properly.escargo - The current version of Nagelfar has some profiling code in it. If you preprocess your Tcl code, run it, and do an appropriate shutdown, you can move a log file back and see what code executed (code coverage). In addition, the log file shows how many times statements executed. This is good for finding program hot spots.
George Peter Staplin 2008.03.13 : The code has been cleaned up a lot in many areas.The grid.img was partially rewritten, and is now running as grid2.img. The grid manager has had a lot of work done on it. I have written tests for the grid engine as well, beyond just the demo programs. I added geometry propagation that can be disabled in a parent widget with the _propagate_geometry variable in a window structure. I'll probably eventually add a proc to set/unset the propagation.The segfault upon exit with Win32 ntk is now fixed.The usability in Win32 has improved a lot. I still need to work on keyboards events for Win32. The TODO files have more.See also: http://code.google.com/p/megapkg/source/browse/trunk/NexTk.vfs/TODO http://code.google.com/p/megapkg/source/browse/trunk/csrc/ntk/TODO
George Peter Staplin 2007.11.23 : The ntk extension now runs in Win32 properly (for the most part). I've fixed many bugs and polished things a lot more. The selection code for Win32 and X is what I plan to focus on soon, after I get the configure callback for the ntk system/toplevel windows delivered properly, so that the toplevels resize.New widgets or widgets in progress include: ntk_notebook, and ntk_scale.The entry widget is a little broken at the moment. I plan to focus on text input, and the text widget soon.I've improved the speed of the blending algorithm again, as well as the image dithering. I made several attempts to rewrite the alpha blending with SSE, but so far those have turned out slower than the code generated by gcc.apw continues his great work on itcl-ng and ntkWidget. He's been working a lot on the OpenGL backend.
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:
DISCUSSIONI'm looking forward to this when I get one of them thar' round toits.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).KJN 2007.09.20 : I'm no expert, but the Evas (Enlightenment Canvas) has several "engines" (backends). Recent CVS commits [1] have these log entries:
- "Glew OpenGL engine added. Windows can have an opengl engine thgough the Glew library, now. See INSTALL note" (the note refers to the Glew library and compilation with MinGW)
- "Direct3D engine. I'm not an expert of that api, so there should room for lots of improvements"
- "added per-engine pc files" - as well as Glew and Direct3D, the engines include SDL and ddraw. The engines are in [2] and also include win32_gdi.
How on earth do you get this thing running on Win2k?That's a good question. I've never actually tried to build in Windows (I use a MinGW cross compiler)... :) -GPS