[PD-cvs] SF.net SVN: pure-data:[10589] branches/pd-extended/0.41/pd/src

eighthave at users.sourceforge.net eighthave at users.sourceforge.net
Wed Jan 21 23:01:26 CET 2009


Revision: 10589
          http://pure-data.svn.sourceforge.net/pure-data/?rev=10589&view=rev
Author:   eighthave
Date:     2009-01-21 22:01:21 +0000 (Wed, 21 Jan 2009)

Log Message:
-----------
- added Miller's code from 0.42 for attaching the pdtk_check dialogs to the
  canvas that it applies to

- added a "raise" command on that canvas so that the Pd window will go to the
  top when someone selects quit.

Modified Paths:
--------------
    branches/pd-extended/0.41/pd/src/g_editor.c
    branches/pd-extended/0.41/pd/src/u_main.tk

Modified: branches/pd-extended/0.41/pd/src/g_editor.c
===================================================================
--- branches/pd-extended/0.41/pd/src/g_editor.c	2009-01-21 20:05:26 UTC (rev 10588)
+++ branches/pd-extended/0.41/pd/src/g_editor.c	2009-01-21 22:01:21 UTC (rev 10589)
@@ -1687,12 +1687,12 @@
     {
         canvas_vis(g2, 1);
         sys_vgui(
-"pdtk_check {Discard changes to this window??} {.x%lx menuclose 3;\n} no\n",
-                g2);
+"pdtk_check .x%lx {Discard changes to '%s'?} {.x%lx menuclose 3;\n} no\n",
+            canvas_getrootfor(g2), canvas_getrootfor(g2)->gl_name->s_name, g2);
         return;
     }
     if (f == 0)
-        sys_vgui("pdtk_check {really quit?} {pd quit;\n} yes\n");
+        sys_vgui("pdtk_check . {really quit?} {pd quit;\n} yes\n");
     else glob_quit(0);
 }
 
@@ -1716,15 +1716,17 @@
         {
             canvas_vis(g, 1);
             sys_vgui(
-"pdtk_check {Discard changes to this window??} {.x%lx menuclose 2;\n} no\n",
-                g);
+"pdtk_check .x%lx {Discard changes to '%s'?} {.x%lx menuclose 2;\n} no\n",
+                canvas_getrootfor(g), canvas_getrootfor(g)->gl_name->s_name, g);
             return;
         }
         else
         {
-/*             sys_vgui( */
-/* 				"pdtk_check {Close this window??} {.x%lx menuclose 1;\n} yes\n", */
-/*                 x); */
+/*
+            sys_vgui(
+"pdtk_check .x%lx {Close '%s'?} {.x%lx menuclose 1;\n} yes\n",
+                canvas_getrootfor(x), canvas_getrootfor(x)->gl_name->s_name, x);
+*/
 			pd_free(&x->gl_pd);
         }
     }
@@ -1740,8 +1742,8 @@
         {
             canvas_vis(g, 1);
             sys_vgui(
-"pdtk_check {Discard changes to this window??} {.x%lx menuclose 2;\n} no\n",
-                g);
+"pdtk_check .x%lx {Discard changes to '%s'?} {.x%lx menuclose 2;\n} no\n",
+                canvas_getrootfor(x), canvas_getrootfor(x)->gl_name->s_name, g);
             return;
         }
         else pd_free(&x->gl_pd);

Modified: branches/pd-extended/0.41/pd/src/u_main.tk
===================================================================
--- branches/pd-extended/0.41/pd/src/u_main.tk	2009-01-21 20:05:26 UTC (rev 10588)
+++ branches/pd-extended/0.41/pd/src/u_main.tk	2009-01-21 22:01:21 UTC (rev 10589)
@@ -414,9 +414,17 @@
 }
 
 ##### routine to ask user if OK and, if so, send a message on to Pd ######
-proc pdtk_check {x message default} {
-    set answer [tk_messageBox \-message $x \-type yesno -default $default \
-                    -icon question]
+proc pdtk_check {canvas x message default} {
+    global pd_nt
+	raise $canvas
+    if {$pd_nt == 1} {
+        set answer [tk_messageBox -message $x -type yesno -default $default \
+            -icon question]
+    } else {
+        set answer [tk_messageBox -message $x -type yesno -default $default \
+            -parent $canvas -icon question]
+    }
+	puts stderr "raise $canvas"
     if {! [string compare $answer yes]}  {pd $message}
 }
 


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.




More information about the Pd-cvs mailing list