Skip to main content

Posts

Showing posts from 2020

December News

          Only a couple of updates to the code this month.     gnocl::toggleButton  new option -iconSize, set to one of: menu, small, large, button, dnd or dialog. gnocl::button  -iconSize now works properly, set to one of: menu, small, large, button, dnd or dialog. gnocl::image  new command size, returns size of a valid image file. gnocl::font renamed to gnocl::pangoFont convert pango font string to valid Tcl tagged list.

gnocl::sticky - a minimal borderless window

  Sometimes you just want to drop a small toolbar or widget holder on screen without all the decorations and controls. This code minimal minimal object is about as simple as it gets.  proc gnocl::sticky { {orientation "horizontal"} } {     if { [lsearch "vertical horizontal" $orientation] == -1 } {        return -code error \       "Error! \"$orientation\" should be one of vertical or horizontal (default."       }        set box [gnocl::box -orientation $orientation \-borderWidth 0 -padding 0]     set wid [gnocl::window -decorated 0 -child $box -height 25 -width 25]     if { $orientation == "vertical"} { set tmp height} else {set tmp width}     set eBox [gnocl::eventBox -borderWidth 0 -${tmp}Request 5 -background black]     $eBox configure \         -onButtonPress { %w configure -data "%x %y" -background red} \         -onButtonRelease { %w configure -data "%x %y" -background black } \         -onMotion { %t_ configu

October News

    Just a few updates:     gnocl::fixed        o new option for move command, -align {x y} ; pair of floats (0-1.0) for positioning     gnocl::pixBuf        o new command getOrientation, returns either portrait or landscape     gnocl::pointer        o new command, get returns pointer screen x y coordinates     gnocl::window        o pointer command now has -screen option to return screen coordinates     gnocl::toolBar        o -iconSize and -style configure and cget fixed.     gnocl::text        o -shadow option now works properly (applied to scrolled window container).        o search now has new option -wholeword <boolean> ; select between wholewords (1) and substring (0, default)     gnocl::callback         o new subcommands, prepend and append. Extend widget signal callback scripts.

September updates:

  A  little late in the offering, but a few enhancements were made to the core options since the last posting. 2020-09: gnocl::window         o -icon option now recognizes %# (stock item) %/ (file) and %? (buffer) percent strings. 2020-08:     gnocl::notebook         o new command: getLabel     gnocl::toolbar         o new option: -widthGroup.

August News

A bit late, but a couple of updates in July. The text search applying to whole words may present some issues where pattern matching on sub-strings was used. A later version may see the introduction of a -subString option.  2020-07:     gnocl::label         o new options: -editable, boolean. Use in conjunction with the edit command.          -onEnter, -onLeave, allows reaction to potential label rollover effects.     gnocl::text         o search will now ignore word embedded search patterns, i.e. search whole word only.

Gnocl Dashboard

Over the past few programming sessions I've been working on producing a central point, a dashboard, around which it's possible to see the various Gnocl widgets and commands in operation. In many ways like the demo script which shipped with the earlier releases of Gnocl but offers much more. The introspection functionality provides details of the various options and sub-commands of each Gnocl procedure which are displayed under the associated tab. Sample scripts are included for each item which offers newcomers a clearer insight into how make the most of what's on offer.

June News

Just a few updates and resolutions with the sources. 2020-06:     gnocl::spinButton         o %d substitution now works with -onValueChanged     gnocl::info         o new sub-command, compileDate           returns date and time when gnocl.so compiled     gnocl::entry         o added %t (text contents) and %v (validate command) to -onChanged -onKeyPress subsitutions strings         o problems with undo/redo commands resolved         o command listStack now returns entry undo/redo stack     gnocl::tickerTape         o start, stop and deleted commands now work properly     gnocl::richTextToolBar         o problems with delete command now resolved.

May News

Just a few enhancements and areas of work. 2020-05:     gnocl::frame         o option -labelAlign now takes two arguments, halign (default) and valign.     gnocl::calendar         o mark command now works correctly.     gnocl::printDialog         o now loads and prints.     gnocl::scrolledWindow         o new options, -heightRequest, -widthRequest     gnocl::toggleButton         o issues with toggle command now fixed.     gnocl::label         o cget -baseFont now works

April Changes and Updates

A few useful little tweaks and changes. The most significant is the introduction of a number of settings and internal code modifications to allow for the use of multiple monitors. 2020-04:     gnocl::pixBuf         o commands screenshot, windshow and widgetshot now work correctly.     gnocl::screenShot         o new command     gnocl::text         o -onInsertText this GtkTextBuffer callback binding now supports %w, the widgetId of the textview assoicated with the buffer.     gnocl::image         o cget -image now returns path/name of the image file displayed.     gnocl::eventBox         o new option -onDoubleClick     gnocl::layout         o new option -background     gnocl::screen         o "screens" command renamed to nMonitors, now works properly.         o "geometry" command returns a list of the geometries of all system monitors.     gnocl::window         o "centre" and "center" commands now accept new option -monitor, range 0 - n.         o

March 2020 News

A little late in the month with these postings, but here's a list of the module changes for March 2020.   gnocl::text         o new substition strings for -onInsert, %w (textview-id) and %b (bufferid)         o new command getBuffer, return current buffer id.  gnocl::textBuffer, problems with commands now fixed.  gnocl::acceleratorGroup         o new subsitutions strings %t (toplevel) and %f (input focus widget) gnocl::tree/gnocl::list         o new command: redraw         o option -onMoveCursor now works correctly         o option -treeLinePattern now works; options = dotted (default), solid or broken         o new options: -focusIn, -focusOut, -onCursorChanged,          -onButtonPress, -onButtonRelease, -onColumnsChanged,          -onExpandCollapseCursorRow, -onRowActivated, -onSelectAll,          -onSelectCursorParent, -onSelectCursorRow, -onSetScrollAdjustments,          -onTestCollapseRow, -onTestExpandRow, -onToggleCursorRow,          -onUnselectAll  gnocl::toolbar        

List Row Colouration - Formatting a row of text in a list widget.

The way in which the tree and list widgets handle cell formatting is to emphasize data groups in the context a columns, and their background colouration. Specific cells are usually formatted based upon their contents, principally as foreground attributes although cell value contents can also be formatted using pango markup. Row formatting in comparison is principally used for assisting visibility such as changing alternating row colour hinting and treeline. Selected rows are temporarily highlighted. Unlike the column configuration options Gtk+ offers no equivalent for setting rows attributes. To achieve this, each cell value needs to be reset and specific attributes assigned. The following example shows how to set the foreground colour for cells in the same row.  #!/bin/sh #\ exec tclsh "$0" "$@" package require Gnocl #--------------- # create UI #--------------- proc main {} { set box [gnocl::box -orientation vertical] set ::list [gnocl::list \     -titles {&q

gnocl::ribbon

I no longer use MS Windows but there is much talk of the "ribbon" widget used in MS products such as Word and Access. I originally came accross this type of layout many years ago when the MAYA 3D animation system was ported to Windows. Although it dominated the UI I could see its appeal and it mean that a lot of controls could be packed into a relatively small space. A ribbon bar, of course, is simply a megawidget with it children be compact versions of toobars, comboboxes and buttons.  Here a simple screen shot found on the web... And here a protype gnocl quivalent. The ribbon bar itself is simply a horizontal box into which table widgets are added. The table can then be given a group id and a title. In the example below the ribbon is contained within a notebook page.

New button options -orientation, -invert

The default settings for the gnocl::button are for the icon to be on the left and the label on the right. Not all  buttons need to be like this. Consider the toolbar button where the icon in above the label. These new options offer the programmer a little more flexibility when building a UI using Gnocl, especially when creating ribbon type containers. This is how the new settings look:  And the sample code: set hbox [gnocl::hBox]     set but1 [gnocl::button -text vertical -icon %#Info -data DATA -orientation vertical ] set but2 [gnocl::button -text vertical-invert -icon %#Info -data DATA -orientation vertical -invert 1] set but3 [gnocl::button -text horizontal -icon %#Info -data DATA ] set but4 [gnocl::button -text horizontal-invert -icon %#Info -data DATA -invert 1]     puts "but1 orientation = [$but1 cget -orientation]" puts "but3 orientation = [$but3 cget -orientation]" puts "but1 invert = [$but1 cget -invert]" puts "but2 invert

March Update

Again, some time has passed since the last post but still work is going on. It would appear that most of the runtime issues arising from compiling against the Gtk 2.24 libraries are now resolved. Here's the relevant notices from the project NEWS file. As always, latest distributables available from Sourceforge. 2020-02:    gnocl::labelText         o label now positions to topLeft by default         o set command now works         o cget -value also works (same as set command)    gnocl::labelEntry         o cget -label now works properly    gnocl::info         o added option "tmp", returns location of system temporary directory    gnocl::scale         o added -heightRequest and -widthRequest    gnocl::comboEntry         o new command: wordlist. Returns a list of items displayed in the pull-down menu.    gnocl::text         o problems with keywords "wordStart" and "wordEnd" now fixed         o new commands: backChars and forwardChars         o new ta