晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
Server : Apache System : Linux srv.rainic.com 4.18.0-553.47.1.el8_10.x86_64 #1 SMP Wed Apr 2 05:45:37 EDT 2025 x86_64 User : rainic ( 1014) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /lib64/tcl8.6/Tix8.4.3/pref/ |
Upload File : |
One of the bad things about Tk/Tkinter is that it does not pick up
the current color and font scheme from the prevailing CDE/KDE/GNOME/Windows
window manager scheme.
One of the good things about Tk/Tkinter is that it is not tied to one
particular widget set so it could pick up the current color and font scheme
from the prevailing CDE/KDE/GNOME/Windows window manager scheme.
The WmDefault package is for making Tk/Tkinter applications use the
prevailing CDE/KDE/GNOME/Windows scheme. It tries to find the files
and/or settings that the current window manager is using, and then
sets the Tk options database accordingly (plus a few other things as well).
DOWNLOAD
--------
Download the latest version of wm_default from http://tix.sourceforge.net
either as a part of the standard Tix distribution, or as a part of the
Tix Applications: http://tix.sourceforge.net/Tide. wm_default does not
require Tix, but is Tix enabled.
USAGE:
------
For Tix versions 8.1.2 and above from http://tix.sourceforge.net,
WmDefault is the default Tix scheme, so there is nothing else to do.
For Tk applications, it should be sufficent at the beginning of a wish
app to simply:
package require wm_default
wm_default::setup
wm_default::addoptions
The process is divided into 2 steps:
1) find the files and/or settings (::wm_default::setup).
This is complete for Windows, pretty good for KDE and CDE, and
still barely supported for GNOME because of the difficulty
of finding and parsing sawfish definition files.
setup takes one optional argument: wm, the name of the window manager
as a string, if known. One of: windows gnome kde1 kde2 cde.
2) Setting the Tk options database (::wm_default::addoptions).
You can override the settings in 1) by adding your values to the call
to addoptions:
::wm_default::addoptions -foreground red -background blue
You can examine the settings with
::wm_default::getoptions
which returns a Tcl array of the current settings, and
::wm_default::parray
which returns a string of the current settings, one value-pair per line.
There are a number of assumptions built into the heuristics of addoptions,
that may need fine tuning. Post patches to http://tix.sourceforge.net.
PYTHON
______
If you are using Tix versions 8.1.2 and above from http://tix.sourceforge.net
with Python 2.1 and above, WmDefault is the default Tix scheme,
so there is nothing else you need to do.
The easiest way to install WmDefault for Tkinter is to copy the WmDefault.*
AND THE FILE pkgIndex.tcl from lib/tix8.1/pref to a directory on your
PYTHONPATH. Then the following should work:
import Tkinter
root = Tkinter.Tk()
import WmDefault
WmDefault.setup(root)
WmDefault.addoptions(root, {'foreground': 'red'})
print WmDefault.getoptions(root)
SETTINGS
--------
Here is a list of all the settings controlled by WmDefault:
wm - one of windows gnome kde1 kde2 cde kde
background
foreground
disabledforeground
disabledbackground
textfamily
systemfamily
menufamily
fixedfamily
fontsize - in pixels under Unix, in points under Windows
textbackground
textforeground
disabledtextbackground
selectbackground
selectforeground
selectcolor
highlightcolor
highlightbackground
scrollbars - scrollbar trough color
borderwidth
priority
menubackground
menuforeground
activebackground
activeforeground
system_font - a Tcl font spec, a list of family size weight
menu_font
fixed_font
text_font
linkcolor - not working completely yet
vlinkcolor
alinkcolor
TO MAKE A PREVIOUS TIX USE THIS AS THE DEFAULT SCHEME:
------------------------------------------------------
1) Compile Tix with
-DTIX_DEF_SCHEME "WmDefault"
-DTIX_DEF_FONTSET "WmDefault"
or change the defines in generic/tixInit.c
#define TIX_DEF_SCHEME "WmDefault"
#define TIX_DEF_FONTSET "WmDefault"
2) Edit the installed lib/8.1/Tix.tcl and change the -configspec
in tixClass tixAppContext with the following
{-fontset WmDefault}
{-scheme WmDefault}
3) Copy the files WmDefault.* AND pkgIndex.tcl to the installed
lib/tix8.1/pref
4) Make or edit the file lib/tix8.1/pkgIndex.tcl and add the lines
package ifneeded wm_default 1.0 \
[list source [file join $dir pref WmDefault.tcl]]