hm_winfo

Returns the value of certain HyperMesh window settings.

Syntax

hm_winfo option

Type

HyperMesh Tcl GUI Command

Description

This command returns the value of certain HyperMesh window settings.

Inputs

option
The option to query. Valid values are:
  • x - Window x location in pixels
  • y - Window y location in pixels
  • width - Window width in pixels
  • height - Window height in pixels
  • graphicx - x location in pixels of the upper left of the modeling window
  • graphicy - y location in pixels of the upper left of the modeling window
  • graphicwidth - modeling window width in pixels
  • graphicheight - modeling window height in pixels
  • headlineheight - Headline area height in pixels
  • borderwidth - Window border width in pixels
  • menucharheight - menu bar character height in pixels
  • menuheight - menu bar height (not including control card) in pixels
  • menulines - The height in lines of the panel area
  • hasfocus - Returns nonzero if the focus is in the HyperMesh window, zero otherwise.
  • isobscured - Returns nonzero if the HyperMesh window is viewable but obscured by other windows, zero otherwise.
  • viewmatrix - Returns the coordinates and scaling of the display area. These values are the same as those used by *viewset.
  • entitycolors ?index? - If an index 1 through 64 is specified, returns a list of 3 RGB values for that color. If no index is specified, returns a list of RGB triplets for all colors.
  • color index - Returns the RGB color value for the specified widget index.
  • utilitywindow - Returns the window path to the utility tab.

Example

To force a Tcl top level to be displayed overtop of the Utility menu area.

set x  [ hm_winfo x ];
set y  [ hm_winfo y ];
set hh [ hm_winfo headlineheight ];
set bw [ hm_winfo borderwidth ];
set w  [ hm_winfo width ];
set h  [ hm_winfo height ];

set gw [ hm_winfo graphicwidth ];
set gh [ hm_winfo graphicheight ];

if { [ OnPc ] } {
    set geom [ format "%dx%d+%d+%d" \
        [ expr $w - $gw - ( 3 * $bw ) ] \
        [ expr $gh - $hh ] \
        [ expr $x + $gw + $bw ] $y]; 
} else {
    set geom [ format "%dx%d+%d+%d" \
        [ expr $w - $gw - ( 2 * $bw ) ] \
        [ expr $gh - $hh - $bw ] \
        [ expr $x + $gw + $bw ] \
         $y]; 
}

CreateWindow overlay \
    nogeometrysaving \
    nocancel \
    nocommandarea \
    relief          "flat" \
    minsize          0 200 \
    geometry        $geom;

Errors

Incorrect usage results in a Tcl error. To detect errors, you can use the catch command:
if { [ catch {command_name...} ] } {
   # Handle error
}

Version History

10.0