I'm pleased to announce that, after much frustration, the gnocl binding to the GtkToolPalette is now complete. To try it out, download and compile the latest nightly build from Sourceforge.
And here's the test script:
#---------------
# test-toolPalette.tcl
#---------------
# Created by Dr. William J Giddings, 2016
#
#!/bin/sh
#\
exec tclsh "$0" "$@"
package require Gnocl
set tp [gnocl::toolPalette -tooltip TOOL-PALETTE -orientation vertical]
puts >[$tp commands]
puts >[$tp options]
set ig(1) [$tp addGroup -label MyGroup1]
puts >>[$ig(1) commands]
puts >>[$ig(1) options]
$ig(1) addItem -icon %#New -text XXX -tooltip YYY -data £££ -onClicked {puts "Hello from %w %d"}
$ig(1) addItem -icon %#Cut -text ABC -tooltip ZZZ -onClicked {puts "Hello from %w"}
$ig(1) addItem -icon %#Copy -tooltip WWW -onClicked {puts "Hello from %w"}
set pi [$ig(1) addItem -icon %#Paste -tooltip AAA -onClicked {puts pi} ]
puts ....$pi....
puts "class = [$pi class]"
puts >>>[$pi commands]
puts >>>[$pi options]
$pi configure -onClicked { puts "BOING! BOINGG!" } -icon %#Stop
if 1 {
set ig(2) [$tp addGroup -label MyGroup2 -collapsed 1 -sensitive 0]
$ig(2) addItem -icon %#New -text XXX -tooltip YYY -onClicked {puts "Hello from %w"}
$ig(2) addItem -icon %#Cut -text ABC
$ig(2) addItem -icon %#Copy
$ig(2) addItem -icon %#Paste
}
parray ig
gnocl::window -child $tp -width 200 -height 400
Saturday, May 28, 2016
Tuesday, May 17, 2016
Gnocl for Raspberry PI
After a couple of hours work this evening (largely fixing errors in the distribution makefile) I successfully compiled Gnocl to run on my newly acquired Raspberry PI3. It was much, much easier than expected. No changes to the source code whatsoever.
I now need to create a download page from Sourceforge. Currently running Ubuntu Mate on my Pi. Very nice, very pleased. Much faster than my sturdy old 32-bit workhorse.
Here's a snippet from a screenshot.
I now need to create a download page from Sourceforge. Currently running Ubuntu Mate on my Pi. Very nice, very pleased. Much faster than my sturdy old 32-bit workhorse.
Here's a snippet from a screenshot.
Sunday, March 27, 2016
A Few Recent Enhancements...
Time has flown very quickly over the past few months, with much of my coding time dedicated to working on other projects. These have identified a the need for a few modifications to the Gnocl code which make GUI composition easier such as explicit order placement of child widgets in boxes and the harmonization of value extraction for text entry widgets.
Here is a summary of changes since the previous blog posting.
2016-03:
gnocl::box, gnocl::hBox, gnocl::vBox
o added -position option to the "add" subcommand.
2015-12:
gnocl::entry
o added commands: 'selectionBounds', 'insert', and 'erase' (remove specified range of characters from entry buffer).
gnocl::button
o fixed problems arising from using the "delete" command.
gnocl::text
o added -nomarkup switch to the "get" command to override return of formatting markup.
2015-11:
gnocl::progressBar
o problem with very slow internal update of the GTK 'text' property worked around, value set explicitly in widget configure function.
gnocl::entry
o added 'select' as synonym for 'selectRegion', harmonizes with text commands.
o added 'start' and 'end' keywords to the 'select'/'selectRegion' commands.
Here is a summary of changes since the previous blog posting.
2016-03:
gnocl::box, gnocl::hBox, gnocl::vBox
o added -position option to the "add" subcommand.
2015-12:
gnocl::entry
o added commands: 'selectionBounds', 'insert', and 'erase' (remove specified range of characters from entry buffer).
gnocl::button
o fixed problems arising from using the "delete" command.
gnocl::text
o added -nomarkup switch to the "get" command to override return of formatting markup.
2015-11:
gnocl::progressBar
o problem with very slow internal update of the GTK 'text' property worked around, value set explicitly in widget configure function.
gnocl::entry
o added 'select' as synonym for 'selectRegion', harmonizes with text commands.
o added 'start' and 'end' keywords to the 'select'/'selectRegion' commands.
Thursday, November 26, 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.
2015-11:
gnocl::dialog
o fixed problems with closing and deleting the dialog.
gnocl::text
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.
2015-10:
gnocl::text
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 and rollOverBgColor reinstated
o resolved need to set -onMotion handler in order to engage rollover effect rendering.
gnocl::entry
o problems with getSelection fixed.
o new sub-command: selectRegion.
New widget, gnocl::acceleratorGroup
One of the major tasks ahead for me now is updating the documentation, and issuing an incremental release. At ths point plans need to be made regarding the migration to Gtk3+. Whilst the transition will certainly offer new resources to the Gnocl coder, a major overall of the sourcecode is anticipated, perhaps alongside the retirement of some widgets due to core deprecation.
2015-11:
gnocl::dialog
o fixed problems with closing and deleting the dialog.
gnocl::text
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.
2015-10:
gnocl::text
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 and rollOverBgColor reinstated
o resolved need to set -onMotion handler in order to engage rollover effect rendering.
gnocl::entry
o problems with getSelection fixed.
o new sub-command: selectRegion.
New widget, gnocl::acceleratorGroup
One of the major tasks ahead for me now is updating the documentation, and issuing an incremental release. At ths point plans need to be made regarding the migration to Gtk3+. Whilst the transition will certainly offer new resources to the Gnocl coder, a major overall of the sourcecode is anticipated, perhaps alongside the retirement of some widgets due to core deprecation.
Saturday, September 12, 2015
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.
2015-09:
gnocl::box, gnocl::hBox, gnocl::vBox
o added commands: show, hide
gnocl::notebook
o added commands hidePage, showPage
o added options -tabAlign, -tabWidthChars, -tabUseMarkup
2015-08:
new command, gnocl::keyName
2015-07:
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 main package module. More about this in the next posting.
Saturday, July 25, 2015
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.
For more complex display strings the use of an associate value makes response parsing simpler.
Use underscore ("'_") to indicate accelerators, e.g.
Method 3) Default.
If the -buttons option is not specified then a single "Ok" button will be added to the dialog. This would be equivalent to using:
To add previously created button widgets, use the -actionButtons option.
- -buttons
- type: list (default: Ok)
- List of buttons to be displayed consisting of a list of display strings with optional values.
Method 2) String and Value.
- 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.
Clicking the "Yes" button will return "Yes" from the [gnocl::dialog] command or by substitution of the %v parameter in the -onResponse callback script..-buttons "%__Yes %__No"
For more complex display strings the use of an associate value makes response parsing simpler.
Use underscore ("'_") to indicate accelerators, e.g.
-buttons [list [list {%_P_ortable Document Format} pdf] [list {%_O_pen Document Text ODT} odt]
As with method 1), clicking the "Portable Document Format
" button will return "pdf" from the [gnocl::dialog] command or by
substitution of the %v parameter in the -onResponse callback
script.. Method 3) Default.
If the -buttons option is not specified then a single "Ok" button will be added to the dialog. This would be equivalent to using:
Note: The use of the %_ prefix is optional and retained for legacy.-buttons "%__Ok"
To add previously created button widgets, use the -actionButtons option.
Thursday, June 04, 2015
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:
gnocl::button -text "Hell World" -name myprocs::myButton
The creation of widget with command names in this way does not eliminate the process of registering widgets with a unique id. Using the same example, to access this simply use:
[myprocs::myButton]
and the widget id will be returned.
Substitution strings also unclude the %g and %w parameters to extract the (glade) name and w(idget-id) of the object.
New Extract
2015-05:
gnocl::notebook
o added extra percentage subtitution strings to -onPageAdded, -onPageRemoved
%l page label
gnocl::comboBox/comboEntry added new sub-commands: get, set, prepend, append, insert and remove.
gnocl::box/hBox/vBox fixed problem with cget -children
gnocl::window, gnocl::expander, gnocl::fontSelection, gnocl::gammaCurve,
gnocl::curve, gnocl::handleBox, gnocl::level, gnocl::popupEntry, gnocl::recentChooser
o added -name
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:
gnocl::button -text "Hell World" -name myprocs::myButton
The creation of widget with command names in this way does not eliminate the process of registering widgets with a unique id. Using the same example, to access this simply use:
[myprocs::myButton]
and the widget id will be returned.
Substitution strings also unclude the %g and %w parameters to extract the (glade) name and w(idget-id) of the object.
New Extract
2015-05:
gnocl::notebook
o added extra percentage subtitution strings to -onPageAdded, -onPageRemoved
%l page label
gnocl::comboBox/comboEntry added new sub-commands: get, set, prepend, append, insert and remove.
gnocl::box/hBox/vBox fixed problem with cget -children
gnocl::window, gnocl::expander, gnocl::fontSelection, gnocl::gammaCurve,
gnocl::curve, gnocl::handleBox, gnocl::level, gnocl::popupEntry, gnocl::recentChooser
o added -name
Subscribe to:
Posts (Atom)
-
Given this module some attention today. Added some of the more package wide options to the module and created customised handler for settin...
-
Over the past few programming sessions I've been working on producing a central point, a dashboard, around which it's possible to se...
-
Spent some time today creating some simple howto-tutorials on creating standalone Tcl/Gnocl applications using freewrap. The process is almo...

