TNTmips

HOME

FREE PRODUCTS
  TNTlite
  TNTatlas
  TNTsim3D

DOWNLOADS
  Release Version
  Development Version
  FTP
  Language Kits
  Sample Geodata
  Reseller Resources
  Promotional

DOCUMENTATION
  Tutorials
  Technical Guides
  Quick Guides

SITE MAP


view.sml


### VIEW.SML
### Sample script for Building Dialogs in SML

### Creates and opens a standard View window
### and displays a selected raster.

### Define class instances used in procedures.
class GRE_GROUP gp; 		# spatial group for display.
class XmForm vwin;		# parent form for window.

### Define procedure to close window.
# Called when user clicks on the "X" close button on the title bar.
proc OnClose(class widget widget) {
	DestroyWidget(vwin);
	GroupDestroy(gp);
}

### Define procedure called when dialog is destroyed.
# Can be either by the "Close" menu item or by us
# calling DestroyWidget() above.
proc OnDestroy() {
	Exit();
}

##################################
### Main program
##################################
raster R;
GetInputRaster(R);

# Create group to be shown in View window.
gp = GroupCreate();	 

# Create parent form for View and add callbacks
# for procedures defined above.
vwin = CreateFormDialog("Sample View Window");
WidgetAddCallback(vwin.Shell.PopdownCallback, OnClose);
WidgetAddCallback(vwin.DestroyCallback, OnDestroy);

class GRE_VIEW view;		# Create view to display the group.
view = GroupCreateView(gp,vwin,"",360,280,
	"NoScalePosLine,DestroyOnClose");

GroupQuickAddRasterVar(gp,R);		# Add raster to group.

DialogOpen(vwin);			# Open view and redraw full.
ViewRedrawFull(view);

WaitForExit();


Back Home ©MicroImages, Inc. 2008 Published in the United States of America
11th Floor - Sharp Tower, 206 South 13th Street, Lincoln NE 68508-2010   USA
Business & Sales: (402)477-9554  Support: (402)477-9562  Fax: (402)477-9559
Business info@microimages.com  Support support@microimages.com  Web webmaster@microimages.com

16 May 2008

page update: 14 Aug 07