-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1978 from UV-CDAT/vcs_fix_geometry_instantiation
Vcs fix geometry instantiation
- Loading branch information
Showing
4 changed files
with
58 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import sys, vcs | ||
|
||
# This will check if we can set the geometry | ||
# at the initialization of canvas | ||
canvas = vcs.init(geometry=(600, 400)) | ||
canvas.open() | ||
|
||
if dict(width=600, height=400) != canvas.geometry(): | ||
canvas.close() | ||
sys.exit(1) | ||
|
||
canvas.close() | ||
|
||
canvas2 = vcs.init() | ||
|
||
# This will check if we can safely set the geometry even | ||
# though the canvas window has not been created yet | ||
canvas2.geometry(400, 400) | ||
canvas2.open() | ||
if dict(width=400, height=400) != canvas2.geometry(): | ||
canvas2.close() | ||
sys.exit(1) | ||
|
||
# This will check if we can dynamically change the geometry | ||
canvas2.geometry(500, 400) | ||
canvas2.geometry(500, 500) | ||
if dict(width=500, height=500) != canvas2.geometry(): | ||
canvas2.close() | ||
sys.exit(1) | ||
|
||
canvas2.close() | ||
sys.exit(0) |