晋太元中,武陵人捕鱼为业。缘溪行,忘路之远近。忽逢桃花林,夹岸数百步,中无杂树,芳草鲜美,落英缤纷。渔人甚异之,复前行,欲穷其林。 林尽水源,便得一山,山有小口,仿佛若有光。便舍船,从口入。初极狭,才通人。复行数十步,豁然开朗。土地平旷,屋舍俨然,有良田、美池、桑竹之属。阡陌交通,鸡犬相闻。其中往来种作,男女衣着,悉如外人。黄发垂髫,并怡然自乐。 见渔人,乃大惊,问所从来。具答之。便要还家,设酒杀鸡作食。村中闻有此人,咸来问讯。自云先世避秦时乱,率妻子邑人来此绝境,不复出焉,遂与外人间隔。问今是何世,乃不知有汉,无论魏晋。此人一一为具言所闻,皆叹惋。余人各复延至其家,皆出酒食。停数日,辞去。此中人语云:“不足为外人道也。”(间隔 一作:隔绝) 既出,得其船,便扶向路,处处志之。及郡下,诣太守,说如此。太守即遣人随其往,寻向所志,遂迷,不复得路。 南阳刘子骥,高尚士也,闻之,欣然规往。未果,寻病终。后遂无问津者。
|
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 : /proc/thread-self/root/usr/share/tk8.6/demos/ |
Upload File : |
# toolbar.tcl --
#
# This demonstration script creates a toolbar that can be torn off.
if {![info exists widgetDemo]} {
error "This script should be run from the \"widget\" demo."
}
package require Tk
set w .toolbar
destroy $w
toplevel $w
wm title $w "Toolbar Demonstration"
wm iconname $w "toolbar"
positionWindow $w
ttk::label $w.msg -wraplength 4i -text "This is a demonstration of how to do\
a toolbar that is styled correctly and which can be torn off. The\
buttons are configured to be \u201Ctoolbar style\u201D buttons by\
telling them that they are to use the Toolbutton style. At the left\
end of the toolbar is a simple marker that the cursor changes to a\
movement icon over; drag that away from the toolbar to tear off the\
whole toolbar into a separate toplevel widget. When the dragged-off\
toolbar is no longer needed, just close it like any normal toplevel\
and it will reattach to the window it was torn off from."
## Set up the toolbar hull
set t [frame $w.toolbar] ;# Must be a frame!
ttk::separator $w.sep
ttk::frame $t.tearoff -cursor fleur
ttk::separator $t.tearoff.to -orient vertical
ttk::separator $t.tearoff.to2 -orient vertical
pack $t.tearoff.to -fill y -expand 1 -padx 2 -side left
pack $t.tearoff.to2 -fill y -expand 1 -side left
ttk::frame $t.contents
grid $t.tearoff $t.contents -sticky nsew
grid columnconfigure $t $t.contents -weight 1
grid columnconfigure $t.contents 1000 -weight 1
## Bindings so that the toolbar can be torn off and reattached
bind $t.tearoff <B1-Motion> [list tearoff $t %X %Y]
bind $t.tearoff.to <B1-Motion> [list tearoff $t %X %Y]
bind $t.tearoff.to2 <B1-Motion> [list tearoff $t %X %Y]
proc tearoff {w x y} {
if {[string match $w* [winfo containing $x $y]]} {
return
}
grid remove $w
grid remove $w.tearoff
wm manage $w
wm protocol $w WM_DELETE_WINDOW [list untearoff $w]
}
proc untearoff {w} {
wm forget $w
grid $w.tearoff
grid $w
}
## Toolbar contents
ttk::button $t.button -text "Button" -style Toolbutton -command [list \
$w.txt insert end "Button Pressed\n"]
ttk::checkbutton $t.check -text "Check" -variable check -style Toolbutton \
-command [concat [list $w.txt insert end] {"check is $check\n"}]
ttk::menubutton $t.menu -text "Menu" -menu $t.menu.m
ttk::combobox $t.combo -value [lsort [font families]] -state readonly
menu $t.menu.m
$t.menu.m add command -label "Just" -command [list $w.txt insert end Just\n]
$t.menu.m add command -label "An" -command [list $w.txt insert end An\n]
$t.menu.m add command -label "Example" \
-command [list $w.txt insert end Example\n]
bind $t.combo <<ComboboxSelected>> [list changeFont $w.txt $t.combo]
proc changeFont {txt combo} {
$txt configure -font [list [$combo get] 10]
}
## Some content for the rest of the toplevel
text $w.txt -width 40 -height 10
interp alias {} doInsert {} $w.txt insert end ;# Make bindings easy to write
## Arrange contents
grid $t.button $t.check $t.menu $t.combo -in $t.contents -padx 2 -sticky ns
grid $t -sticky ew
grid $w.sep -sticky ew
grid $w.msg -sticky ew
grid $w.txt -sticky nsew
grid rowconfigure $w $w.txt -weight 1
grid columnconfigure $w $w.txt -weight 1
## See Code / Dismiss buttons
set btns [addSeeDismiss $w.buttons $w]
grid $btns -sticky ew