Monday, December 07, 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.



Tuesday, November 03, 2020

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_ configure -x [expr %X - [lindex %d 0]] -y [expr %Y - [lindex %d 1]] }
    $box add $eBox -fill 1 -expand 0
    rename $wid ${wid}_
    # overload the basic window object
    proc $wid { cmd args } {      
        set wid [lindex [::info level 0] 0]   
        switch $cmd {
            remove -
            add { [${wid}_ cget -child] $cmd {*}$args }
            default { ${wid}_ $cmd {*}$args }
            }
    }
    return $wid
}

Sunday, November 01, 2020

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.

Monday, October 19, 2020

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.

Friday, August 28, 2020

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.

Monday, July 20, 2020

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.

json_shell_utils.tcl