home *** CD-ROM | disk | FTP | other *** search
/ ARM Club 3 / TheARMClub_PDCD3.iso / hensa / maths / plplot / plplot_2 / drivers / tk / pldefaults < prev    next >
Encoding:
Text File  |  1994-06-17  |  5.4 KB  |  153 lines

  1. # $Id: pldefaults.tcl,v 1.3 1994/06/17 21:22:15 mjl Exp $
  2. # $Log: pldefaults.tcl,v $
  3. # Revision 1.3  1994/06/17  21:22:15  mjl
  4. # Removed check for color system before setting resources.  Eliminates some
  5. # problems with the Tk/DP drivers on mono displays.
  6. #
  7. # Revision 1.2  1994/04/25  18:50:18  mjl
  8. # Added resource setting for scale fonts (used in palette widgets).
  9. # Also added variables governing fast and faster scrolling speed.
  10. #
  11. # Revision 1.1  1994/04/08  12:07:31  mjl
  12. # Proc to set up defaults.  Should not be modified by the user (use
  13. # plconfig instead).
  14. #
  15. #----------------------------------------------------------------------------
  16. # pldefaults.tcl
  17. #
  18. # Sets default configuration options for plplot/TK driver.
  19. # Maurice LeBrun
  20. # IFS, University of Texas
  21. #
  22. # This is largely based on options.motif.tk from Ioi K Lam's Tix package.
  23. # The TK options are set to be fairly Motif-like.
  24. #
  25. # It is very easy to customize plplot/TK settings for a particular site
  26. # or user.  The steps are:
  27. #
  28. # 1. Copy the desired settings from here into the plconfig proc in
  29. #    plconfig.tcl, modifying them to taste
  30. #
  31. # 2. Deposit the modified plconfig.tcl in the desired directory for
  32. #    autoloading. The autoload path used by the TK driver and plserver is
  33. #    as follows:
  34. #
  35. #     user-specified directory(s) (set by -auto_load argument)
  36. #     Current directory
  37. #     $PL_LIBRARY 
  38. #     $HOME/tcl
  39. #     INSTALL_DIR/tcl
  40. #
  41. # 3. Create a tclIndex file for plconfig.tcl in the same directory.  I
  42. #    use an alias that makes this easy:
  43. #
  44. #    alias mktclidx  "echo 'auto_mkindex . *.tcl; destroy .' | wish"
  45. #
  46. #    Then just "mktclidx" will do the trick.
  47. #
  48. #
  49. # This scheme allows for a clear and easy way to selectively modify
  50. # defaults on a site, user, or project dependent basis (more easily than
  51. # can be done with resources alone).
  52. #
  53. #----------------------------------------------------------------------------
  54.  
  55. proc pldefaults {} {
  56.     global dialog_font
  57.     global dialog_bold_font
  58.  
  59. # Font-related resources.
  60.  
  61.     set gen_font        -*-helvetica-medium-r-normal-*-*-180-*
  62.     set gen_bold_font        -*-helvetica-bold-r-normal-*-*-180-*
  63.     set gen_menu_font        -*-helvetica-medium-o-normal-*-*-180-*
  64.     set gen_italic_font        -*-helvetica-bold-o-normal-*-*-180-*
  65.     set gen_font_small        -*-helvetica-medium-r-normal-*-*-120-*
  66.     set gen_bold_font_small    -*-helvetica-bold-r-normal-*-*-120-*
  67.     set gen_fixed_font        -*-courier-medium-r-normal-*-*-180-*
  68.  
  69.     set dialog_font        -*-times-medium-r-normal-*-*-180-*
  70.     set dialog_bold_font    -*-times-bold-r-normal-*-*-180-*
  71.  
  72.     option add *font        $gen_font
  73.     option add *Entry.font    $gen_font
  74.     option add *Menu*font    $gen_menu_font
  75.     option add *Menubutton*font    $gen_menu_font
  76.     option add *Scale.font    $gen_bold_font_small
  77.     option add *color.font    $gen_fixed_font
  78.  
  79. #----------------------------------------------------------------------------
  80. # Color-related resources. 
  81. # Sets colors in a Motif-like way.
  82. # It doesn't actually hurt to do this if not on a color system.
  83.  
  84.     set gen_bg        lightgray
  85.     set gen_fg        black
  86.     set gen_darker_bg    gray
  87.     set gen_darker_fg    black
  88.     set gen_active_bg    $gen_bg
  89.     set gen_active_fg    $gen_fg
  90.  
  91.     option add *background            $gen_bg
  92.     option add *foreground            $gen_fg
  93.     option add *activeBackground              $gen_active_bg
  94.     option add *activeForeground              $gen_active_fg
  95.     option add *disabledForeground        gray45
  96.     option add *Checkbutton.selector        yellow
  97.     option add *Radiobutton.selector        yellow
  98.     option add *Entry.background        #c07070
  99.     option add *Entry.foreground        black
  100.     option add *Entry.insertBackground        black
  101.     option add *Listbox.background        $gen_darker_bg
  102.     option add *Scale.foreground        $gen_fg
  103.     option add *Scale.activeForeground        $gen_bg
  104.     option add *Scale.background        $gen_bg
  105.     option add *Scale.sliderForeground        $gen_bg
  106.     option add *Scale.sliderBackground        $gen_darker_bg
  107.     option add *Scrollbar.foreground        $gen_bg
  108.     option add *Scrollbar.activeForeground    $gen_bg
  109.     option add *Scrollbar.background        $gen_darker_bg
  110.  
  111. # End of page indicator
  112.  
  113.     option add *leop.off            $gen_bg
  114.     option add *leop.on                gray45
  115.  
  116. # This specifies the default plplot widget background color.
  117. # A white background looks better on grayscale or mono.
  118.  
  119.     if {[tk colormode .] == "color"} {
  120.     option add *plwin.background        black
  121.     } else {
  122.     option add *plwin.background        white
  123.     }
  124.  
  125. #----------------------------------------------------------------------------
  126. # Miscellaneous 
  127.  
  128.     option add *anchor                w
  129.     option add *Button.borderWidth            2
  130.     option add *Button.anchor            c
  131.     option add *Checkbutton.borderWidth        2
  132.     option add *Radiobutton.borderWidth        2
  133.     option add *Label.anchor            w
  134.     option add *Labelframe.borderWidth        2
  135.     option add *Entry.relief            sunken
  136.     option add *Scrollbar.relief        sunken
  137.  
  138. # Key shortcut definitions -- change them if you want!
  139. # Turn them into an empty string to disable.
  140.  
  141.     global key_zoom_select;    set key_zoom_select    "z"
  142.     global key_zoom_reset;    set key_zoom_reset    "r"
  143.     global key_print;        set key_print        "p"
  144.     global key_save_again;    set key_save_again    "s"
  145.     global key_scroll_right;    set key_scroll_right    "Right"
  146.     global key_scroll_left;    set key_scroll_left    "Left"
  147.     global key_scroll_up;    set key_scroll_up    "Up"
  148.     global key_scroll_down;    set key_scroll_down    "Down"
  149.     global key_scroll_slow;    set key_scroll_slow    "3"
  150.     global key_scroll_fast;    set key_scroll_fast    "15"
  151.     global key_scroll_faster;    set key_scroll_faster    "75"
  152. }
  153.