Gnocl EntryIcons

WJG (09/04/11) The Gtk+ Entry widget has a lots of interesting enhancements which have now been implemented within the Gnocl core code. The following script shows how to create embedded icons and progress bar functionality. Here's a snapshot!

https://lh5.googleusercontent.com/_yaFgKvuZ36o/TZeEZjc_SGI/AAAAAAAAA6g/ATBOdTnCMhY/s800/Screenshot-EntryIcons.png

And the script itself:

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

package require Gnocl

proc buttonRelease {w t p} {
   if {$p == "primary"} {
      $w configure -value "Gnocl Entry Widget"
   }
   if {$p == "secondary"} {
      $w configure -value ""
   }
}

set ent [gnocl::entry \
   -tooltip "HIDIHI" \
   -secondaryIconTooltip "Clear Entry Contents" \
   -hasFrame 0 \
   -primaryIcon "%#New" \
   -secondaryIcon "%#Clear" \
   -onIconPress {puts "PRESS %w %t %p"} \
   -onIconRelease { buttonRelease %w %t %p } \
   -onPreeditChanged {puts "preeditChanged %t"} \
   -secondaryIconSensitive 1 \
   -pulseStep 0.15]

gnocl::window -child $ent -title EntryIcons

gnocl::update

if {1} {
set d 0.05
for {set i 0} {$i < 20} {incr i} {
   $ent progress [expr $i * $d]
   gnocl::update
   after 100
}

$ent progress 0.0
}


if {1} {
for {set i 0} {$i < 20} {incr i} {
   $ent pulse
   after 100
   gnocl::update
}

$ent progress 0.0
}