Update of /cvsroot/pure-data/pd/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29220
Modified Files: Tag: devel_0_39 desire.tk Log Message: first attempt to make desire.tk work without tk
Index: desire.tk =================================================================== RCS file: /cvsroot/pure-data/pd/src/Attic/desire.tk,v retrieving revision 1.1.2.593 retrieving revision 1.1.2.594 diff -C2 -d -r1.1.2.593 -r1.1.2.594 *** desire.tk 27 Nov 2006 18:31:47 -0000 1.1.2.593 --- desire.tk 27 Nov 2006 19:37:45 -0000 1.1.2.594 *************** *** 31,34 **** --- 31,36 ---- # this command rebuilds the package index: echo pkg_mkIndex . | tclsh
+ if {[catch {winfo children .}]} {set tk 0} {set tk 1} + set argh0 [file normalize [file join [pwd] $argv0]] set auto_path [concat . \ *************** *** 39,43 ****
package require poe ! package require bgerror #catch {package require Tclx} #if {[catch {source profile_dd.tcl}]} {error_dump} --- 41,45 ----
package require poe ! if {$tk} {package require bgerror} #catch {package require Tclx} #if {[catch {source profile_dd.tcl}]} {error_dump} *************** *** 238,242 **** def Clipboard2 value {} {return $@value}
! set clipboard [Clipboard1 new] #-----------------------------------------------------------------------------------# #used during subpatcherize --- 240,249 ---- def Clipboard2 value {} {return $@value}
! if {$tk} { ! set clipboard [Clipboard1 new] ! } else { ! set clipboard [Clipboard2 new] ! } ! #-----------------------------------------------------------------------------------# #used during subpatcherize *************** *** 349,378 **** }
! option add *foreground #000000 ! #option add *backgroundPixmap /usr/share/themes/BrushedMetalBlue/gtk/brushed-dark.xpm widgetDefault ! #option add *backgroundPixmap /home/matju/brushed-dark.gif widgetDefault ! option add *font {Helvetica -12} ! foreach tkclass {Menu Button Checkbutton Radiobutton Entry Text Spinbox Scrollbar Canvas} { ! option add *$tkclass*borderWidth 1 ! } ! foreach tkclass {CheckButton RadioButton} { ! option add *$tkclass*selectColor #dd3000 ! } ! foreach tkclass {Entry Text} { ! option add *$tkclass*background #b0c4d8 ! option add *$tkclass*selectBackground #6088b0 ! #option add *$tkclass*background #d8c0c0 # motif-style ! #option add *$tkclass*background #b0d8d8 # hospital-green (call it "lichen") ! #option add *$tkclass*selectBackground #60b0b0 ! } ! option add *__tk__messagebox*Canvas*borderWidth 0 ! ! foreach tkclass {Listbox} { ! option add *$tkclass*background #c4d8b0 ! option add *$tkclass*selectBackground #88b060 ! } ! ! foreach tkclass {Label} { ! #option add *$tkclass*background #909090 }
--- 356,398 ---- }
! if {$tk} { ! option add *foreground #000000 ! option add *font {Helvetica -12} ! foreach tkclass {Menu Button Checkbutton Radiobutton Entry Text Spinbox Scrollbar Canvas} { ! option add *$tkclass*borderWidth 1 ! } ! foreach tkclass {CheckButton RadioButton} { ! option add *$tkclass*selectColor #dd3000 ! } ! foreach tkclass {Entry Text} { ! option add *$tkclass*background #b0c4d8 ! option add *$tkclass*selectBackground #6088b0 ! } ! option add *__tk__messagebox*Canvas*borderWidth 0 ! foreach tkclass {Listbox} { ! option add *$tkclass*background #c4d8b0 ! option add *$tkclass*selectBackground #88b060 ! } ! foreach tkclass {Label} { ! #option add *$tkclass*background #909090 ! } ! # very small icons: ! foreach {name w h values} { ! icon_empty 7 7 "0,0,0,0,0,0,0" ! icon_plus 7 7 "8,8,8,127,8,8,8" ! icon_minus 7 7 "0,0,0,127,0,0,0" ! icon_uparrow 7 5 "8,28,62,127,0" ! icon_downarrow 7 5 "0,127,62,28,8" ! } { ! image create bitmap $name -data "#define z_width $w\n#define z_height $h ! static unsigned char z_bits[] = { $values };" ! } ! # it's unfortunate but we seem to have to turn off global bindings ! # for Text objects to get control-s and control-t to do what we want for ! # "text" dialogs below. Also we have to get rid of tab's changing the focus. ! bind all <Key-Tab> "" ! bind all <<PrevWindow>> "" ! bind Text <Control-t> {} ! bind Text <Control-s> {} }
*************** *** 393,408 **** }
- # very small icons: - foreach {name w h values} { - icon_empty 7 7 "0,0,0,0,0,0,0" - icon_plus 7 7 "8,8,8,127,8,8,8" - icon_minus 7 7 "0,0,0,127,0,0,0" - icon_uparrow 7 5 "8,28,62,127,0" - icon_downarrow 7 5 "0,127,62,28,8" - } { - image create bitmap $name -data "#define z_width $w\n#define z_height $h - static unsigned char z_bits[] = { $values };" - } - switch $::OS { osx {set pd_tearoff 0} --- 413,416 ---- *************** *** 410,423 **** }
- # it's unfortunate but we seem to have to turn off global bindings - # for Text objects to get control-s and control-t to do what we want for - # "text" dialogs below. Also we have to get rid of tab's changing the focus. - - bind all <Key-Tab> "" - bind all <<PrevWindow>> "" - bind Text <Control-t> {} - bind Text <Control-s> {} - # puts stderr [bind all] - proc guess_lang {} { set lang C --- 418,421 ---- *************** *** 431,435 **** set leet 0
- proc say {k args} { global text leet --- 429,432 ---- *************** *** 884,887 **** --- 881,889 ---- # it's necessary to raise the window on OSX switch $::OS { osx {raise .; wm iconify .; after 100 {wm deiconify .}}} + after 0 { + Listener new .tcl "Tcl Client" tcl_eval + Listener new .pd " Pd Server" pd_eval + } + if {$::cmdline(console)} {make_console} }
*************** *** 979,984 **** }
- set main [Client new] - #-----------------------------------------------------------------------------------# #fixme: actually, is it ok that View<Menuable ? --matju --- 981,984 ---- *************** *** 1820,1825 **** }
- set window_list [list $main] - def Menuable fix_window_menu {} { global window_list --- 1820,1823 ---- *************** *** 5496,5501 **** }
- if {$cmdline(console)} {make_console} - ############ evaluator
--- 5494,5497 ---- *************** *** 5576,5585 **** proc pd_eval {self l} {post %s "pd: $l"; pd $l}
- after 0 { - Listener new .tcl "Tcl Client" tcl_eval - Listener new .pd " Pd Server" pd_eval - - } - ############ button bar
--- 5572,5575 ---- *************** *** 7425,7426 **** --- 7415,7426 ---- # Nous sommes donc en présence d'un incendie. C'est normal... def OopsDialog damn {} {$self ok} + + #---------------------------------------------------------------- + + if {$tk} { + set main [Client new] + set window_list [list $main] + } else { + package require tclreadline + ::tclreadline::Loop + }