Skip to main content

Posts

Showing posts from 2017

Last Post for 2017!

A lot of work has been done on the development sources over the past month.  Most are the addition of extra functionality to the existing widget set along with a few internal bug fixes. Here looking forward to 2018! 2017-12:     Added three macro-like commands used for testing the existence of         proceedures and variables: __DEF_PROC__, __DEF_VAR__ and __DEF_GLOBAL__     gnocl::tree/list         o changed command onSelectionChanged to selectionChanged.         o new option -keys, keywords or tags use in saving off column data.         o sub-command getFullist has new options, -keys, return list data as ro        gnocl::fileChooserDialog         o Fixed problem of widget failing to return and empty string when cancel button selected.     gnocl::winfo ...

Recent Changes, to the sources

 Latest Nightly build now available from SourceForge. Lots of work done over the past 6 weeks, and here's the gist from the project NEWS. 2017-11:     gnocl::paned         o    added -min, -max     gnocl::treeList         o    appending row to image columntype now supports %& percent-string (icon-theme).     gnocl::image         o    -image options now supports %& (icon-theme) percent string.     gnocl::button         o    -icon options now supports %& (icon-theme) percent string.         o    -iconSize, set size of icon, default = 22.     gnocl::toolPalette         o drag and drop between itemgroups now works. Unecessary options re...

September News

