[PD-cvs] pd/src desire.tk,1.1.2.271,1.1.2.272
Mathieu Bouchard
matju at users.sourceforge.net
Mon Jul 3 17:43:38 CEST 2006
Update of /cvsroot/pure-data/pd/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4403
Modified Files:
Tag: devel_0_39
desire.tk
Log Message:
redid all of populate_menu
Index: desire.tk
===================================================================
RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v
retrieving revision 1.1.2.271
retrieving revision 1.1.2.272
diff -C2 -d -r1.1.2.271 -r1.1.2.272
*** desire.tk 2 Jul 2006 17:07:28 -0000 1.1.2.271
--- desire.tk 3 Jul 2006 15:43:35 -0000 1.1.2.272
***************
*** 440,443 ****
--- 440,451 ----
set accels {}
+
+ foreach k [array names key] {
+ set v $key($k)
+ dict set accels $v $k
+ }
+
+ puts $accels
+
################## set up main window #########################
***************
*** 450,454 ****
def Client init_binds {} {
global OS
- #set @accels {}
bind . <Control-Key> {$main ctrlkey %K 0}
bind . <Control-Shift-Key> {$main ctrlkey %K 1}
--- 458,461 ----
***************
*** 523,527 ****
############### set up global variables ################################
- set saveas_client doggy
set pd_opendir [pwd]
set pd_undoaction no
--- 530,533 ----
***************
*** 589,594 ****
while {1} {
set line [gets $gdb]
if {[eof $gdb]} {tk_messageBox -message "eurggggh." -type ok; exit 69}
- if {[fblocked $gdb]} {break}
post "\[gdb\] %s" $line
}
--- 595,600 ----
while {1} {
set line [gets $gdb]
+ if {$line=="" || [fblocked $gdb]} {break} ;# which way should i check for no input?
if {[eof $gdb]} {tk_messageBox -message "eurggggh." -type ok; exit 69}
post "\[gdb\] %s" $line
}
***************
*** 611,615 ****
after 0 poll_gdb
} {
! exec gdb --tui --args $cmdline(server) -guiport $server_port &
}
} {
--- 617,622 ----
after 0 poll_gdb
} {
! exec gdb --args $cmdline(server) -guiport $server_port &
! #exec gdb --tui --args $cmdline(server) -guiport $server_port &
}
} {
***************
*** 727,761 ****
def Menuable populate_menu {menu list} {
if {[string index $menu 0]!="."} {set menu .$self.m.$menu}
! foreach e $list {$self populate_menu_1 $menu $e}
! }
! def Menuable populate_menu_1 {menu e} {
! global key accels
! if {[llength $e]==0} {$menu add separator; return}
! mset {text cmd accel} $e
!
! if {$accel != ""} {
! set key($text) $accel
! } else {set accel [accel_munge $key($text)]}
!
! if {![llength $cmd]} {
! set cmd "%W $text"
! set text [say $text]
! }
! #set accel [accel_munge $accel]
! if {$accel != ""} {
! if {![dict exists $accels $accel]} {
! dict set accels $accel $cmd} else {
! #puts "***** warning:: $accel already assigned *****"
! #dict set accels $accel $cmd
! }
! }
! regsub -all %W $cmd $self cmd
! if {[llength $e]==3} {
! $menu add command -label $text -command $cmd \
! -accelerator $accel
! } { # 4
! $menu add checkbutton -label $text -command $cmd \
! -accelerator $accel -indicatoron 1
}
}
--- 734,743 ----
def Menuable populate_menu {menu list} {
+ global key
if {[string index $menu 0]!="."} {set menu .$self.m.$menu}
! foreach name $list {
! if {$name == ""} {$menu add separator; return}
! $menu add command -label [say $name] -command "$self $name" \
! -accelerator [accel_munge $key($name)]
}
}
***************
*** 767,802 ****
def Client init_menus {} {
$self populate_menu .mbar.file {
! {new_file {} ""}
! {open_file {} ""}
! {}
! {pdrc_editor {} ""}
! {ddrc_editor {} ""}
! {send_message {} ""}
! {paths {} ""}
! {}
! {quit {} ""}}
!
$self populate_menu .mbar.find {
! {find {} ""}
! {find_again {} ""}
! {find_last_error {} {}}}
!
!
! # switch -- $key {
# slash {$self audio 1}
# period {$self audio 0}
- # }
- # switch -- $key {
# Q {$main really_quit}
# s {$self save} S {$self save_as}
# z {$self undo} Z {$self redo}
- # }
-
- # for audio switch on/off
- #switch -- $key {
- # slash {menu_audio 1}
- # period {menu_audio 0}
- # e {$self editmodeswitch}
- #}
}
--- 749,762 ----
def Client init_menus {} {
$self populate_menu .mbar.file {
! new_file open_file {}
! pdrc_editor ddrc_editor send_message paths {}
! quit}
$self populate_menu .mbar.find {
! find find_again find_last_error}
# slash {$self audio 1}
# period {$self audio 0}
# Q {$main really_quit}
# s {$self save} S {$self save_as}
# z {$self undo} Z {$self redo}
}
***************
*** 816,820 ****
if {[dict exists $accels $key]} {
puts "key ==== $key | cmd === [dict get $accels $key]"
! $self eval% [dict get $accels $key]
return
} {puts "ctrlkey: unknown $key"}
--- 776,780 ----
if {[dict exists $accels $key]} {
puts "key ==== $key | cmd === [dict get $accels $key]"
! $self eval% "%W [dict get $accels $key]"
return
} {puts "ctrlkey: unknown $key"}
***************
*** 827,831 ****
set key "Alt+$key"
if {[dict exists $accels $key]} {
! $self eval% [dict get $accels $key]
return
} {puts "altkey: unknown $key"}
--- 787,791 ----
set key "Alt+$key"
if {[dict exists $accels $key]} {
! $self eval% "%W [dict get $accels $key]"
return
} {puts "altkey: unknown $key"}
***************
*** 931,935 ****
set @noutlets 0
set @duplicate 0
- #set @accels {}
super
}
--- 891,894 ----
***************
*** 1058,1076 ****
set m .mbar.media
$main populate_menu $m {
! {audio_on {} ""}
! {audio_off {} ""}
! {}}
switch $OS {
osx {}
default {
$main populate_menu $m {
! {audio_settings {} {}}
! { midi_settings {} {}}}
}
}
$main populate_menu $m {{}
! {test_audio_and_midi {} ""}
! {load_meter {} ""}
! {latency_meter {} ""} {}}
foreach a $pd_apilist {
$m add radiobutton -label [lindex $a 0] -variable pd_whichapi -value [lindex $a 1] \
--- 1017,1030 ----
set m .mbar.media
$main populate_menu $m {
! audio_on audio_off {}}
switch $OS {
osx {}
default {
$main populate_menu $m {
! audio_settings midi_settings}
}
}
$main populate_menu $m {{}
! test_audio_and_midi load_meter latency_meter}
foreach a $pd_apilist {
$m add radiobutton -label [lindex $a 0] -variable pd_whichapi -value [lindex $a 1] \
***************
*** 1083,1090 ****
}
$main populate_menu .mbar.help {
! {about {} ""}
! {class_browser {} ""}
! {client_class_tree {} ""}
! }
}
--- 1037,1041 ----
}
$main populate_menu .mbar.help {
! about class_browser client_class_tree}
}
***************
*** 1162,1173 ****
def* Canvas init {args} {
super
! global pd_opendir pd_tearoff OS cmdline look canvas
! set 5 $self
set name .$self
set c .$self.c
toplevel $name -menu $name.m
- #wm geometry $name $geometry
- #puts "geometry -----> +$@x+$@y"
- #wm geometry $name +$@x+$@y
# turn buttonbar on/off
if {$look(buttonbar)} {pack [[ButtonBar new $self] widget] -side top -fill x -expand no}
--- 1113,1120 ----
def* Canvas init {args} {
super
! global pd_opendir pd_tearoff OS cmdline look canvas history manager
set name .$self
set c .$self.c
toplevel $name -menu $name.m
# turn buttonbar on/off
if {$look(buttonbar)} {pack [[ButtonBar new $self] widget] -side top -fill x -expand no}
***************
*** 1176,1180 ****
if {$look(statusbar)} {pack [$@statusbar widget] -side bottom -fill x}
pack [scrollbar $name.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x
! pack [scrollbar $name.yscroll -command "$c yview"] -side right -fill y
pack [canvas $c -width $@w -height $@h -background white \
-yscrollcommand "$name.yscroll set" \
--- 1123,1127 ----
if {$look(statusbar)} {pack [$@statusbar widget] -side bottom -fill x}
pack [scrollbar $name.xscroll -command "$c xview" -orient horizontal] -side bottom -fill x
! pack [scrollbar $name.yscroll -command "$c yview" ] -side right -fill y
pack [canvas $c -width $@w -height $@h -background white \
-yscrollcommand "$name.yscroll set" \
***************
*** 1182,1186 ****
-scrollregion [list 0 0 $@w $@h]] -side left -expand 1 -fill both
wm minsize $name 1 1
- #wm geometry $name $geometry
wm geometry $name +$@x+$@y
#wtf?????
--- 1129,1132 ----
***************
*** 1205,1217 ****
set @dehighlight {}
set @wires {}
! # stores wires in the format of {0 1 1 0} id {1 1 2 0} id
! set @wires_pair {}
set @duplicating 0
#set @wire_hilite {}
- global history
set @history $history
set @file ""
set @directory ""
- global manager
post %s "canvas init: subscribing to $manager"
$self subscribe $manager
--- 1151,1160 ----
set @dehighlight {}
set @wires {}
! set @wires_pair {} ;# stores wires in the format of {0 1 1 0} id {1 1 2 0} id
set @duplicating 0
#set @wire_hilite {}
set @history $history
set @file ""
set @directory ""
post %s "canvas init: subscribing to $manager"
$self subscribe $manager
***************
*** 1300,1303 ****
--- 1243,1270 ----
}
+ def Canvas new_object {sel} {
+ $self editmode= 1
+ mset {x y} $@curpos
+ pd .$self $sel $x $y
+ }
+
+ def Canvas Object {} {$self new_object obj}
+ def Canvas Message {} {$self new_object msg; global canvas; set canvas(msg_isnew) 1} ;# ???
+ def Canvas Number {} {$self new_object floatatom}
+ def Canvas Symbol {} {$self new_object symbolatom}
+ def Canvas Comment {} {$self new_object text}
+ def Canvas Bang {} {$self new_object bng}
+ def Canvas Toggle {} {$self new_object toggle}
+ def Canvas Number2 {} {$self new_object numbox}
+ def Canvas Vslider {} {$self new_object vslider}
+ def Canvas Hslider {} {$self new_object hslider}
+ def Canvas Vradio {} {$self new_object vradio}
+ def Canvas Hradio {} {$self new_object hradio}
+ def Canvas VU {} {$self new_object vumeter}
+ def Canvas dropper {} {$self new_object dropper}
+ def Canvas Canvas {} {$self new_object mycnv}
+ def Canvas Graph {} {$self editmode= 1; pd .x$self graph }
+ def Canvas Array {} {$self editmode= 1; pd .x$self menuarray}
+
def Canvas new_menubar {editable} {
set name .$self
***************
*** 1307,1365 ****
foreach x {file edit view put window help} {menu $m.$x -tearoff $pd_tearoff}
$self populate_menu file {
! {new_file {} ""}
! {open_file {} ""}
! {}
! {send_message {} ""}
! {paths {} ""}
! {}
! {close {} ""}
! {save {} ""}
! {save_as {} ""}
! {print {} ""}
! {}
! {quit {} ""}}
$self populate_menu edit {
! {undo {} ""}
! {redo {} ""}
! {}
! {cut {} ""}
! {copy {} ""}
! {paste {} ""}
! {duplicate {} ""}
! {select_all {} ""}
! {}
! {text_editor {} ""}
! {font_bomb {} {}}
! {tidy_up {} {}}
! {}}
$self populate_menu view {
! {reload {} {}}
! {redraw {} {}}}
# {crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
$self populate_menu put {
! {Object {[%W canvas] editmode= 1;pd .%W obj %X %Y} ""}
! {Message {[%W canvas] editmode= 1;pd .%W msg %X %Y;global canvas;set canvas(msg_isnew) 1} ""}
! {Number {[%W canvas] editmode= 1;pd .%W floatatom %X %Y} ""}
! {Symbol {[%W canvas] editmode= 1;pd .%W symbolatom %X %Y} ""}
! {Comment {[%W canvas] editmode= 1;pd .%W text %X %Y} ""}
! {}
! {Bang {[%W canvas] editmode= 1;pd .%W bng %X %Y} ""}
! {Toggle {[%W canvas] editmode= 1;pd .%W toggle %X %Y} ""}
! {Number2 {[%W canvas] editmode= 1;pd .%W numbox %X %Y} ""}
! {Vslider {[%W canvas] editmode= 1;pd .%W vslider %X %Y} ""}
! {Hslider {[%W canvas] editmode= 1;pd .%W hslider %X %Y} ""}
! {Vradio {[%W canvas] editmode= 1;pd .%W vradio %X %Y} ""}
! {Hradio {[%W canvas] editmode= 1;pd .%W hradio %X %Y} ""}
! {VU {[%W canvas] editmode= 1;pd .%W vumeter %X %Y} ""}
! {dropper {[%W canvas] editmode= 1;pd .%W dropper %X %Y} ""}
! {Canvas {[%W canvas] editmode= 1;pd .%W mycnv %X %Y} ""}
! {}
! {Graph {[%W canvas] editmode= 1;pd .%W graph } {}}
! {Array {[%W canvas] editmode= 1;pd .%W menuarray} {}}}
! $self populate_menu window {
! {"parentwindow" {menu_windowparent} {}}
! {"Pdwindow" {menu_pop_pd} {}}
! {}
! }
$m.edit add checkbutton -label [say edit_mode] \
--- 1274,1295 ----
foreach x {file edit view put window help} {menu $m.$x -tearoff $pd_tearoff}
$self populate_menu file {
! new_file open_file {}
! send_message paths {}
! close save save_as print {}
! quit}
$self populate_menu edit {
! undo redo {}
! cut copy paste duplicate select_all {}
! text_editor font_bomb tidy_up {}}
$self populate_menu view {
! reload redraw}
# {crosshair {global crosshair; set crosshair [expr !!$crosshair]} "" toggle}
$self populate_menu put {
! Object Message Number Symbol Comment {}
! Bang Toggle Number2 Vslider Hslider Vradio Hradio VU dropper Canvas {}
! Graph Array}
! $self populate_menu window {{}}
! # {"parentwindow" {menu_windowparent} ""}
! # {"Pdwindow" {menu_pop_pd} ""}
$m.edit add checkbutton -label [say edit_mode] \
***************
*** 1369,1373 ****
#binds the state of the checkbox to global variable editmod
if {![dict exists $accels "Ctrl+e"]} {
! dict append accels $key(editmodeswitch) {[%W canvas] editmodeswitch}
}
$m.edit configure -postcommand "$self fix_edit_menu"
--- 1299,1303 ----
#binds the state of the checkbox to global variable editmod
if {![dict exists $accels "Ctrl+e"]} {
! dict append accels $key(editmodeswitch) {[%W canvas] editmodeswitch}
}
$m.edit configure -postcommand "$self fix_edit_menu"
***************
*** 2190,2200 ****
if {$id == ""} {
$self populate_menu $p {
! {popup_properties {} ""}
! {popup_help {} ""}}
} {
$id populate_menu $p {
! {popup_properties {} ""}
! {popup_open {} ""}
! {popup_help {} ""}}
}
tk_popup $p $x $y
--- 2120,2130 ----
if {$id == ""} {
$self populate_menu $p {
! popup_properties
! popup_help}
} {
$id populate_menu $p {
! popup_properties
! popup_open
! popup_help}
}
tk_popup $p $x $y
***************
*** 5448,5452 ****
DesireData client: Mathieu Bouchard & Chun Lee
PureData: Miller Puckette feat. Thomas Musil,
! Günther Geiger, Iohannes Zmölnig & others.
Translations:
--- 5378,5382 ----
DesireData client: Mathieu Bouchard & Chun Lee
PureData: Miller Puckette feat. Thomas Musil,
! Günther Geiger, Krzysztof Czaja, Iohannes Zmölnig & others.
Translations:
More information about the Pd-cvs
mailing list