Skip to main content

Posts

Showing posts from 2016

November Source Enhancements

The following enhancements were made to the gnocl core during November, expanding the ability to configure and extract settings from a number of key widgets. 2016-11:     gnocl::list         o added -textColor and -gridLines, available options: none, horizontal, vertical, or both.         o added column options: -spacing, -sortIndicator, -expand, -fixedWidth, -sortId, -sortOrder         o added cel options: -xAlign, -yAlign, -sensitive     gnocl::tree / gnocl::list         o added getRow subcommand, implemented cget -titles functionality.         o new options -horizontalSeparator and -verticalSeparator     gnocl::fontSelectionDialog         o -title option now works correctly.     gnocl::entry         o added -textColo...

October Source Enhancements

During October the following areas of functionality were added to the development sources.   2016-10:     New commands: gnocl::buttonBox, gnocl::vButtonBox and gnocl::hButtonBox.     gnocl::fontButton, gnocl::table         o added -widthRequest, -heightRequest     gnocl::box/vBox/hBox         o calling cget -children now works if box -label options set (ie, box in a frame)         o added -onDestroy, enable clearup on TCL side following widget destruction     gnocl::table         o added parent command

Recent changes to the development sources

The last time the recent changes were posted was sometime during March this year.  So, to put matters right, here's a list of the recent changes. Mostly enhancements plus one or two bug fixes. 2016-09:     gnocl::tree & gnocl::list         o added -textColor and -textColour     gnocl::text         o new command, wordCount, return size of buffer in words.         o new command, magnify. Increase/decrease basefont height by specified amount in pixels (e.g. 1 or -1), or "reset", to set to default.     gnocl::box, gnocl::vBox, gnocl::hBox         o new command, getPos. Returns postilion of child widget packed into box, or -1 if not found.     gnocl::entry         o improved error checking to the -innerBorder option, a list of 4 integers must be supplied.   ...

GnoclSpellCheck

The earlier version of the GnoclSpellCheck module as developed on my ancient 32-bit workstation running OpenSuse 11.2 (yes, I said that it was ancient). The problem arising from using legacy equipment is that when packages like Gnocl are developed, not only can various elements cease to work (i.e GtkSpell 2 does not run at all on a Gnome 3 desktop or under Ubuntu Mate) but later libraries such as GtkSpell 3 are complete re-writes and can, as I've found, have their own bugs! A new Gnome speller, gspell is under development but this requires the bleeding edge Gtk3 libraries which, apart from being incompatible with the Gtk+2 libraries against which Gnocl is built, these latest versions are not currently part of the stable releases. So, I thought, build my own. So, I did. Rather than using the C-api for either Ispell, Aspell or Hunspell, I've just used a simple data pipe. These three packages give varying suggestions for misspelt words so, the eventual front end will enable the us...

Hidden Bugs... The Real Nighmare!!!!

Have you every had to fix a leaking flat roof? A strange question to ask on programming blog. But there's mileage in this simile. You see, when a flat root shows signs of leaking, its on the inside of the building, where the water comes out, not where it goes in. In other words, you can see the effect, but not the cause. Moreover, the effects of a leaky roof are cumulative, not immediate. I've just fixed an intermittent crash in the gnocl core module when complex dialog layouts holding multiple buttons are closed. There was nothing wrong with the C code or Tcl scripts, each were grammatically correct, but still the crashes occur with the typical segmentation error being reported. This is indicative of the free() function attempting to release unused memory but the code uses g_free() which has some built in protection, i.e. it returns if the memory pointer is NULL. The problem was resolved by commented out one of the g_free lines in the button.c module buttonDestroyFunc....

Simplifying the use of the Progress Bar.

The basic implementation of the progressBar widget allows the setting of the "fraction" property of the GtkProgressBar but using this options requires more on the Tcl-side than it needs to. Combination of the new options -range and -steps along with the new sub-commands step, incr and reset help to simplify matters. For simple lists use the step subcommand along with the the -steps option to indicate the progress of a small, known number of steps where feedback on the completion of each step is required. Setting the -steps option to 10, for example, will set the widget "fraction" property to 0.1 (1/10, i.e. 10%). Following this each time the step sub-command is called, the widget bar will expand in length by 10% until it reaches 100%. The step sub-command accepts an additional argument which will set the text content of the bar.     set modules [list \         apple.tcl \         blackberry.tcl ...

gnocl::toolPalette -now implemented

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 AA...

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.

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...