File: dscolor.tk

package info (click to toggle)
dstooltk 2.0-3
  • links: PTS
  • area: main
  • in suites: potato, slink
  • size: 2,500 kB
  • ctags: 3,169
  • sloc: ansic: 27,185; tcl: 4,770; makefile: 587; sh: 70; csh: 7
file content (45 lines) | stat: -rw-r--r-- 935 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#
# dscolor.tk
#

proc dscolor(build) name {
    global DsColor
    global Snap

    if [winfo exists .dscolor.cmd] {
        return
    }

    build_Title $name "DS Color"
    set cmd [build_CmdFrame $name cmd]

    set DsColor(pick_color) [ pm GET Color.Pick_Color_Choice ]

    for {set i 0} {$i < [expr [array size DsColor] -1]} {incr i} {
     
      radiobutton $cmd.rb$i \
		-text "" \
                -value $i \
                -foreground $DsColor($i)\
                -background $DsColor($i)\
                -anchor w\
                -variable DsColor(pick_color) \
		-command {dscolor(update)}
			    
      pack $cmd.rb$i -side left
    }

    build_DismissButtonbar $cmd dbbar "window(dismiss) dscolor"
   
    pack $cmd -fill x
    pm_to_tcl 
}

proc dscolor(update) {} {
    global DsColor

    puts "pick color index : $DsColor(pick_color)"

    pm PUT Color.Pick_Color_Choice $DsColor(pick_color)
    pm_to_tcl 
}