Showing posts from March, 2011


Added a pile of events handlers for this widget and uploaded to SF. Still having some problems with loading. These aren't Webkit problems but sure as hell don't see how I can stop the load process running smoothly without those nagging Bugzilla notifications!


gnocl::statusIcon docs

Just given the online docs a bit of attention. Basically there was no documentation of the signal handlers. Hopefully all is well.


Added a new gnocl widget today tickertape. Basically its a wrap around the marquee widget included in Chapter 11 of Krause's 'Foundations of Gtk Development'. Here's as screenshot and testscript:

#!/usr/bin/sh #\ exec tclsh "$0" "$@" package require Gnocl

gnocl::window -child [gnocl::tickerTape \     -baseFont {Sans 12 } \     -background white \     -speed 10 \     -message "Gnocl 0.9.95 * Gnocl 0.9.95 * Gnocl 0.9.95 * Gnocl 0.9.95 *"]


In response to a post made to the Tcler's wiki earlier this week, todays TLC was given to the gnocl::webKit package. Ok, its all still pretty well early stuff but the core navigation controls are there. Looking at things, perhaps the name of the core command should be changed to gnocl::webView. There are no docs yet, but all the key implemented options  and commands are used in the following test script.
# test-webkit.tcl
# Created by William J Giddings
# 26-Mar-11
# Description:

# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl
package require GnoclWebKit

proc gnocl::browser { {home} } {

    # create container
    set bx [gnocl::box -orientation vertical]

    # global $bx.tbar
    global ${bx}.wk
    global ${bx}.tbar
    global ${bx}.ent

    global ${bx}.home

    set ${bx}.home $home

    # create key components, toolbar and browse…


Just updated the docs page for this item. There's still much to do. This object is pretty complicated and so probably needs a tutorial page putting together too!

gnocl::accelarator -2

Module changes completed. Docs updated and NB refreshed.

gnocl::accelerator -1

Taking a look at this module. Now getting some TLC....

gnocl::action -2

Took another look at this code. Looking at what it does, its something of a legacy item from earlier versions and has is not integral to the overall gnocl widget set. Ok, the package will produce items, but this functionality is handled by other widget. The test code creates a menu item. Fine. That code binding already exists.  I'm certain that no-one has used the gnocl::action function, it hasn't been previously documented and, judging by the lack of functionality in the original code, there would have been feedback. So, I'll remove the module from the core.

gnocl::action -1

Did some more work on this module. But, I need some clearer idea of how this would be used in a script. Included for compatibility issues.

Updated DOCS -2

Updated the docs for the gnocl::aboutDialog. Some tidying up of the code was also needed too inoder to remove unwanted options inherited from the GtkWindow object. -Job Completed!

Updated DOCS-1

Gave some of the 'pages in progress' the TCL they deserved today. With the abscence of a doc page, its so easy to assume that a feature isn't present. So, completed the docs for the gnocl::ruler, gnoc::volumeButton and gnocl::curve objects. More to follow...

gnocl::fileChooserButton and gnocl::folderChooserButton

Seeing as I recently used the folderChooser as part of my JukeBox script, I decide to tidy-up the code and documentation for these objects. So, that's done!

Packing mplayer into a gnocl::socket container.

Ok, got the JukBox. What about some vids? Here's a quick experiment with mplayer. Worked ok.

#!./bin sh
exec tclsh "$0" "$@"

package require Gnocl

set socket [gnocl::socket]

set box [gnocl::box -orientation vertical]
$box add $socket -fill {1 1} -expand 1
gnocl::window -title "mplayer" -child $box -setSize 0.25


eval exec "mplayer -wid [format "0x%x" [$socket getID]] mdia0003.asf"

Reworked JukeBox

Reworked the JukeBox earlier today. Now uses a list and not buttons along with the option to change directories.


And, here's the revised code:

#--------------- # jukeBox.tcl #--------------- #!/bin/sh #\ exec tclsh "$0" "$@"
package require Gnocl
#--------------- # create playlist #--------------- proc playList { dir {type ogg} } {     global lst
    cd  $dir
    # clear the existing playlist     $lst erase 0 end
    set tracks ""     catch { set tracks [glob *.ogg] }
    if {$tracks == ""} {         makeUI [gnocl::fileChooserDialog \             -title "JukeBox: No tracks found. Select Collection Folder.." \             -action openFolder \             -currentFolder $dir ]     }
    foreach track [lsort $tracks] {         $lst add [list [list $track]]         } }
