Adding Individual Database Entries

   

Practical Programming in Tcl & Tk, Third Edition
By Brent B. Welch

Table of Contents
Chapter 28.  The Resource Database


You can enter individual database entries with the option add Tcl command. This is appropriate to handle special cases, or if you do not want to manage a separate per application resource specification file. The command syntax is:

 option add pattern value ?priority? 

The priority is the same as that used with option readfile. The pattern and value are the same as in the file entries, except that the key does not have a trailing colon when specified in an option add command. If value contains spaces or special characters, you will need to group it like any other argument to a Tcl command. Some of the specifications from the last example could be added as follows:

 option add *foreground black option add *selectBackground #bfdfff 

You can clear the option database:

 option clear 

However, on UNIX the database will be initialized from your ~/.Xdefaults file, or the RESOURCE_MANAGER property on the root window, the next time the database is accessed.


       
    Top
     



    Practical Programming in Tcl and Tk
    Practical Programming in Tcl and Tk (4th Edition)
    ISBN: 0130385603
    EAN: 2147483647
    Year: 1999
    Pages: 478

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net