[GRASS-SVN] r41579 -
grass/branches/develbranch_6/visualization/nviz/scripts
svn_grass at osgeo.org
svn_grass at osgeo.org
Sat Mar 27 14:13:03 EDT 2010
Author: marisn
Date: 2010-03-27 14:13:02 -0400 (Sat, 27 Mar 2010)
New Revision: 41579
Modified:
grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script
Log:
nviz: Fail gracefully on Togl initialization failure
Modified: grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script
===================================================================
--- grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script 2010-03-27 13:33:10 UTC (rev 41578)
+++ grass/branches/develbranch_6/visualization/nviz/scripts/nviz2.2_script 2010-03-27 18:13:02 UTC (rev 41579)
@@ -265,22 +265,34 @@
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
- pack $Nv_(TOP).canvas -side top -fill both -expand yes
+ if { [catch {togl $Nv_(TOP).canvas -rgba true -double true -depth true
+ pack $Nv_(TOP).canvas -side top -fill both -expand yes} ] } {
+ tk_messageBox -type ok -message { Togl canvas initialization failed. Is Your OpenGL working fine? }
+ return 1
+ }
}
bind $Nv_(TOP).canvas <Expose> {Nv_expose %W}
@@ -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