#--------------- # make ui #--------------- proc makeUI {dir} {     global lst
    cd $dir
    set cb [gnocl::folderChooserButton \         -title "JukeBox: Select Collection Folder"…

GtkStyles module

I've just taken a quick look at the doc packages for the gtk styles libs. These provide a way of painting widget elements to gtkwindows, the sort of sub-components required for making custom widgets. Right now, I'm not sure how bindings to this package would be used but they could be useful in the future. I'll add this to the "to do" list.

gnocl::entry undo

Started working on the undo/redo functionality for the entry widget. Looks as though it will be a cut-down and re-worked version of the code for the textview. The entry has only two signals and not four. Otherwise, it appears (?) straightforward enough.

Quick and easy gnocl based music jukebox

I don't like bloatware. I like things simple, like me. The media players that ship with our Distros are just too complicated and well, annoying. I wanted to listen to my favourite audio tracks whilst working this morning and was so fed up of fiddling with apps that I thought: "Gnocl has built-in sound playback, lets build a custom jukebox!". So, here it is.<br />

# playOGG.tcl
exec tclsh "$0" "$@"

package require Gnocl

set box [gnocl::box -orientation vertical]

set i 0
foreach track [lsort [glob *.ogg]] {
        set b($i) [gnocl::button \
                -icon %#Cdrom \
                -text $track \
                -onClicked "gnocl::sound \"$track\""]
        $box add $b($i)
        incr i

gnocl::window -child $box

REVIEW Tcl/Tk 8.5 Programming Cookbook

When I received my review copy of the Tcl/Tk 8.5 Programming Cookbook I was half expecting a rewrite of the manual -lists of features and functionality with little indication of how and when to use specific resources. I was wrong. Let me explain. A cookbook is something to turn to when you’ve run out of ideas or perhaps are looking to find some new way of tackling an old problem. Alternatively, cookbooks are for beginners and novices, those people who need to know how do something effectively and quickly. In this area the ‘Cookbook’ score points in every chapter.

Turn to any page in the text and you will find a clear, structure on how to use Tcl/Tk to resolve particular issues. There is a task statement, such as 'Creating a List’ in which a particular requirement is identified followed by 'How to Do It’ code snippet and 'Why it Works’ explanation. For someone new to Tcl programming this is an excellent approach.

Overall, the ‘Cookbook’ is organised over thirteen chapters w…

gnocl::window docs ammended

Did some work upating the documentation to the gnocl::window command. Just a well that I did, even I had forgotten some the options available! Still a bit more work to do though.

Setting the Gnome Desktop background

Spent some time looking at directly setting the desktop background under script control rather than through gconf. The latter gives a gradual transition between images suitable for slide shows but I'm still interested in setting backgrounds to the contents of image buffers. This means that I could embed a clock dial or custom slide show, messages etc into the background layer itself. The documentation is pretty aweful and because the API is *UNSTABLE* its not in the expected libgnomeui libraries but secreted away in its own, obscure package.

So far, I managed to load the image, convert it to a pixmap and then set it as the bg image. This only occasionally works. The code will run but then nothing happens. Ok, I'm sure that the code is running, but there must be a daemon control the background which needs to be negotiated with. I think that the 'right route' might be to save the pixbuf as an image, add it to the list of background images and then write to that.

Docs Uploaded

The latest version of the developer documentation has now been uploaded to SourceForge and can be obtained from here: