[PD-cvs] pd/src desire.tk,1.1.2.600.2.213,1.1.2.600.2.214
chunlee
chunlee at users.sourceforge.net
Wed Jul 11 02:36:44 CEST 2007
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv15504
Modified Files:
Tag: desiredata
desire.tk
Log Message:
Runcommand is not a subclass of Listener
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.600.2.213
retrieving revision 1.1.2.600.2.214
diff -C2 -d -r1.1.2.600.2.213 -r1.1.2.600.2.214
*** desire.tk 10 Jul 2007 23:32:26 -0000 1.1.2.600.2.213
--- desire.tk 11 Jul 2007 00:36:39 -0000 1.1.2.600.2.214
***************
*** 28,32 ****
#
#-----------------------------------------------------------------------------------#
!
# this command rebuilds the package index: echo pkg_mkIndex . | tclsh
--- 28,32 ----
#
#-----------------------------------------------------------------------------------#
!
# this command rebuilds the package index: echo pkg_mkIndex . | tclsh
***************
*** 1559,1564 ****
set @findbar ""
set @find_string ""
- set @cmd_hist {}
- set @cmd_histi 0
set @iohilite {-1 0 0 0 0}
set @pointer_sense 0 ;# i want this to be OFF by default so that I can use selrect and stuff. we need to talk about this.
--- 1559,1562 ----
***************
*** 1706,1709 ****
--- 1704,1708 ----
$self new_binds
$self update_title
+ set @runcommand [Runcommand new .$self "command" canvas_eval]
set @crosshair [Crosshair new $self]
set @active [Active new $self]
***************
*** 2477,2481 ****
}
set was [winfo exists .$self]
! if {$flag && $was && [$self gop]} {$self redraw}
if {$flag && $was} {$self raise}
if {$flag && !$was} {
--- 2476,2480 ----
}
set was [winfo exists .$self]
! #if {$flag && $was && [$self gop]} {$self redraw}
if {$flag && $was} {$self raise}
if {$flag && !$was} {
***************
*** 2548,2552 ****
}
foreach obj [$o children] {
! $@history add [list $self ins $i [$obj deconstruct]]
$o del [$o index $obj]
}
--- 2547,2551 ----
}
foreach obj [$o children] {
! $@history add [lisot $self ins $i [$obj deconstruct]]
$o del [$o index $obj]
}
***************
*** 3161,3240 ****
return $n
}
- def Canvas runcommand {} {
- set @runcommand [Runcommand new $self]
- }
! class_new Runcommand {Thing}
! def Runcommand widget {} {return .$@canvas.run}
! def Runcommand delete {} {focus .$@canvas.c; destroy [$self widget]; super}
! def Runcommand init {canvas} {
! set @canvas $canvas
set @defs {}
set @completions {}
set @comp_i 0
set @comp_s "666"
! set f [$self widget]
frame $f -border 1 -relief ridge
! button $f.close -border 1 -command "$self delete" -image icon_close -width 9 -height 9
! bind $f.close <Return> "$self delete"
pack $f.close -side left
bind $f.close <Tab> "$self traversal %K %W forward"
label $f.cmd_l -text Command: -font {helvetica -10} -pady 0
pack $f.cmd_l -side left
! entry $f.cmd -width 30 -relief flat -bg white -borderwidth 0 -highlightthickness 0
! bind $f.cmd <Escape> "$self delete"
! bind $f.cmd <Control-g> "$self delete"
! bind $f.cmd <Return> "$self run"
! bind $f.cmd <Up> "$@canvas cmd_up"
! bind $f.cmd <Down> "$@canvas cmd_down"
! bind $f.cmd <Control-p> "$@canvas cmd_up"
! bind $f.cmd <Control-n> "$@canvas cmd_down"
! bind $f.cmd <Tab> "$self completion +"
! bind $f.cmd <Control-Tab> "$self completion -"
! pack $f.cmd -side left -fill x -expand yes
! # bind $f.cmd <Control-Tab> "$self traversal %K %W forward"
if {[winfo exists .$@canvas.yscroll]} {set w .$@canvas.yscroll} else {set w .$@canvas.c}
pack $f -side bottom -fill x -before $w
! focus $f.cmd
! $self defs
! }
- def Runcommand traversal {k w direction} {
- set f [$self widget]
- if {$w == "$f.cmd"} {set next $f.close} else {set next [tk_focusNext $w]}
- focus $next
}
! def Canvas cmd_history+ {v} {lappend @cmd_hist $v; set @cmd_histi [llength $@cmd_hist]}
! def Canvas cmd_up {} {
! if {$@cmd_histi>0} {
! set @cmd_histi [expr $@cmd_histi-1]; $@runcommand replace [lindex $@cmd_hist $@cmd_histi]
! }
! }
! def Canvas cmd_down {} {
! if {$@cmd_histi<[llength $@cmd_hist]} {
! incr @cmd_histi; $@runcommand replace [lindex $@cmd_hist $@cmd_histi]
! }
}
! def Runcommand replace {v} {
! set f [$self widget]
! $f.cmd delete 0 end
! $f.cmd insert 0 $v
! $f.cmd icursor end
}
! def Runcommand run {} {
! set f [$self widget]
if {[winfo exists $f.completion]} {
! puts "string:: [string range $@comp 0 [string first ":" $@comp 0]]"
! $self replace [string range $@comp 0 [expr [string first ":" $@comp 0]-1]]
destroy $f.completion
return
}
! set text [$f.cmd get]
! $@canvas cmd_history+ $text
! $f.cmd delete 0 end
! post %s "returns: [uplevel [info level] [join [list $@canvas $text]]]"
! $self delete
}
--- 3160,3233 ----
return $n
}
! def Canvas runcommand {} {$@runcommand pack_prompt}
!
! class_new Runcommand {Listener}
! def Runcommand canvas {} {return $@canvas}
!
! def Runcommand init {serf name command} {
! set @hist {}
! set @histi 0
! set @serf ${serf}.run
! set @command $command
! set @expanded 0
! set @canvas [string trimleft $serf "."]
set @defs {}
set @completions {}
set @comp_i 0
set @comp_s "666"
! $self defs
! set f $@serf
frame $f -border 1 -relief ridge
! button $f.close -border 1 -command "$self unpack_prompt" -image icon_close -width 9 -height 9
! bind $f.close <Return> "$self unpack_prompt"
pack $f.close -side left
bind $f.close <Tab> "$self traversal %K %W forward"
label $f.cmd_l -text Command: -font {helvetica -10} -pady 0
pack $f.cmd_l -side left
! entry $f.entry -width 30 -relief flat -bg white -borderwidth 0 -highlightthickness 0
! bind $f.entry <Escape> "$self unpack_prompt"
! bind $f.entry <Control-g> "$self unpack_prompt"
! bind $f.entry <Return> "$self eval"
! bind $f.entry <Up> "$self up"
! bind $f.entry <Down> "$self down"
! bind $f.entry <Control-p> "$self up"
! bind $f.entry <Control-n> "$self down"
! bind $f.entry <Tab> "$self completion +"
! bind $f.entry <Control-Tab> "$self completion -"
! pack $f.entry -side left -fill x -expand yes
! bind $f.entry <Control-Tab> "$self traversal %K %W forward"
!
! }
!
! def Runcommand pack_prompt {} {
! set f $@serf
if {[winfo exists .$@canvas.yscroll]} {set w .$@canvas.yscroll} else {set w .$@canvas.c}
pack $f -side bottom -fill x -before $w
! focus $f.entry
}
! def Runcommand unpack_prompt {} {
! pack forget $@serf
! focus [$@canvas widget]
}
!
! def Runcommand traversal {k w direction} {
! set f $@serf
! if {$w == "$f.entry"} {set next $f.close} else {set next [tk_focusNext $w]}
! focus $next
}
! def Runcommand eval {} {
! set f $@serf
if {[winfo exists $f.completion]} {
! set @hist [linsert $@hist 0 [string range $@comp 0 [expr [string first ":" $@comp 0]-1]]]
! $self replace
destroy $f.completion
return
}
! super
! $self unpack_prompt
}
***************
*** 3246,3252 ****
def Runcommand completion {which} {
! #global __args
! set f [$self widget]
! set text [$f.cmd get]
if {$text != $@comp_s} {
set @comp_s $text
--- 3239,3244 ----
def Runcommand completion {which} {
! set f $@serf
! set text [$f.entry get]
if {$text != $@comp_s} {
set @comp_s $text
***************
*** 6129,6133 ****
proc tcl_eval {self l} {post %s "tcl: $l"; post %s "returns: [uplevel [info level] $l]"}
proc pd_eval {self l} {post %s "pd: $l"; netsend $l}
!
############ button bar
--- 6121,6125 ----
proc tcl_eval {self l} {post %s "tcl: $l"; post %s "returns: [uplevel [info level] $l]"}
proc pd_eval {self l} {post %s "pd: $l"; netsend $l}
! proc canvas_eval {self l} {post %s "tcl: $l"; post %s "returns: [uplevel [info level] [join [list [$self canvas] $l]]]"}
############ button bar
***************
*** 6211,6218 ****
switch -regexp -- $type {
^object|outlet|inlet$ {
! if {$id != $self} {
! mset {x y x3 y3} [$id bbox]
! set @follow $id
! }
}
^move|edit$ {mset {x y x3 y3} [$@follow bbox]}
--- 6203,6208 ----
switch -regexp -- $type {
^object|outlet|inlet$ {
! mset {x y x3 y3} [$id bbox]
! set @follow $id
}
^move|edit$ {mset {x y x3 y3} [$@follow bbox]}
More information about the Pd-cvs
mailing list