Version 1 of WISH Color Picker Plus

Updated 2007-07-15 22:52:53 by pa_mcclamrock

WISH Color Picker Plus megawidget

        http://www.geocities.com/pa_mcclamrock/

http://www.geocities.com/pa_mcclamrock/wishcolorplus.gif

WISH Color Picker Plus is a fairly versatile megawidget for applying user-selected color schemes to Tk applications. After downloading and unwrapping the "wishcolorplus.tcl.tar.gz" archive, just put some code like this in your application:

 # Use WISH Color Picker Plus for color configuration
 # (It sets color variables with default values;
 # values may then be changed by configuration files):

 source [file join $libdir wishcolorplus.tcl]

 # Use some of the specified color variables:

 tk_setPalette background $winback foreground $winfore selectBackground \
        $selback selectForeground $selfore

After all your Tk widgets have been created, insert some code like this, obviously substituting your widget names for mine. (I haven't figured out how to automate the creation of the widget lists yet, but give me time.)

 # Lists of widgets (to add to lists originally set
 # by WISH Color Picker Plus):

 # Regular buttons:
 foreach butt [list .special .clear .pick .top .up .home .colo .view .edit] {
        lappend buttlist $butt
        $butt configure -bg $buttback -fg $buttfore
 }

 # Listboxes:
 foreach lub [list .sublist .filnamo .contexto] {
        lappend lublist $lub
        $lub configure -bg $listback -fg $listfore
 }

 # Entry widgets and spinboxes:
 foreach row [range 2 to 7] {
        foreach ent [list .ent($row,0) .ent($row,1) .ent($row,2)] {
                lappend entlist $ent
                $ent configure -bg $entback -fg $entfore
        }
 }

 foreach row [range 1 to 6] {
        foreach ent [list .tib($row,0) .tib($row,1) .tib($row,2)] {
                lappend entlist $ent
                $ent configure -bg $entback -fg $entfore
        }
 }

 foreach ent [list .wordcount .fracker .topent] {
        lappend entlist $spin
        $ent configure -bg $entback -fg $entfore
 }

 # Emphasized labels:
 foreach head [list .what .where .searchline .searchnum .ofnum \
        .foundnum .fileo .conto] {
        lappend headlist $head
        $head configure -bg $headback -fg $headfore
 }

 # Light labels (I don't have any of these in the app I took this code from):
 foreach light [list] {
        lappend lightlist $light
        $light configure -bg $lightback -fg $lightfore
 }

 # Radiobuttons and checkbuttons:
 foreach reg [list .titlonly .keyword .full .words .frac .all .some .none \
        .expert .match .hid .spurt .matchmeet] {
        lappend regradiolist $reg
        $reg configure -selectcolor $regradio
 }

This will apply the colors from a color configuration file in the user's ~/.wishes directory (or else the bland default colors), and it will line up all the widgets to have the user's color modifications applied to them. WISH Color Picker Plus comes with several color schemes, which the user can apply, modify, or delete. (The color scheme above is called "Mama Rose"--my wife's favorite.)


Category Dev. Tools