Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Unknown macro: {alias}

Name

mainwindow — Manipulate Geocap's main menu interface

Syntax

mainwindow open filename
mainwindow newtab tabname
mainwindow settab tabname
mainwindow tabexists tabname
mainwindow closetab tabname
mainwindow toolsmenu
mainwindow helpmenu
mainwindow toolbox
mainwindow menubar
mainwindow statusmessage message [ timeout ]

Description

The mainwindow commands allows you to alter the main interface of Geocap. Typical tasks include adding menus, tabs, and opening files. Some arguments return a particular widget for further manipulation using standard QTcl syntax.

Arguments

open filename

Unknown macro: {indent}

The open command opens a file. The file should be recognizeable by Geocap. It is equivalent to performing the File->Open menu action in the main menu.

newtab tabname

Unknown macro: {indent}

The newtab adds another tab to the central tab widget.

settab tabname

Unknown macro: {indent}

Makes visible the given tab. An error is returned if the tab does not exist.

tabexists tabname

Unknown macro: {indent}

Returns the value 1 (true) if the tab exists, else 0.

closetab tabname

Unknown macro: {indent}

Closes the given tab page. It is an error if the page does not exist.

toolsmenu

Unknown macro: {indent}

Returns the Geocap Tools menu. This can be further modified using conventional QTcl commands, as shown in the following example.

Example 1. Retrieving the Tools menu

# Get menu
set toolsmenu [mainwindow toolsmenu]

# syntax : 
# qaddaction menu itemname commands
qaddaction $toolsmenu "Hello" { qinformation Hello "Hello there!" }

helpmenu

Unknown macro: {indent}

Returns the Geocap Help menu. This can be further modified using conventional QTcl commands, as shown in the following example.

Example 2: Retrieving the Help menu

# Get menu
set helpmenu [mainwindow helpmenu]

# syntax : 
# qaddaction menu itemname commands
qaddaction $helpmenu "Hello" { qinformation Hello "Hello there!" }

toolbox

Unknown macro: {indent}

Returns the Geocap Toolbox. The tool box resembles a vertically stacked tab widget. The Geocap toolbox contains items like the command shell and color tables. The toolbox can be further modified using conventional QTcl commands, as shown in the following example.

Example 3: Retrieving the Toolbox

 # Get the toolbox
 set toolbox [mainwindow toolbox]

 # Create an editor...(this could be any widget)
 set editor [qtextedit ]

 #... and add the editor to the toolbox
 qadditem $toolbox "My Editor" $editor
            

menubar

Unknown macro: {indent}

Returns the Geocap main menubar, located along the top of the main interface. This allows you to add additional menus using QTcl.

Example 4. Retrieving the menubar

# Get menu bar
set menubar [mainwindow menubar]

# Add menu
set menu [qaddmenu $menubar "My Menu"]

# syntax : 
# qaddaction menu itemname commands
qaddaction $menu "Hello" { qinformation Hello "Hello there!" }

statusmessage message [timeout]

Unknown macro: {indent}

Shows a message in the status bar, located along the bottom of the main interface. The optional timeout argument sets the duration in milliseconds.

  • No labels