Revision: 10541 http://pure-data.svn.sourceforge.net/pure-data/?rev=10541&view=rev Author: eighthave Date: 2009-01-13 18:57:06 +0000 (Tue, 13 Jan 2009)
Log Message: ----------- - added prototype for saveas proc
- moved pdtk_canvas_new from pd.tk to pdtk_canvas.tcl
- added sketch for proper "file modified, save? yes, no, cancel" dialog
Modified Paths: -------------- branches/pd-devel/0.41.4/src/pd.tk branches/pd-devel/0.41.4/src/pdtk_canvas.tcl
Modified: branches/pd-devel/0.41.4/src/pd.tk =================================================================== --- branches/pd-devel/0.41.4/src/pd.tk 2009-01-13 18:42:17 UTC (rev 10540) +++ branches/pd-devel/0.41.4/src/pd.tk 2009-01-13 18:57:06 UTC (rev 10541) @@ -141,44 +141,16 @@ } }
-# TODO it probably makes sense to add a new function for -type yesnocancel -# dialogs that would be useful for "Save, Discard, Cancel" dialogs +# TODO it probably makes sense to add a new function for for "Save, Discard, +# Cancel" dialogs using tk_dialog +proc pdtk_check_modified {message reply_to_pd default} { +}
proc pdtk_fixwindowmenu {} { #TODO figure out how to do this cleanly puts stderr "Running pdtk_fixwindowmenu" }
-proc pdtk_canvas_new {mytoplevel width height geometry editable} { - # TODO check size of window - toplevel $mytoplevel -width $width -height $height - ::pd_menus::create_menubar $mytoplevel.menubar - $mytoplevel configure -menu $mytoplevel.menubar - - # TODO slide off screen windows into view - wm geometry $mytoplevel $geometry - if {$::windowingsystem eq "aqua"} { - wm minsize $mytoplevel 50 20 - } else { # leave room for the menubar - wm minsize $mytoplevel 310 30 - } - canvas $mytoplevel.c -width $width -height $height -background white \ - -highlightthickness 0 - # TODO add scrollbars here - pack $mytoplevel.c -side left -expand 1 -fill both - - ::pd_bindings::canvas_bindings $mytoplevel - - # the popup menu for the canvas - menu $mytoplevel.popup -tearoff false - $mytoplevel.popup add command -label "Properties" \ - -command "popup_action $mytoplevel 0" - $mytoplevel.popup add command -label "Open" \ - -command "popup_action $mytoplevel 1" - $mytoplevel.popup add command -label "Help" \ - -command "popup_action $mytoplevel 2" -} - proc check_font {$fontname} { # TODO check to see if the requested font exists using [font families] }
Modified: branches/pd-devel/0.41.4/src/pdtk_canvas.tcl =================================================================== --- branches/pd-devel/0.41.4/src/pdtk_canvas.tcl 2009-01-13 18:42:17 UTC (rev 10540) +++ branches/pd-devel/0.41.4/src/pdtk_canvas.tcl 2009-01-13 18:57:06 UTC (rev 10541) @@ -6,10 +6,41 @@ namespace eval ::pdtk_canvas:: { }
-proc pdtk_canvas_checkgeometry {mytoplevel} { - # TODO check and relocate window accordingly +#------------------------------------------------------------------------------# +# canvas new/saveas + +proc pdtk_canvas_new {mytoplevel width height geometry editable} { + # TODO check size of window + toplevel $mytoplevel -width $width -height $height + ::pd_menus::create_menubar $mytoplevel.menubar + $mytoplevel configure -menu $mytoplevel.menubar + + # TODO slide off screen windows into view + wm geometry $mytoplevel $geometry + if {$::windowingsystem eq "aqua"} { # no menubar, it can be small + wm minsize $mytoplevel 50 20 + } else { # leave room for the menubar + wm minsize $mytoplevel 310 30 + } + canvas $mytoplevel.c -width $width -height $height -background white \ + -highlightthickness 0 + # TODO add scrollbars here + pack $mytoplevel.c -side left -expand 1 -fill both + + ::pd_bindings::canvas_bindings $mytoplevel + + # the popup menu for the canvas + menu $mytoplevel.popup -tearoff false + $mytoplevel.popup add command -label "Properties" \ + -command "popup_action $mytoplevel 0" + $mytoplevel.popup add command -label "Open" \ + -command "popup_action $mytoplevel 1" + $mytoplevel.popup add command -label "Help" \ + -command "popup_action $mytoplevel 2" }
+proc pdtk_canvas_saveas {name initfile initdir} { +}
#------------------------------------------------------------------------------# # mouse usage @@ -65,3 +96,7 @@ proc pdtk_canvas_getscroll {mytoplevel} { # TODO make this work } + +proc pdtk_canvas_checkgeometry {mytoplevel} { + # TODO check and relocate window accordingly +}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.