[PD-cvs] pd/src desire.tk,1.1.2.28,1.1.2.29
Mathieu Bouchard
matju at users.sourceforge.net
Tue Sep 6 03:43:19 CEST 2005
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25329
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
desiredata now evals commands received from the server.
the +/- box expander now stays in the same spot (required 2 extra frames... auggh).
i added a "pd eval box" in which commands get sent directly to the server.
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.28
retrieving revision 1.1.2.29
diff -C2 -d -r1.1.2.28 -r1.1.2.29
*** desire.tk 6 Sep 2005 00:47:39 -0000 1.1.2.28
--- desire.tk 6 Sep 2005 01:43:17 -0000 1.1.2.29
***************
*** 32,36 ****
#
#3. is this what you mean by class_new? so that later we can have textobj_new, canvas_new,
! # bang_new, togggle_new, and so on?
#
#
--- 32,36 ----
#
#3. is this what you mean by class_new? so that later we can have textobj_new, canvas_new,
! # bang_new, toggle_new, and so on?
#
#
***************
*** 49,53 ****
set pd_nt 0
! option add *background #ffffff
option add *foreground #000000
--- 49,53 ----
set pd_nt 0
! #option add *background #ffffff
option add *foreground #000000
***************
*** 58,65 ****
#option add *font {Helvetica -12 bold}
option add *borderWidth 1
! #option add *Menu*borderWidth 1
! #option add *Button*borderWidth 1
! #option add *Checkbutton*borderWidth 1
! #option add *Radiobutton*borderWidth 1
option add *Checkbutton*selectColor #dd3000
option add *Radiobutton*selectColor #dd3000
--- 58,64 ----
#option add *font {Helvetica -12 bold}
option add *borderWidth 1
! foreach tkclass {Menu Button Checkbutton Radiobutton} {
! option add *$tkclass*borderWidth 1
! }
option add *Checkbutton*selectColor #dd3000
option add *Radiobutton*selectColor #dd3000
***************
*** 82,87 ****
proc lreverse {list} {
- #puts "lreverse::: $list"
-
set r {}
for {set i [expr [llength $list]-1]} {$i>=0} {incr i -1} {
--- 81,84 ----
***************
*** 186,190 ****
.mbar add cascade -label "Media" -menu .mbar.audio
} else {
! # Perhaps this is silly, but Mac HIG want "Window Help" as the last menus
.mbar add cascade -label "Media" -menu .mbar.audio
.mbar add cascade -label "Windows" -menu .mbar.windows
--- 183,187 ----
.mbar add cascade -label "Media" -menu .mbar.audio
} else {
! # Mac HIG want "Window Help" as the last menus
.mbar add cascade -label "Media" -menu .mbar.audio
.mbar add cascade -label "Windows" -menu .mbar.windows
***************
*** 254,258 ****
}
! wm title . "Pd"
. configure -menu .mbar
--- 251,255 ----
}
! wm title . "DesireData"
. configure -menu .mbar
***************
*** 274,284 ****
set sock {}
proc poll_sock {} {
! global sock
while {1} {
set cmd [gets $sock]
if {[fblocked $sock]} {break}
puts "-> $cmd"
}
after 50 poll_sock
--- 271,294 ----
set sock {}
+ set sock_lobby {}
proc poll_sock {} {
! global sock sock_lobby
while {1} {
set cmd [gets $sock]
+ if {[eof $sock]} {
+ tk_messageBox -message "my sock puppet disappeared (ah, the great mysteries of the washingmachine). Well, that's all, folks!" -type ok
+ exit 42
+ }
if {[fblocked $sock]} {break}
puts "-> $cmd"
+ if {[catch {eval $sock_lobby$cmd}]} {
+ global errorCode errorInfo
+ switch -regexp -- $errorInfo {
+ "^missing close-brace" {set sock_lobby $sock_lobby$cmd; continue}
+ }
+ puts "Exception: errorCode=$errorCode; errorInfo=$errorInfo"
+ }
+ set sock_lobby {}
}
after 50 poll_sock
***************
*** 298,306 ****
set server_sock [socket -server accept_pd 13666]
-
exec pd -guiport 13666 &
################ utility functions #########################
proc pdtk_enquote {x} {
puts "pdtk_enquote::: $x"
--- 308,317 ----
set server_sock [socket -server accept_pd 13666]
exec pd -guiport 13666 &
################ utility functions #########################
+ proc pdtk_post {s} {post $s}
+
proc pdtk_enquote {x} {
puts "pdtk_enquote::: $x"
***************
*** 621,625 ****
{"Open" {menu_open} "Ctrl+o"}
{}
! {"Class List" {foo show_class_list} ""}
{".pdrc Editor" {foo pdrc_editor_new} ""}
{"Message" {foo menu_send} "Ctrl+m"}
--- 632,636 ----
{"Open" {menu_open} "Ctrl+o"}
{}
! {"Class List" {foo class_browser} ""}
{".pdrc Editor" {foo pdrc_editor_new} ""}
{"Message" {foo menu_send} "Ctrl+m"}
***************
*** 680,683 ****
--- 691,696 ----
proc pd {arg} {
+ global sock
+ puts $sock $arg
#puts "calling pd for $arg"
}
***************
*** 747,857 ****
#-----------------------------------------------------------------------------------#
- #the original:
- #set canvasmenu(file) {
- # {New {menu_new} "Ctrl+n"}
- # {Open {menu_open} "Ctrl+o"}
- # {}
- # {Message {menu_send} "Ctrl+m"}
- # {Path... {pd "pd start-path-dialog ;"} {}}
- # {}
- # {Close {menu_close %W} "Ctrl+w"}
- # {Save {menu_save %W} "Ctrl+s"}
- # {"Save as..." {menu_saveas %W} "Ctrl+S"}
- # {Print {menu_print %W} "Ctrl+p"}
- # {}
- # {Quit {menu_quit} "Ctrl+q"}
- #}
-
- #error proof with foo
set canvasmenu(file) {
! {New {foo menu_new} "Ctrl+n"}
! {Open {foo menu_open} "Ctrl+o"}
{}
{Message {foo menu_send} "Ctrl+m"}
! {Path... {foo "pd start-path-dialog"} {}}
{}
! {Close {foo menu_close} "Ctrl+w"}
! {Save {foo menu_save} "Ctrl+s"}
{"Save as..." {foo menu_saveas} "Ctrl+S"}
! {Print {foo menu_print} "Ctrl+p"}
{}
! {Quit {foo menu_quit} "Ctrl+q"}
}
- #-----------------------------------------------------------------------------------#
- # the original
- #set canvasmenu(edit) {
- # {Undo {menu_undo %W} "Ctrl+z"}
- # {Redo {menu_redo %W} "Ctrl+Z"}
- # {}
- # {Cut {pd "%W cut ;"} "Ctrl+x"}
- # {Copy {pd "%W copy ;"} "Ctrl+c"}
- # {Paste {pd "%W paste ;"} "Ctrl+v"}
- # {Duplicate {pd "%W duplicate ;"} "Ctrl+d"}
- # {"Select all" {pd "%W selectall ;"} "Ctrl+a"}
- # {}
- # {"Text Editor" {pd "%W texteditor ;"} "Ctrl+t"}
- # {Font {pd "%W menufont ;"} {}}
- # {"Tidy Up" {pd "%W tidy ;"} {}}
- # {}
- #}
- #error proof with foo
set canvasmenu(edit) {
{Undo {foo menu_undo} "Ctrl+z"}
{Redo {foo menu_redo} "Ctrl+Z"}
{}
! {Cut {foo "pd %W cut"} "Ctrl+x"}
! {Copy {foo "pd %W copy"} "Ctrl+c"}
! {Paste {foo "pd %W paste"} "Ctrl+v"}
! {Duplicate {foo "pd %W duplicate"} "Ctrl+d"}
! {"Select all" {foo "pd %W selectall"} "Ctrl+a"}
{}
! {"Text Editor" {foo "pd %W texteditor"} "Ctrl+t"}
! {Font {foo "pd %W menufont "} {}}
! {"Tidy Up" {foo "pd %W tidy "} {}}
{}
}
#-----------------------------------------------------------------------------------#
- # the original
- #set canvasmenu(put_original) {
- # {Object {pd "%W obj 0 ;"} "Ctrl+1"}
- # {Message {pd "%W msg 0 ;"} "Ctrl+2"}
- # {Number {pd "%W floatatom 0 ;"} "Ctrl+3"}
- # {Symbol {pd "%W symbolatom 0 ;"} "Ctrl+4"}
- # {Comment {pd "%W text 0 ;"} "Ctrl+5"}
- # {}
- # {Bang {pd "%W bng 0 ;"} "Alt+b"}
- # {Toggle {pd "%W toggle 0 ;"} "Alt+t"}
- # {Number2 {pd "%W numbox 0 ;"} "Alt+n"}
- # {Vslider {pd "%W vslider 0 ;"} "Alt+v"}
- # {Hslider {pd "%W hslider 0 ;"} "Alt+h"}
- # {Vradio {pd "%W vradio 0 ;"} "Alt+d"}
- # {Hradio {pd "%W hradio 0 ;"} "Alt+i"}
- # {VU {pd "%W vumeter 0 ;"} "Alt+u"}
- # {dropper {pd "%W dropper 0 ;"} "Alt+x"}
- # {Canvas {pd "%W mycnv 0 ;"} "Alt+c"}
- # {}
- # {Graph {pd "%W graph ;"} {}}
- # {Array {pd "%W menuarray ;"} {}}
- #}
- #-----------------------------------------------------------------------------------#
# only "put object" worx for now, the error proof the rest
set canvasmenu(put) {
{Object {textobj_new} "Ctrl+1"}
! {Message {foo "pd %W msg 0"} "Ctrl+2"}
! {Number {foo "pd %W floatatom 0"} "Ctrl+3"}
! {Symbol {foo "%W symbolatom 0"} "Ctrl+4"}
! {Comment {foo "pd %W text 0 ;"} "Ctrl+5"}
{}
{Bang {bang_new} "Alt+b"}
! {Toggle {foo "pd %W toggle 0 ;"} "Alt+t"}
! {Number2 {foo "pd %W numbox 0 ;"} "Alt+n"}
! {Vslider {foo "pd %W vslider 0 ;"} "Alt+v"}
! {Hslider {foo "pd %W hslider 0 ;"} "Alt+h"}
! {Vradio {foo "pd %W vradio 0 ;"} "Alt+d"}
! {Hradio {foo "pd %W hradio 0 ;"} "Alt+i"}
! {VU {foo "pd %W vumeter 0 ;"} "Alt+u"}
! {dropper {foo "pd %W dropper 0 ;"} "Alt+x"}
{Canvas {foo "pd %W mycnv 0 ;"} "Alt+c"}
{}
--- 760,812 ----
#-----------------------------------------------------------------------------------#
set canvasmenu(file) {
! {New {foo menu_new} "Ctrl+n"}
! {Open {foo menu_open} "Ctrl+o"}
{}
{Message {foo menu_send} "Ctrl+m"}
! {Path... {foo pd "pd start-path-dialog"} {}}
{}
! {Close {foo menu_close} "Ctrl+w"}
! {Save {foo menu_save} "Ctrl+s"}
{"Save as..." {foo menu_saveas} "Ctrl+S"}
! {Print {foo menu_print} "Ctrl+p"}
{}
! {Quit {foo menu_quit} "Ctrl+q"}
}
set canvasmenu(edit) {
{Undo {foo menu_undo} "Ctrl+z"}
{Redo {foo menu_redo} "Ctrl+Z"}
{}
! {Cut {foo pd "%W cut"} "Ctrl+x"}
! {Copy {foo pd "%W copy"} "Ctrl+c"}
! {Paste {foo pd "%W paste"} "Ctrl+v"}
! {Duplicate {foo pd "%W duplicate"} "Ctrl+d"}
! {"Select all" {foo pd "%W selectall"} "Ctrl+a"}
{}
! {"Text Editor" {foo pd "%W texteditor"} "Ctrl+t"}
! {Font {foo pd "%W menufont"} {}}
! {"Tidy Up" {foo pd "%W tidy"} {}}
{}
}
#-----------------------------------------------------------------------------------#
# only "put object" worx for now, the error proof the rest
set canvasmenu(put) {
{Object {textobj_new} "Ctrl+1"}
! {Message {foo pd "%W msg 0"} "Ctrl+2"}
! {Number {foo pd "%W floatatom 0"} "Ctrl+3"}
! {Symbol {foo pd "%W symbolatom 0"} "Ctrl+4"}
! {Comment {foo pd "%W text 0"} "Ctrl+5"}
{}
{Bang {bang_new} "Alt+b"}
! {Toggle {foo "pd %W toggle 0"} "Alt+t"}
! {Number2 {foo "pd %W numbox 0"} "Alt+n"}
! {Vslider {foo "pd %W vslider 0"} "Alt+v"}
! {Hslider {foo "pd %W hslider 0"} "Alt+h"}
! {Vradio {foo "pd %W vradio 0"} "Alt+d"}
! {Hradio {foo "pd %W hradio 0"} "Alt+i"}
! {VU {foo "pd %W vumeter 0"} "Alt+u"}
! {dropper {foo "pd %W dropper 0"} "Alt+x"}
{Canvas {foo "pd %W mycnv 0 ;"} "Alt+c"}
{}
***************
*** 863,867 ****
proc menu_audio {flag} {
puts "menu_audio::: $flag"
-
pd "pd dsp $flag ;"
}
--- 818,821 ----
***************
*** 872,880 ****
proc canvastosym {name} {
#puts "canvastosym::: <- $name"
-
regsub {.c$} $name "" name
-
#puts "canvastosym::: -> $name"
-
return $name
}
--- 826,831 ----
***************
*** 1136,1141 ****
proc menu_editmode {name} {
puts "menu_editmode::: $name"
!
! #pd "$name editmode 0 ;"
}
#-----------------------------------------------------------------------------------#
--- 1087,1091 ----
proc menu_editmode {name} {
puts "menu_editmode::: $name"
! pd "$name editmode 0 ;"
}
#-----------------------------------------------------------------------------------#
***************
*** 3325,3331 ****
.log.1 insert end "DesireData 0.39.A\n"
.log.1 insert end "Tcl $tcl_version, Tk $tk_version, pd_nt=$pd_nt\n"
! foreach k [array names tcl_platform] {
! .log.1 insert end "tcl_platform($k) = $tcl_platform($k)\n"
! }
pack .log.1 -side left -fill both -expand yes
pack .log.2 -side left -fill y -expand no
--- 3275,3281 ----
.log.1 insert end "DesireData 0.39.A\n"
.log.1 insert end "Tcl $tcl_version, Tk $tk_version, pd_nt=$pd_nt\n"
! #foreach k [array names tcl_platform] {
! # .log.1 insert end "tcl_platform($k) = $tcl_platform($k)\n"
! #}
pack .log.1 -side left -fill both -expand yes
pack .log.2 -side left -fill y -expand no
***************
*** 3378,3383 ****
set @command $command
frame $self
! pack [button $self.expander -image icon_plus -command "listener_expand $self"] -side left
! pack [label $self.label -text "$name: "] -side left
pack [entry $self.entry -width 40] -side left -fill x -expand yes
pack $self -fill x -expand no
--- 3328,3335 ----
set @command $command
frame $self
! pack [frame $self.1] -side left -fill y
! pack [frame $self.1.1] -side top
! pack [button $self.1.1.expander -image icon_plus -command "listener_expand $self"] -side left
! pack [label $self.1.1.label -text "$name: "] -side left
pack [entry $self.entry -width 40] -side left -fill x -expand yes
pack $self -fill x -expand no
***************
*** 3392,3396 ****
pack [text $self.entry -width 40 -height 8] -side left -fill x -expand yes
$self.entry insert 0.0 $text
! $self.expander configure -image icon_minus -command "listener_unexpand $self"
#bind $self.entry <Alt-Return> $@command
}
--- 3344,3348 ----
pack [text $self.entry -width 40 -height 8] -side left -fill x -expand yes
$self.entry insert 0.0 $text
! $self.1.1.expander configure -image icon_minus -command "listener_unexpand $self"
#bind $self.entry <Alt-Return> $@command
}
***************
*** 3402,3406 ****
pack [entry $self.entry -width 40] -side left -fill x -expand yes
$self.entry insert 0 $text
! $self.expander configure -image icon_plus -command "listener_expand $self"
bind $self.entry <Up> "listener_up $self"
bind $self.entry <Down> "listener_down $self"
--- 3354,3358 ----
pack [entry $self.entry -width 40] -side left -fill x -expand yes
$self.entry insert 0 $text
! $self.1.1.expander configure -image icon_plus -command "listener_expand $self"
bind $self.entry <Up> "listener_up $self"
bind $self.entry <Down> "listener_down $self"
***************
*** 3434,3442 ****
}
! global cmdline
! after 1 {
! # if {$cmdline(console) != 0} {
listener_new .tcl "Tcl" {tcl_eval}
! # }
}
--- 3386,3399 ----
}
! proc pd_eval {} {
! set l [.pd.entry get]
! listener_append .tcl [.tcl.entry get]
! .tcl.entry delete 0 end
! pd "$l;\n"
! }
!
! after 0 {
listener_new .tcl "Tcl" {tcl_eval}
! listener_new .pd "Pd" {pd_eval}
}
***************
*** 3548,3552 ****
############ class list
! proc show_class_list {} {
pd "pd update-path ; pd update-class-list class_list_callback ;"
}
--- 3505,3509 ----
############ class list
! proc class_browser_new {name} {
pd "pd update-path ; pd update-class-list class_list_callback ;"
}
More information about the Pd-cvs
mailing list