[PD-dev] geometry setting patch for pd-gui.tcl & pdwindow.tcl

errordeveloper at gmail.com errordeveloper at gmail.com
Tue Aug 3 00:17:32 CEST 2010


this is against the git tree

patch adds -geometry flag and removes hardcoded setting

it seems perfectly safe to do `wm geometry my_window ""`

this way it supposed to do nothing, as i figured ..

try in wish:
 > wish 
% wm geometry . ""
% wm geometry . "100x100"
% wm geometry . ""
% 

it it just resets to default ;)

i was talking to Hans about this,
and he said that ~/.pdrc is not the same thing
on all platforms, ..because my idea was that
"-geometry 1000x1000" could be added to pdrc file
if anyone wants to set their own geometry..
-------------- next part --------------
diff --git a/tcl/pd-gui.tcl b/tcl/pd-gui.tcl
index 12a29e1..ca005ed 100755
--- a/tcl/pd-gui.tcl
+++ b/tcl/pd-gui.tcl
@@ -114,6 +114,13 @@ set port 0
 # canvas font, received from pd in pdtk_pd_startup, set in s_main.c
 set font_family "courier"
 set font_weight "normal"
+
+# pdwindow geometry
+# to get what we used to have:
+# set geometry "=500x400+20+50"
+# it is safe to set it to ""
+set geometry ""
+
 # sizes of chars for each of the Pd fixed font sizes:
 #  fontsize  width(pixels)  height(pixels)
 set font_fixed_metrics {
@@ -490,6 +497,7 @@ proc parse_args {argc argv} {
     opt_parser::init {
         {-stderr    set {::stderr}}
         {-verbose   set {::verbose}}
+	{-geometry  lappend {- ::geometry}}
         {-open      lappend {- ::filestoopen_list}}
     }
     set unflagged_files [opt_parser::get_options $argv]
@@ -508,7 +516,7 @@ proc parse_args {argc argv} {
         foreach filename $unflagged_files {
             lappend ::filestoopen_list $filename
         }
-    }
+    } 
 }
 
 proc open_filestoopen {} {
diff --git a/tcl/pdwindow.tcl b/tcl/pdwindow.tcl
index 77d0cf7..4b6e0f3 100644
--- a/tcl/pdwindow.tcl
+++ b/tcl/pdwindow.tcl
@@ -254,7 +254,8 @@ proc ::pdwindow::create_window {} {
     } else {
         wm minsize .pdwindow 400 51
     }
-    wm geometry .pdwindow =500x400+20+50
+    #puts $::geometry
+    wm geometry .pdwindow $::geometry
     .pdwindow configure -menu .menubar
 
     frame .pdwindow.header -borderwidth 1 -relief flat -background lightgray


More information about the Pd-dev mailing list