[GRASS-SVN] r41583 -
grass/branches/releasebranch_6_4/visualization/nviz/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 28 06:44:41 EDT 2010
Author: marisn
Date: 2010-03-28 06:44:40 -0400 (Sun, 28 Mar 2010)
New Revision: 41583
Modified:
grass/branches/releasebranch_6_4/visualization/nviz/scripts/nviz2.2_script
Log:
nviz: Fail gracefully on Togl initialization failure (merge from develbranch_6 r41579)
Modified: grass/branches/releasebranch_6_4/visualization/nviz/scripts/nviz2.2_script
===================================================================
--- grass/branches/releasebranch_6_4/visualization/nviz/scripts/nviz2.2_script 2010-03-27 22:02:03 UTC (rev 41582)
+++ grass/branches/releasebranch_6_4/visualization/nviz/scripts/nviz2.2_script 2010-03-28 10:44:40 UTC (rev 41583)
@@ -265,21 +265,33 @@
set cheight [exec $src_boot/bin/g.gisenv X3D_HEIGHT]
if {$cwidth > 0 && $cheight > 0} {
- togl $Nv_(TOP).canvas -rgba true -double true -depth true \
- -width $cwidth -height $cheight
+ if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true \
+ -width $cwidth -height $cheight} ] } {
+ tk_messageBox -type ok -message { Togl canvas initialization failed. Is Your OpenGL working fine? }
+ return 1
+ }
pack $Nv_(TOP).canvas -side top -expand no
} elseif {$cwidth == "" && $cheight > 0} {
- togl $Nv_(TOP).canvas -rgba true -double true -depth true \
- -height $cheight
+ if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true \
+ -height $cheight} ] } {
+ tk_messageBox -type ok -message { Togl canvas initialization failed. Is Your OpenGL working fine? }
+ return 1
+ }
pack $Nv_(TOP).canvas -side top -fill x -expand yes
} elseif {$cheight == "" && $cwidth > 0} {
- togl $Nv_(TOP).canvas -rgba true -double true -depth true \
- -width $cwidth
+ if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true \
+ -width $cwidth} ] } {
+ tk_messageBox -type ok -message { Togl canvas initialization failed. Is Your OpenGL working fine? }
+ return 1
+ }
pack $Nv_(TOP).canvas -side top -fill y -expand yes
} else {
#nothing set
set constrained 1
- togl $Nv_(TOP).canvas -rgba true -double true -depth true
+ if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true} ] } {
+ tk_messageBox -type ok -message { Togl canvas initialization failed. Is Your OpenGL working fine? }
+ return 1
+ }
pack $Nv_(TOP).canvas -side top -fill both -expand yes
}
@@ -1049,7 +1061,9 @@
Nset_cancel_func update
# and start the ball rolling...
-Nv_makeGUI $Nv_(AREA)
+if { [Nv_makeGUI $Nv_(AREA)] == 1 } {
+ exit
+}
# Center the view on initialization
look_center
More information about the grass-commit
mailing list