aboutsummaryrefslogtreecommitdiff
path: root/demos/zinc-widget
diff options
context:
space:
mode:
authorlecoanet2003-03-28 17:36:34 +0000
committerlecoanet2003-03-28 17:36:34 +0000
commit11d300cf2d4d7c0da508ff27534c14261d5043a0 (patch)
tree35ff0c0185d755c6d52dcacf958bd587c55739b4 /demos/zinc-widget
parent7a103bee4cda4532e237522e72f6a7d7e81e6839 (diff)
downloadtkzinc-11d300cf2d4d7c0da508ff27534c14261d5043a0.zip
tkzinc-11d300cf2d4d7c0da508ff27534c14261d5043a0.tar.gz
tkzinc-11d300cf2d4d7c0da508ff27534c14261d5043a0.tar.bz2
tkzinc-11d300cf2d4d7c0da508ff27534c14261d5043a0.tar.xz
Ajout de plusieurs demos et remaniement
Diffstat (limited to 'demos/zinc-widget')
-rw-r--r--demos/zinc-widget64
1 files changed, 37 insertions, 27 deletions
diff --git a/demos/zinc-widget b/demos/zinc-widget
index edc57e8..d468e3e 100644
--- a/demos/zinc-widget
+++ b/demos/zinc-widget
@@ -11,7 +11,7 @@ set zincRoot [file join [file dirname [info script]] ..]
# And adjust the paths accordingly.
#
lappend auto_path $zincRoot
-set tk_library $zincRoot
+set zinc_library $zincRoot
package require Tkzinc 3.2
@@ -25,9 +25,13 @@ menu .menuBar -tearoff 0
.menuBar add cascade -menu .menuBar.file -label File -underline 0
menu .menuBar.file -tearoff 0
+.menuBar.file add command -label "About..." -command "aboutBox" \
+ -underline 0 -accelerator "<F1>"
+.menuBar.file add sep
.menuBar.file add command -label Quit -command exit -underline 0 \
-accelerator Meta-Q
. configure -menu .menuBar
+bind . <F1> aboutBox
frame .statusBar
label .statusBar.lab -text " " -relief sunken -bd 1 \
@@ -108,39 +112,43 @@ set lastLine ""
.t insert end {
This application provides a front end for several short scripts in Tcl/Tk that demonstrate what you can do with the TkZinc widget. Each of the numbered lines below describes a demonstration; you can click on it to invoke the demonstration. Once the demonstration window appears, you can click the "See Code" button to see the Tcl/Tk code that created the demonstration.
}
-.t insert end " \n " {}
-.t insert end "All Items\n" title
+.t insert end "\n" {} "Small applications\n" title
+.t insert end "1. The famous tiger (better with openGL).\n" {demo demo-tiger}
+
+.t insert end "\n" {} "All Items\n" title
.t insert end "1. Exemples of all items.\n" {demo demo-items}
-.t insert end "2. All items options (and their types).\n" {demo demo-all_options}
+.t insert end "2. All items options (and their types).\n" {demo demo-allOptions}
.t insert end "3. Examples of line style and line termination.\n" {demo demo-lines}
.t insert end "4. Curves with multiple contours.\n" {demo demo-contours}
.t insert end "5. Examples of labelformat.\n" {demo demo-labelformat}
.t insert end "6. Use of mapinfos.\n" {demo demo-mapinfo}
-.t insert end "7. Curves with cubic bezier control points.\n" {demo demo-curve_bezier}
-.t insert end "8. Curves with multiple contours and various fillrule.\n" {demo demo-fillrule}
+.t insert end "7. Curves with cubic bezier control points.\n" {demo demo-curveBezier}
+.t insert end "8. Curves with multiple contours and various fillrule.\n" {demo demo-fillRule}
-.t insert end \n {} "Groups, Priority, Clipping and PathTags\n" title
-.t insert end "1. Groups and Priorities.\n" {demo demo-groups_priority}
+.t insert end "\n" {} "Groups, Priority, Clipping and PathTags\n" title
+.t insert end "1. Groups and Priorities.\n" {demo demo-groupsPriority}
.t insert end "2. Clipping examples (with simple or multiple contours).\n" {demo demo-clipping}
-.t insert end "3. Group atomicity.\n" {demo demo-atomic-groups}
-.t insert end "4. \"Windows\" with four glasses using curve with multiple contours.\n" {demo demo-window-contours}
+.t insert end "3. Group atomicity.\n" {demo demo-atomicGroups}
+.t insert end "4. \"Windows\" with four glasses using curve with multiple contours.\n" {demo demo-windowContours}
+.t insert end "5. Pathtags demonstration.\n" {demo demo-pathTags}
-.t insert end \n {} "Interactions\n" title
-.t insert end "1. Simple interaction on a track.\n" {demo demo-simple_interaction_track}
+.t insert end "\n" {} "Interactions\n" title
+.t insert end "1. Simple interaction on a track.\n" {demo demo-simpleInteractionTrack}
.t insert end "2. Text input in a text item and a track item.\n" {demo demo-textInput}
-.t insert end \n {} "Transformation\n" title
+.t insert end "\n" {} "Transformation\n" title
.t insert end "1. Translating.\n" {demo demo-translation}
.t insert end "2. Rotating.\n" {demo demo-rotation}
.t insert end "3. Zooming.\n" {demo demo-zoom}
.t insert end "4. Transformation testbed.\n" {demo demo-transforms}
-.t insert end \n {} "Use of open GL\n" title
-#.t insert end "1. The TkZinc Logo (requires openGL).\n" {demo demo-tkZincLogo}
-.t insert end "1. Axial color variation on the X axis (requires openGL).\n" {demo demo-color-x}
-.t insert end "2. Axial color variation on the Y axis (requires openGL).\n" {demo demo-color-y}
-.t insert end "3. Circular color variation (requires openGL).\n" {demo demo-color-circular}
-.t insert end "4. The triangles item (requires openGL).\n" {demo demo-triangles}
+.t insert end "\n" {} "Use of open GL\n" title
+.t insert end "1. The TkZinc Logo.\n" {demo demo-tkZincLogo}
+.t insert end "2. Applying transformations to an icon.\n" {demo demo-iconTransform}
+.t insert end "3. Axial color variation on the X axis.\n" {demo demo-colorX}
+.t insert end "4. Axial color variation on the Y axis.\n" {demo demo-colorY}
+.t insert end "5. Circular color variation.\n" {demo demo-colorCircular}
+.t insert end "6. The triangles item.\n" {demo demo-triangles}
.t configure -state disabled
focus .s
@@ -198,7 +206,7 @@ proc showVars {w args} {
# index - The index of the character that the user clicked on.
proc invoke index {
- global tk_library
+ global zinc_library
set tags [.t tag names $index]
set i [lsearch -glob $tags demo-*]
@@ -209,7 +217,7 @@ proc invoke index {
.t configure -cursor watch
update
set demo [string range [lindex $tags $i] 5 end]
- uplevel [list source [file join $tk_library demos $demo.tcl]]
+ uplevel [list source [file join $zinc_library demos $demo.tcl]]
update
.t configure -cursor $cursor
@@ -222,7 +230,7 @@ proc invoke index {
# is called when the user moves the cursor over a demo description.
#
proc showStatus index {
- global tk_library
+ global zinc_library
set tags [.t tag names $index]
set i [lsearch -glob $tags demo-*]
set cursor [.t cget -cursor]
@@ -249,7 +257,7 @@ proc showStatus index {
# used to derive the name of the file containing its code.
proc showCode w {
- global tk_library
+ global zinc_library
set file [string range $w 1 end].tcl
if ![winfo exists .code] {
toplevel .code
@@ -285,9 +293,9 @@ proc showCode w {
wm deiconify .code
raise .code
}
- wm title .code "Demo code: [file join $tk_library demos $file]"
+ wm title .code "Demo code: [file join $zinc_library demos $file]"
wm iconname .code $file
- set id [open [file join $tk_library demos $file]]
+ set id [open [file join $zinc_library demos $file]]
.code.text delete 1.0 end
.code.text insert 1.0 [read $id]
.code.text mark set insert 1.0
@@ -299,7 +307,9 @@ proc showCode w {
# Pops up a message box with an "about" message
#
proc aboutBox {} {
- tk_messageBox -icon info -type ok -title "About Widget Demo" -message \
- "Tk widget demonstration\n\n\
+ tk_messageBox -icon info -type ok -title "About Zinc Demo" -message \
+ "Tkzinc widget demonstration\n\n\
+Copyright (c) 2003 CENA\n\n
+The demo framework \n
Copyright (c) 1996-1997 Sun Microsystems, Inc."
}