Minsky
createIcons.tcl
Go to the documentation of this file.
1 source library/init.tcl
2 use_namespace minsky
3 GUI
4 
5 minsky.histogramResource.setResource icons/histogram.svg
6 
7 # create gif icons for the Macintosh, see ticket #187
8 set ops [availableOperations]
9 lappend ops "switch"
10 foreach op $ops {
11  # ignore some operations
12  switch $op {
13  "numOps" -
14  "constant" -
15  "copy" -
16  "ravel" -
17  "integrate" continue
18  }
19  image create photo [set op]Img -width 30 -height 24
20  operationIcon [set op]Img "$op"
21  # I don't like the hardcoded background value here, but the
22  # transparent icons appear ghastly on the Mac. The value #f0f0f0
23  # is a resonable compormise
24  #[set op]Img write icons/$op.gif -background #f0f0f0 -format gif
25  [set op]Img write icons/tmp.ppm -background #f0f0f0 -format ppm
26  catch {exec -- ppmtogif -transparent #f0f0f0 icons/tmp.ppm > icons/$op.gif}
27 }