Wednesday, May 25, 2011

pixbuf.c - new library functions

The Gtk way of drawing to pixbufs and drawable objects is through the use of Cairo. This is fine if you're working with screen objects or, you want nicely draw vector objects to build UI components. The use of the GdkPixbuf provides a convenient platform for a number of image manipulation operations. There are already some experimental filters in the gnocl core and today I added some extra functionality line and circle drawing plus flood fill. These are all pixel based and not anti-aliased but are lightning fast.

Sunday, May 22, 2011

gnocl::window -new options and commands

After a relatively quiet few days on the Gnocl front I added the following options and commands to the gnocl:window object.

-new commands
        hasFocus        return the name of the widget within the window that has 
                        the active keyboard input focus
        setFocus        set the focus to a named widget within the window
        present         bring a window to to the toplevel, deiconifying etc as 
                        necessary

-new option
        -defaultWidget  define which widget by default receives input focus


In addition to this, I've done some work to the gnocl::window online docs. This page has been in need of major updating for some time. So much new functionality has been added. There is still much to do, however. Most options are still 'TO BE COMPLETED' entries.

Finally, put the bare bits together to implement a Gnocl binding to the threads module.

Monday, May 09, 2011

Some ommisions and code slimming

Its good to get emails from users picking up various issues that need addressing in the gnocl core code. Just removed some redundant tests which were being applied to signal handlers found in the more recent widget additions.  There's also a FreeBSD port out there tool

http://www.freshports.org/x11-toolkits/gnocl

At last, perhaps the easiest way to create Gtk+ apps is getting the attention it deserves!


Sunday, May 01, 2011

gnocl::text -new tag options

Just added the following options to the text tag. Those which require string arguments are still stubs at the moment.

-marginAccumulate -backgroundFullHeight  -backgroundStipple
-direction -editable -foregroundStipple -indent -language
-leftMargin -name -pixelsInsideWrap -rightMargin -rise
-scale -tabs -variant -weight

Friday, April 29, 2011

gnocl::vte

In a recent post to the gnocl groupmail DMcC mentioned that he'd like to develop an app using the gnocl::vte package. This has been in need of some TLC for some while and, as I was watching the Royal Wedding online today (congratulations to Wills and Kate!!!) I decided to revisit the code. As I expected, much was to be done! I've added quite a lot of code to the module and have put the stubs in place for handling properties and signal handling. I've also reworked the base widget creation and begun to add some commands. Another 4hrs work and it should be complete!  Here's my test script:

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl
package require GnoclVTE

set vte [gnocl::vte ]

$vte configure \
    -allowBold 1

gnocl::window \
    -setSize 0.5 \
    -child $vte \
    -onDelete exit

$vte feed "mc\n"

#----------------------
set but1 [gnocl::button \
    -text Reset \
    -onClicked {
        $vte reset
        }]


gnocl::window -child $but1

gnocl::mainLoop

Thursday, April 28, 2011

bug killing! gnocl::text

Thanks to DMc for bug reports on the latest NB. Solved an issue arising from the gnocl::text search function, the interpreter would crash if the -tags option was not passed. This is now sorted and works well. The updated source and 32Bit linux builds are now available from SF.

Here's a test script.

#!/bin/sh
# the next line restarts using tclsh \
exec tclsh "$0" "$@"

package require Gnocl

set box(1) [gnocl::box -orientation vertical]

set find [gnocl::entry]
$find configure \
    -primaryIcon "%#Clear" \
    -secondaryIcon "%#Find" \
    -variable findString \
    -onIconPress {
        switch %p {
            primary {
                set findString ""
                $txt tag delete tag_find
                }
            secondary {
                $txt tag delete tag_find
                $txt tag create tag_find -foreground red
                $txt search $findString -tags tag_find
                }
            }
        }

set txt [gnocl::text -wrapMode word]
$txt lorem

$box(1) add $find -fill {1 0}
$box(1) add $txt -fill {1 1} -expand 1
gnocl::window -child $box(1)


Tuesday, April 26, 2011

gnocl::sound

Some issues have arisen over the inclusion of the gnocl::sound command within the main gnocl module itself. The command relies upon the presence of the libcanberra libaries which provide the front end for Gnome audiothemes. As libcanberra may not be installed on all systems, the decision has been made to move the command to the gnoclGnome package on the basis that the command relies upon Gnome dependencies.

Whilst gnocl::sound plays ogg audio files by default, those users who wish to play audio/video files are directed towards the multi-platform mplayer package.


json_shell_utils.tcl