Showing posts from 2015

Recent Changes

The past couple of months have seen some inprovements to the core code, including an number of notable fixes. The most signfiicant, to my mind, is the a reliable implementation of text widget pango markup.

        o fixed problems with closing and deleting the dialog.
        o fixed problems with inserting pango markup strings containing non ASCII characters.
        o new options
            -balanceQuotes, handles matching double and single quotes along with apostrophe-s
            -swap, swap keyboard string sequences for items in a matched list (e.g --> swapped for right arrow graphic U+2192)
        o enhanced 'get' command to respond to the setting of the -useMarkup option, command getMarkup deprecated.

        o getMarkup subcommand now retrieves stable pango markup strings.
        o new option: -show
        o added: -rolloverMode, one of: non, foreground, background or both.
        o use of -rollOverFgColor…

Summary of Changes for the Past Couple of Months

Haven't posted much to the Blog for the past couple of months but there has been a steady stream of enhancements put into the sources. Here's a brief summary of the changes over the past few weeks. Download the latest nightly build from Sourceforge.

    gnocl::box, gnocl::hBox, gnocl::vBox
        o added commands: show, hide
        o added commands hidePage, showPage
        o added options -tabAlign, -tabWidthChars, -tabUseMarkup
    new command, gnocl::keyName
    gnocl::accelarator module completely re-written.

A further area of development that I've been working on recently is providing a realiable framework for creating gnocl driven widgets and megawidgets. By widgets, the idea is the use of the drawing area object to create unique items, using internal scripting in order to drive cairo. To keep the Tcl side of the scripting to a minimum, a small number of utiltiy commands currently being tested will find their way into the m…

Reworked the gnocl::dialog soucecode

With a few notable changes, the dialog.c module was legacy code which tried to do too much. In attempting to add stock icons and embedded buttons so many irreversible bugs had crept into the code which made it almost impossible to prevent an application crashing. A quick glance at the gtk style guide makes no mention to of the use of Stock icons in dialog buttons so,  the best way forward was to retire the inclusion of icons and predefined buttons in favour of something much simpler and far less prone to crashing. The following extract from the development documentation highlights the changes made.

-buttonstype: list (default: Ok) List of buttons to be displayed consisting of a list of display strings with optional values.Method 1) Simple Strings.

In this case the text string will be used as the basis of the returned value stripped of any percent string underscore markup.-buttons "%__Yes %__No" Clicking the "Yes" button will return "…

Summary of Recent Progress

The current nightly build sees a range of enacements to Gnocl as a whole. A number of issues have been addressed as itemized in the extract from the NEWS document below. This nightly update sees the -name option taking on a greater role in the control of widgets. Ordinarily used for specifying ojects in a Gtk CSS file, or in a builder/glade XML file, using the name option will cause the interpretor to create a command for the widget using the string specified by the -name option. Ordinarily a widget instance would be created as follows:

set myButton [gnocl::button -text "Hello World"]

And modified with:

$myButton configure -onClicked { puts %w }

But now,  the following will produce similar results.

gnocl::button -text "Hell World" -name myButton

Modification can also be handled too,

myButton configure -onClicked {puts %w}

This approach provides a neat and efficient way of creating widgets as objects within namespaces. Using the same example the following could be used:

Recent Modifications

Over the past few weeks a number of enhancements have be made to the gnocl package. Here's a brief overview of the changes:

    gnocl::menu, gnocl::menuRecentChooser, gnocl::statusBar
        o added -name, -data; implemented cget
        o added -name, -data; implemented cget
        o added -name
    added gnocl::application, a convience application megawidget
    added parent command to gnocl::volumeButton, gnocl::scale and gnocl::spinner
        o resolved problems with start and stop commands (same as using the -active options).
        o using the get widget command alone will return all text contents, i.e. same as "$wid get start end"
        o wordList sub-commands "add", "clear", "delete" and "get" are now implemented.
        o enhanced the wordList subcommand with new option -split
            specifying this option will result in a string being tre…

Recent Enhacements

Here's a brief overiew of enhancements to the development distribution over the past month or so.The mix is consists of the inclusion of a number of convenience options and enhanced feedback.

        o added command nthPage, retrieve name of child widget on specified page. 
        o new command, provides additional convenience string functionality; particularly useful for
           string comparisons.
        o added -lineSpace convenience option. Valid options are "single", "1.5", double" or exact
           spacing in pixels.
        o added command getSelection (text only, markup not included)
        reduced -typeHint options to normal, popup and splashscreen.
    gnocl::toolbar menu button
        o added new option -data:
        o added command pageNum, retrive page number for specified child widget
            added extra percentage substitution …

Cancellation of a 'Recent Items' Pull-Down Menu

Its been some time since support for 'recent file' operations was first added to the Gnocl sources. At the time I was quite pleased with its inclusion but there was always a annoying snag to it, something which is an inhereted feature from the API: if no selection if made, then the last file URI added to the list is always returned. This is not really a sign of anything lacking in the GTK sources, but the documentation does not suggest how to handle any need to CANCEL the menu by pressing the 'ESC' key.
 A quick gloss over the docs shows that there is a 'cancel' signal for the MENU-SHELL containing the recent items, but this automatically generates a 'selection-done' signal, the very signal that we want to avoid. The obvious solution for this is to set a boolean cancel flag and test for its TRUE or FALSE state during the execution of any 'selection-done' event handler.

For a TCL side solution it was first was necessary to implement a gnocl -onCa…