The codebase is currently undergoing a deep clean-up with a number of internal modifications and enhancements to largely yet unannounced features. 2017-09: o added gnocl::widgets, returns a list of available widget classes. gnocl::commands will now return only a list of non-widget creating  commands. o commands and options calls to widgets will return lists of relevant  options, without creating object instance. e.g. puts [gnocl::button options] ; puts [gnocl::button commands] More complex widget such as gnocl::text with sub-object may have more  options, e.g: [puts [gnocl::text tagOptions]. o gnocl::commands will now return only a list of non-widget creating  commands. o gnocl::info new sub-commands:  cursors returns list of available cursors, and subStrings returns list of callback substitution string and their meanings.

Displaying Tcl dict contents in a gnocl::list widget

The following script shows how to display the contents of a simple Tcl dict within a gnocl::list widget. #!/bin/sh # the next line restarts using tclsh \ exec tclsh "$0" "$@" package require Gnocl namespace eval pkg {} #--------------- # Create a gnocl::list displaying the contents of a Tcl dict. #--------------- # Arguments: #    val        dict data to display. #    args # Returns: #    wid of gnocl::list containing the dict data. # proc pkg::dict2list { vals } {             set res ""         # get a complete list of info keys     set c key     dict for {id info} $vals {         foreach {a b} $info {             if { [string first $a $c] == -1 } { lappend c $a }             }  ...

Recent Changes

Just a few additions and enhancements to the 0.9.96 code over the past couple of months. Latest sources available at Sourceforge. 2017-08:     gnocl::tree, gnocl::list         o cget -types now works.         o FIXED: crashing when getFullList called on model with 0 rows.     gnocl::text         o -onPopulatePopup Substitution options %r, %c and %t changed to %R(ow), %C(olumn) and %T(ags),              and %t reallocated to return id of widget toplevel window. 2017-07:     gnocl::entry         o added -onButtonPress and -onButtonRelease         o added getSelectionBounds for consistency with the text widget            gnocl::toolBar         o menuButton -icon c...

Gnocl Gtk3+ implementation begun!

Yesterday I made the spot decision to make the move from building Gnocl against the Gtk2+ libraries to Gtk3+. At the end of the day I got the bulk of the gnocl::window module running. This doesn't mean that the conversion process will be an easy journey, it won't. The current build of Gnocl has evolved over the years and contains many legacy calls to widgets, functions, structures and macros not longer supported in Gtk3+. The immediate effect is that much of the 'glitzy' stuff working on pixmaps no longer work. Its all a question of time! This doesn't mean that the Gtk2+ distribution will be forgotten, it still forms the backbone of the project and will be supported till most the the conversion work has been done. One of the greatest challenges is the lack of suitable documentation. For Gtk2+ there was always Krause's excellent book, but now the emphasis would appear to be upon creating chunks of builder xml code and embedding these as strings into C-sourcec...

Creating previews with the File Chooser Dialog

I'm currently doing something of a spring-clean of the source code and noticed that the image and filechoose dialog options really didn't work too well together in order to create previews. So, the modifications to the current nightly build will allow scaling and constraints on image dimensions without the need for lengthy, and potentially cycle consuming Tcl scripting. Here's a code snippet... set pv(1) [gnocl::image ] set fname [gnocl::fileChooserDialog \     -previewWidget $pv(1) \     -onFileSelectionChanged { $pv(1) configure -image %/%f -constrainWidth 200 }]

April Update

Its a  little later than anticipated,  but here's news of changes to the gnocl package options implented during April. As always, get the latest sources from SourceForge. 2017-04:     gnocl::entry         o progress now works more efficiently, i.e.             wid progress 0.75    ;# set progress bar fraction to 0.75             wid progress        ;# increment an barlength as an ongoing progress             In the second example, the options -range and -progressSteps must be set.                 gnocl::entry -name ent -value ABCDEF -progressSteps $d -range $max                 gnocl::vBox -name container      ...

Update News

At the moment Gnocl is producing the occasional Gtk Warning, largely due to incorrect typecasting in shared widget commands. For small application this may not prove an issue but in larger, more complex application, the number of warnings (typically repeats of the same warnings) can be distracting. So, the effort over April will be to reduce these as much as possible. Although a lot of work has been done internally, the most apparent changes are relatively few.  As always, check the nightly build page for latest update. 2017-03:     Gnocl generated internal debug warnings to stdout are now colour formatted to distinguish them from Gtk+ warnings and Tcl error codes.     gnocl::clock         o Clock details, i.e, fingers and digits, now automatically resize.     gnocl::text         -tabs option now allows full tablist for both the widget and individual tags.

February Code Developments

The following contains a summary of the modifications to the main module code.  All updates available from the SourceForge in the nightly build. 2017-02:     gnocl::dial         o added options -value, -variable, -digits         o added commands get, set, cget     -foreground and -background option can now take 2 values, namely state and color,         where state is one of "normal", "active", "prelight", "selected" or "insensitive".         If only the colour is specified, then the default state of "normal" is assumed.         e.g. -background [list insensitive black]     gnocl::text         o fixed memory allocation problem with lorem sub-command.     gnocl::eventBox         o added -insensitiveColor option, all...

Gnocl Dial Widget Enhancements

The existing dial widget is a straight implementation from the Gtk tutorial docs. Whilst it was possible to create an instance using the gnocl::dial command it wasn't  much use. Apart from wiggling the mouse pointer around it didn't offer any way of setting or getting a value within a script, nor did it enable the user to set a variable trace. Added to this, the graphics were pretty grim as it relied upon gtk paint operations. Over the weekend I took a look at what could be done with the existing code. After a bit of work it offers much more. The graphics are rendered in Cairo and so look good and the displayed value can be set and retrieved. Not all the changes have been in the gnocl dial sources, some tweaking has taken place in the GtkDial.c source too. The next step is to provide some controls over the colouration of the widget, and setting the range limits much like those of the scale command.

Recent Changes - January 2017

The past month has seen focus placed upon tidying up some features working around GdkPixbuf support, work which I expect will continue well into February. The functionality examined seeks to address the creation of  graphics for use in applications documentation so that, for instance, in developing documentation for Gnocl itself, the interpreter will return lists of widget options and sub-commands along with screenshots of widget and windows in operation. As can also seen from the change list below, a new file option '~' has been implemented. When Tcl scripts are 'wrapped' using FreeWrap or TclKit, Gtk api calls cannot directly access files within the VFS (which is transparent to Tcl itself). This functionality is achieved by first extracting files to the /tmp directory a location outside the VFS, from where they then can be accessed. 2017-01:     gnocl::pixBuf         o new commands paste, snapshot, windowshot.     ...

December 2016 Changes

A summary of the past months changes to the gnocl core module. These enhancements offer a extra means of fine-tuning the appearance of gnocl base applications.   New commands:         o gnocl::property, set and override application wide settings.         o gnocl::data, set and get additional widget data associations.     gnocl::checkButton         o added -widthGroup     gnocl::radioButton         o added options -normalBackgroundColor and -prelightBackgroundColor     New command gnocl::license, returns configurable BDS style licence for use with Gnocl or Gnocl derived projects.     gnocl::window         o beep sub-command functionality restored.     New convenience widget: gnocl::labelWidget, much like gnocl::labelEntry and gnocl::labelText, useful for crea...