Revision: 40623
          http://brlcad.svn.sourceforge.net/brlcad/?rev=40623&view=rev
Author:   bob1961
Date:     2010-09-20 21:32:35 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
Added centerDialogOverPane method. Modify fillTreeColumns to handle cases where 
tree nodes refer to nonexistent objects.

Modified Paths:
--------------
    brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl

Modified: brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl
===================================================================
--- brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2010-09-20 19:32:00 UTC 
(rev 40622)
+++ brlcad/trunk/src/tclscripts/archer/ArcherCore.tcl   2010-09-20 21:32:35 UTC 
(rev 40623)
@@ -804,6 +804,7 @@
        method buildInfoDialog {_name _title _info _size _wrapOption _modality}
        method buildSaveDialog {}
        method buildViewCenterDialog {}
+       method centerDialogOverPane {_dialog}
 
        # Helper Section
        method buildComboBox {_parent _name1 _name2 _varName _text 
_listOfChoices}
@@ -1801,7 +1802,7 @@
 #                 INTERFACE OPERATIONS
 # ------------------------------------------------------------
 ::itcl::body ArcherCore::closeDb {} {
-    pack forget $itk_component(ged)
+    grid forget $itk_component(ged)
     closeMged
 
     grid $itk_component(canvas) -row 1 -column 0 -columnspan 3 -sticky news
@@ -3194,12 +3195,7 @@
 }
 
 ::itcl::body ArcherCore::doViewCenter {} {
-    if {$mCurrentPaneName == ""} {
-       set pane $mActivePaneName
-    } else {
-       set pane $mCurrentPaneName
-    }
-    set mCurrentPaneName ""
+    set pane [centerDialogOverPane $itk_component(centerDialog)]
 
     set center [$itk_component(ged) pane_center $pane]
     set mCenterX [lindex $center 0]
@@ -3207,7 +3203,6 @@
     set mCenterZ [lindex $center 2]
 
     set mDbUnits [gedCmd units -s]
-    $itk_component(centerDialog) center [namespace tail $this]
     ::update
     if {[$itk_component(centerDialog) activate]} {
        $itk_component(ged) pane_center $pane $mCenterX $mCenterY $mCenterZ
@@ -3341,10 +3336,14 @@
        set vals {}
        set anames {}
        set avals {}
-       foreach {aname aval} [gedCmd attr get $_ctext] {
-           lappend anames $aname
-           lappend avals $aval
+
+       if {![catch {gedCmd attr get $_ctext} alist]} {
+           foreach {aname aval} $alist {
+               lappend anames $aname
+               lappend avals $aval
+           }
        }
+
        foreach attr $mTreeAttrColumns {
            set ai [lsearch $anames $attr]
            if {$ai != -1} {
@@ -5629,8 +5628,6 @@
            -textvariable [::itcl::scope mDbUnits]
     } {}
 
-    after idle "$itk_component(centerDialog) center"
-
     $itk_component(centerDialog) configure -background $LABEL_BACKGROUND_COLOR
 
     set col 0
@@ -5663,7 +5660,20 @@
     wm geometry $itk_component(centerDialog) "275x125"
 }
 
+::itcl::body ArcherCore::centerDialogOverPane {_dialog} {
+    if {$mCurrentPaneName == ""} {
+       set pane $mActivePaneName
+    } else {
+       set pane $mCurrentPaneName
+    }
 
+    set mCurrentPaneName ""
+    $_dialog center [$itk_component(ged) pane_win_name $pane]
+
+    return $pane
+}
+
+
 ################################### Helper Section 
###################################
 
 ::itcl::body ArcherCore::buildComboBox {parent name1 name2 varName text 
listOfChoices} {


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

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to