Tuesday, May 23, 2017

Gnocl Gtk3+ implantation 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-sourcecode.

It would appear though, that there's always more than one way to skin a cat, and, getting the initial 'application' running was not, shall we say, according to the manual. Actually, by working around the rules, it became simpler!

It'll be some time before a first workable, package is released, so until then, wish me luck and straightforward coding!

Tuesday, May 16, 2017

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 }]

Tuesday, May 09, 2017

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
                container add [ent]
                gnocl::window -child [container]
                gnocl::update
                for {set i 0} {$i<=$max} {incr i} {
                    # do something...
                    ent progress
                }
    gnocl::text
        o search command can now accurately set multiple tags. Unknown tags with result in a Gtk Warning.
    Reducing number of internal Gtk warnings written to stdout. Largely arising from invalid cast in setting widget pointers in shared command functions.

Sunday, April 02, 2017

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.

Tuesday, February 28, 2017

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, allow objects to blend into background.



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.



Tuesday, February 07, 2017

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.
        o get drawAble
        o bug fixed in composite
    gnocl::window
        o New command snapShot - take screenshot of the window for documentation purpose.
    New %-string type '~'. Denoting file existing within a TclVFS directory structure.

Friday, January 06, 2017

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 creating dialogs.
    Note, labelWidget can only contain one child, which is destroyed if replaced.


Please contact me directly if you want a of the current 64-bit build.

Now that the new year in underway the focus of attention has moved to addressing some of the challenges associated with wrapping gnocl into executables generated by TclKit and Freewrap. Quite stealthily, Tcl accesses VFS (virtual file systems) at a level below the standard Tcl file opts commands. So, whilst Tcl commands like 'open' can directly access wrapped files, Gtk cannot. Accessing files can be achived by first unpacking object and then loading, something which can be done in either pure Tcl or internally in C within the gnocl core which is now being implemented.

Other options to look out for in January include the ability to convert and load images stores in an ascii format.