summaryrefslogtreecommitdiffstats
path: root/scilab/modules/tclsci
diff options
context:
space:
mode:
authorAllan CORNET <allan.cornet@scilab.org>2010-03-02 09:13:44 +0100
committerAllan CORNET <allan.cornet@scilab.org>2010-03-02 09:13:44 +0100
commit4016d1a93a29f2773a1207793b29282c63255009 (patch)
tree3d1d97e5f33dd3886e8e75491649dc4049f0ddd3 /scilab/modules/tclsci
parentd18c08abf78973c5dc377aad0df86083531af9c5 (diff)
downloadscilab-4016d1a93a29f2773a1207793b29282c63255009.zip
scilab-4016d1a93a29f2773a1207793b29282c63255009.tar.gz
remove obsolete function
Diffstat (limited to 'scilab/modules/tclsci')
-rw-r--r--scilab/modules/tclsci/Makefile.am3
-rw-r--r--scilab/modules/tclsci/Makefile.in3
-rw-r--r--scilab/modules/tclsci/macros/tk_choose.sci60
-rwxr-xr-xscilab/modules/tclsci/tcl/utils/tk_choose.tcl95
4 files changed, 2 insertions, 159 deletions
diff --git a/scilab/modules/tclsci/Makefile.am b/scilab/modules/tclsci/Makefile.am
index 7fdcd7a..12fac02 100644
--- a/scilab/modules/tclsci/Makefile.am
+++ b/scilab/modules/tclsci/Makefile.am
@@ -80,8 +80,7 @@ libscitclsci_la_etc_DATA = etc/tclsci.quit etc/tclsci.start
80 80
81### TCL macros ### 81### TCL macros ###
82libscitclsci_la_tcldir = $(mydatadir) 82libscitclsci_la_tcldir = $(mydatadir)
83nobase_libscitclsci_la_tcl_DATA = tcl/utils/tk_choose.tcl \ 83nobase_libscitclsci_la_tcl_DATA = tcl/utils/Notebook.tcl \
84tcl/utils/Notebook.tcl \
85tcl/utils/Balloon.tcl \ 84tcl/utils/Balloon.tcl \
86tcl/utils/Combobox.tcl \ 85tcl/utils/Combobox.tcl \
87tcl/sciGUI/data/initial.help \ 86tcl/sciGUI/data/initial.help \
diff --git a/scilab/modules/tclsci/Makefile.in b/scilab/modules/tclsci/Makefile.in
index b934885..2225ee1 100644
--- a/scilab/modules/tclsci/Makefile.in
+++ b/scilab/modules/tclsci/Makefile.in
@@ -493,8 +493,7 @@ libscitclsci_la_etc_DATA = etc/tclsci.quit etc/tclsci.start
493 493
494### TCL macros ### 494### TCL macros ###
495libscitclsci_la_tcldir = $(mydatadir) 495libscitclsci_la_tcldir = $(mydatadir)
496nobase_libscitclsci_la_tcl_DATA = tcl/utils/tk_choose.tcl \ 496nobase_libscitclsci_la_tcl_DATA = tcl/utils/Notebook.tcl \
497tcl/utils/Notebook.tcl \
498tcl/utils/Balloon.tcl \ 497tcl/utils/Balloon.tcl \
499tcl/utils/Combobox.tcl \ 498tcl/utils/Combobox.tcl \
500tcl/sciGUI/data/initial.help \ 499tcl/sciGUI/data/initial.help \
diff --git a/scilab/modules/tclsci/macros/tk_choose.sci b/scilab/modules/tclsci/macros/tk_choose.sci
deleted file mode 100644
index 0d0e014..0000000
--- a/scilab/modules/tclsci/macros/tk_choose.sci
+++ /dev/null
@@ -1,60 +0,0 @@
1// Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
2// Copyright (C) 2006 - S. Mottelet
3//
4// This file must be used under the terms of the CeCILL.
5// This source file is licensed as described in the file COPYING, which
6// you should have received as part of this distribution. The terms
7// are also available at
8// http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt
9
10
11function _result=tk_choose(_items,_title,_button)
12
13warnobsolete("x_choose", "5.3");
14
15// Use of a namespace makes things easier (no global variables to pass
16// arguments from the Scilab level).
17
18
19if argn(2)<=1
20 _title="";
21end
22if argn(2)<=2
23 _button=gettext('Cancel');
24end
25
26
27// Create the namespace
28
29TCL_EvalStr("namespace eval tkChoose {}")
30
31// Set parameter arrays in the Tcl world
32
33TCL_SetVar("tkChoose::title",_title(:));
34TCL_SetVar("tkChoose::items",_items(:));
35TCL_SetVar("tkChoose::button",_button(:));
36
37// Finally launch the Tcl script
38
39TCL_EvalFile(SCI+"/modules/tclsci/tcl/utils/tk_choose.tcl")
40
41// Event loop at the Scilab level
42
43while ~TCL_ExistVar("tkChoose::result")
44 // wait for response
45 sleep(1);
46end
47
48_result=evstr(TCL_GetVar("tkChoose::result"))+1;
49
50// Destroy the toplevel tkChoose widget
51
52TCL_EvalStr("catch {destroy $tkChoose::t}")
53
54// Yank the namespace (all variables therein are also
55// destroyed)
56
57TCL_EvalStr("namespace delete tkChoose")
58
59endfunction
60
diff --git a/scilab/modules/tclsci/tcl/utils/tk_choose.tcl b/scilab/modules/tclsci/tcl/utils/tk_choose.tcl
deleted file mode 100755
index 0105aaf..0000000
--- a/scilab/modules/tclsci/tcl/utils/tk_choose.tcl
+++ /dev/null
@@ -1,95 +0,0 @@
1namespace eval tkChoose {
2
3 # Author : S. Mottelet, Tue Jan 24 12:01:25 CET 2006
4 # Use of a namespace makes things easier (no global variables to pass
5 # arguments from the Scilab level).
6
7 # Modified by P. Marechal, Tue Feb 14 08:00:00 CET 2006
8 # => Add a scrollbar if the number of items reachs 30 elements.
9
10 set relief raised
11 set t .tkChoose
12 set fontSize 12
13 if {$::tcl_platform(os)=="Windows NT"} {
14 set fontSize 9
15 }
16
17 catch {font create chooseFont -family Helvetica -size $fontSize}
18 catch {font create chooseBoldFont -family Helvetica -size $fontSize -weight bold}
19
20 toplevel $t
21 bind $t <Destroy> {
22 set tkChoose::result -1
23 }
24
25 # Convert (if necessary) the array of strings to a \n
26 # separated string
27
28 if ![set length [array size title]] {
29 set titleString $title
30 } else {
31 for {set k 1} {$k<$length} {incr k} {
32 append titleString $title($k,1)\n
33 }
34 append titleString $title($k,1)
35 }
36
37 label $t.label -text $titleString -justify left -font chooseBoldFont
38
39 scrollbar $t.scroll -relief sunken -command "$t.list yview"
40
41 if [set length [array size items]] {
42 if {$length>=30} then {
43 set list_height 30
44 } else {
45 set list_height 0
46 }
47 } else {
48 set list_height 0
49 }
50
51 listbox $t.list -relief sunken -yscrollcommand "$t.scroll set" -bg white -height $list_height -width 0 -font chooseFont
52
53 bind $t.list <ButtonRelease> {
54 bind $tkChoose::t <Destroy> {}
55 catch {set tkChoose::result [$tkChoose::t.list nearest %y]}
56 }
57
58 # Insert the string or the array strings in the listbox
59
60 if ![set length [array size items]] {
61 $t.list insert end $items
62 } else {
63 for {set k 1} {$k<=$length} {incr k} {
64 $t.list insert end $items($k,1)
65 }
66 }
67
68 button $t.b -text $button -relief $relief -font chooseFont -command {
69 destroy $tkChoose::t
70 }
71
72 # Adjust padding space when there is no title
73
74 set listPady {0 0}
75 if {$titleString!=""} {
76 pack $t.label -pady 10 -padx 10
77 } else {
78 set listPady {10 0}
79 }
80
81 pack $t.b -pady 10 -side bottom
82
83 # Display the listbox and the scrollbar if needed
84
85 if {$length>=30} then {
86 pack $t.list $t.scroll -side left -fill y -pady $listPady -padx 10
87 } else {
88 pack $t.list -pady $listPady -padx 10
89 }
90
91 wm resizable $t 0 0
92
93 # The event loop occurs at the Scilab level
94 # see SCI/modules/tclsci/macros/tk_choose.sci
95}