ntkWidget

Description

ntkWidget is an implementation of widgets similar to the existing Tk widgets (label, frame button, text, entry ...) by apw, which is based on the megapkg, ntk and freetypeext packages written by GPS. The idea is to have images as the base of all widgets and parts thereof. The implementation is derived from the NexTk implemented by GPS.

Restart in 2013

ntkWidget implementation has been restarted in 07/2013 with OpenGL ES 2.0 as base using itcl-ng and building widgets based on ttk widget set. See ntkThemed

Details

The implementation is done with an extended version of incr Tcl: itcl-ng, which provides the necessary functionality. Nevertheless it should be possible to use "normal" proc functionality of Tcl to use that package and to build for example megawidgets or GUIs based on the package.

General information on some of the "structuring" used for all of the commands below:

  • color values consist of a RGBA list, example: [list 255 0 255 255]. The first three elements being the R, G and B value, the last one being the alpha value.
  • window path_names by convention start with a "." and the parts are separated with a "." example: .w1.w2.b1

The current commands are:

These are mostly implemented.

Additional commands will be:

The commands are implemented in the ::ntk namespace as ntk namespace ensemble commands, so at least Tcl8.5b1 and Itcl 4.0 (itcl-ng) are necessary.


apw 2007-12-02 -- for trying out this package (this is still work in progress !!) you need at the moment:

  • Tcl version 8.5b3 or greater
  • tclOO HEAD version + the diffs in the attachment file of tclOO RFE 1842588 [1 ]
  • itcl-ng HEAD version see URL: [2 ]
  • in the itcl-ng repository you need to build and install the Itcl 4.0 package in subdirectory itcl
  • in the itcl-ng repository you need to build and install the some packages which are in subdirectories of subdirectory itk (itk package itself is not needed !!), see the next few lines
  • tclGL (subdirectory of itk)which contains Tcl package TclGL
  • glmwfw (subdirectory of itk) which contains Tcl package Glmwfw
  • glmwfwx11 (subdirectory of itk)which contains Tcl package GlmwfX11
  • ntkWidgetImage (subdirectory of itk)which contains Tcl package ntkWidgetImage
  • ntk (subdirectory of itk)which contains Tcl package ntkWidget

The small demos are found in ntk/demos directory. They are all started with: tclsh8.5 <demoFileName>.tcl. Some have an additional command line parameter degrees to determine how much the widget should be rotated. There is also a short README file there.

Here a short overview over the directory hierarchy:

top directory itcl itk itk itk itk itk itk itk
package directory ntk tclGL glmwfw glmwfwx11 glmwfwwin32 glmwfwmacosx ntkWidgetImage
source code directory generic library + demos generic generic generic generic generic generic
package name Itcl 4.0 ntkWidget 0.1 TclGL 0.1 Glmwfw 0.1 GlmwfwX11 0.1 GlmwfwWin32 0.1 GlmwfwMacosx 0.1 ntkWidgetImage 0.1

This code is currently only running under Linux/Unix, it has been tested with SUSE Linux 10.0

There is work in progress for support of Windows (glmwfwwin32) and there will be support for MAC OSX in the future.

apw 2007-12-19 There is a tclkit for testing the demos available here: http://tcl.wiedemann-netz.de/pub/ You will also eventually need the tclkit available there, as it must be at least a tclkit with Tcl 8.5b1.

The following very small demos are available:

  • button
  • entry
  • label
  • clock
  • listbox
  • spinbox
  • text

Each demo can be started using the following line: tclkit ntkWidget <demo name>

button, label and entry have an optional second parameter: <degrees> in the range of -180 <= 0 <= +180 to rotate the text (positive values counter clock wise, negative values clock wise)

AM (20 december 2007) Unfortunately I get an infinite loop on "info exists auto_unload" in ::unknown:

...
"info exists auto_noload"
    (procedure "::unknown" line 23)
    invoked from within
"info exists auto_path"
    (procedure "::tclPkgUnknown" line 4)
    invoked from within
"::tclPkgUnknown app-ntkWidget 0-"
    ("uplevel" body line 1)
    invoked from within
"uplevel 1 $original [::linsert $args 0 $name]"
    (procedure "::tcl::tm::UnknownHandler" line 97)
    invoked from within
"::tcl::tm::UnknownHandler ::tclPkgUnknown app-ntkWidget 0-"
    ("package unknown" script)
    invoked from within
"package require app-ntkWidget"
    (file "/u/markus/Desktop/ntkWidget/main.tcl" line 14)
    invoked from within
"source /u/markus/Desktop/ntkWidget/main.tcl"
    ("uplevel" body line 1)
    invoked from within
"uplevel [list source [file join $self main.tcl]]"

apw 2007-12-20 - sorry 2 problems: the link was using the wrong version of tclkit, infinite loop fixed in ntkWidget

apw 2008-09-14 - the project is right now on hold because of other activities for tcluno and itcl-ng, it will be continued in the future.


peterc 2008-09-15: Looks like an interesting project. Any screenshots available?