home *** CD-ROM | disk | FTP | other *** search
/ Freelog Special Freeware 31 / FreelogHS31.iso / Texte / scribus / scribus-1.3.3.9-win32-install.exe / tcl / tix8.1 / pref / WmDefault.txt < prev   
Text File  |  2001-12-04  |  4KB  |  143 lines

  1. One of the bad things about Tk/Tkinter is that it does not pick up
  2. the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows 
  3. window manager scheme.
  4.  
  5. One of the good things about Tk/Tkinter is that it is not tied to one
  6. particular widget set so it could pick up the current color and font scheme 
  7. from the prevailing CDE/KDE/GNOME/Windows window manager scheme.
  8.  
  9. The WmDefault package is for making Tk/Tkinter applications use the 
  10. prevailing CDE/KDE/GNOME/Windows scheme. It tries to find the files
  11. and/or settings that the current window manager is using, and then
  12. sets the Tk options database accordingly (plus a few other things as well). 
  13.  
  14.  
  15. DOWNLOAD
  16. --------
  17.  
  18. Download the latest version of wm_default from http://tix.sourceforge.net
  19. either as a part of the standard Tix distribution, or as a part of the
  20. Tix Applications: http://tix.sourceforge.net/Tide. wm_default does not
  21. require Tix, but is Tix enabled.
  22.  
  23.  
  24. USAGE:
  25. ------
  26.  
  27. For Tix versions 8.1.2 and above from http://tix.sourceforge.net,
  28. WmDefault is the default Tix scheme, so there is nothing else to do.
  29.  
  30. For Tk applications, it should be sufficent at the beginning of a wish
  31. app to simply:
  32.  
  33.         package require wm_default
  34.         wm_default::setup
  35.         wm_default::addoptions
  36.  
  37. The process is divided into 2 steps:
  38.  
  39. 1) find the files and/or settings (::wm_default::setup).
  40.    This is complete for Windows, pretty good for KDE and CDE, and
  41.  still barely supported for GNOME because of the difficulty
  42.  of finding and parsing sawfish definition files.
  43.  setup takes one optional argument: wm, the name of the window manager
  44.  as a string, if known. One of: windows gnome kde1 kde2 cde.
  45.  
  46. 2) Setting the Tk options database (::wm_default::addoptions).
  47. You can override the settings in 1) by adding your values to the call
  48. to addoptions:
  49.    ::wm_default::addoptions -foreground red -background blue
  50.  
  51. You can examine the settings with
  52.     ::wm_default::getoptions
  53. which returns a Tcl array of the current settings, and
  54.     ::wm_default::parray
  55. which returns a string of the current settings, one value-pair per line.
  56.  
  57. There are a number of assumptions built into the heuristics of addoptions,
  58. that may need fine tuning. Post patches to http://tix.sourceforge.net.
  59.  
  60.  
  61. PYTHON
  62. ______
  63.  
  64. If you are using Tix versions 8.1.2 and above from http://tix.sourceforge.net
  65. with Python 2.1  and above, WmDefault is the default Tix scheme, 
  66. so there is nothing else you need to do.
  67.  
  68. The easiest way to install WmDefault for Tkinter is to copy the WmDefault.*
  69. AND THE FILE pkgIndex.tcl from lib/tix8.1/pref to a directory on your
  70. PYTHONPATH. Then the following should work:
  71.  
  72.         import Tkinter
  73.         root = Tkinter.Tk()
  74.         import WmDefault
  75.         WmDefault.setup(root)
  76.         WmDefault.addoptions(root, {'foreground': 'red'})
  77.         print WmDefault.getoptions(root)
  78.  
  79.  
  80. SETTINGS
  81. --------
  82.  
  83. Here is a list of all the settings controlled by WmDefault:
  84.     wm              - one of windows gnome kde1 kde2 cde kde
  85.     background        
  86.     foreground        
  87.     disabledforeground        
  88.     disabledbackground        
  89.     textfamily            
  90.     systemfamily        
  91.     menufamily             
  92.     fixedfamily        
  93.     fontsize        - in pixels under Unix, in points under Windows
  94.     textbackground        
  95.     textforeground        
  96.     disabledtextbackground        
  97.     selectbackground        
  98.     selectforeground        
  99.     selectcolor        
  100.     highlightcolor        
  101.     highlightbackground        
  102.     scrollbars        - scrollbar trough color
  103.     borderwidth        
  104.     priority        
  105.     menubackground        
  106.     menuforeground        
  107.     activebackground        
  108.     activeforeground        
  109.     system_font         - a Tcl font spec, a list of family size weight
  110.     menu_font         
  111.     fixed_font         
  112.     text_font         
  113.     linkcolor        - not working completely yet
  114.     vlinkcolor
  115.     alinkcolor
  116.  
  117.  
  118.  
  119. TO MAKE A PREVIOUS TIX USE THIS AS THE DEFAULT SCHEME:
  120. ------------------------------------------------------
  121.  
  122. 1) Compile Tix with 
  123.     -DTIX_DEF_SCHEME "WmDefault"
  124.     -DTIX_DEF_FONTSET "WmDefault"
  125. or change the defines in generic/tixInit.c 
  126.  
  127. #define TIX_DEF_SCHEME "WmDefault"
  128. #define TIX_DEF_FONTSET "WmDefault"
  129.  
  130. 2) Edit the installed lib/8.1/Tix.tcl and change the -configspec 
  131. in tixClass tixAppContext with the following
  132.     {-fontset            WmDefault}
  133.     {-scheme             WmDefault}
  134.  
  135. 3) Copy the files WmDefault.* AND pkgIndex.tcl to the installed
  136.    lib/tix8.1/pref
  137.  
  138. 4) Make or edit the file lib/tix8.1/pkgIndex.tcl and add the lines
  139.  
  140. package ifneeded wm_default 1.0 \
  141.     [list source [file join $dir pref WmDefault.tcl]]
  142.  
  143.