Documentation‎ > ‎Commands‎ > ‎

gnocl::resourceFile

Change default style and bindings for widgets.

Synopsis

gnocl::resourceFile fileName
 

Description

Reconfigure widget default style and bindings during run-time. This feature is to be used in conjuction with the -name widget option.

Sub-Commands

None.


Example


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

 package require Gnocl

 gnocl::resourceFile test.gtkrc

 set box [gnocl::box -orientation vertical]
 set ent [gnocl::entry -name entry -value test.gtkrc]

 $box add [list $ent] -fill {1 1} -expand 1
 set topl [gnocl::window -title "Resource File Test: test.gtkrc" -child $box -widthRequest 200 -heightRequest 150]

 gnocl::mainLoop


Where test.gtkrc is:


style "entry"
{
xthickness = 5
ythickness = 5
fg[ACTIVE] = "#FF0000"
fg[SELECTED] = "#003366"
fg[NORMAL] = "#CCCCCC"
fg[PRELIGHT] = "#FFFFFF"
fg[INSENSITIVE] = "#999999"
text[NORMAL] = { 0, 65536, 0}
base[NORMAL] = { 65536, 65536, 0}

bg[ACTIVE] = "#003366"
bg[SELECTED] = "#FF0000"
bg[NORMAL] = "#666666"
bg[PRELIGHT] = "#003366"
bg[INSENSITIVE] = "#666666"

font_name = "Sans Bold 14"
}

class "GtkEntry" style "entry"