Last modified: December 2013

URL: https://cxc.cfa.harvard.edu/chips/ahelp/set_window.html
AHELP for CIAO 4.11 ChIPS v1

set_window

Context: windows

Synopsis

Modifies the attributes of an existing window.

Syntax

set_window(attributes)
set_window(id, attributes)

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item, or a string containing the name of the object.
attributes Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object.

The set_window command sets the specified attributes to the provided values. The modified window becomes current. Multiple windows may be modified with a single command by setting the currency to "all".

Customizing the Window

There are several attributes that control the characteristics of windows. The set_window command may be used to modify the attribute values of an existing window at any time during a ChIPS session. See "ahelp attributes" and "ahelp setget" for more general information.

If multiple attributes are being set simultaneously and one of them fails, the entire command will fail and the window will not be modified.

Please see the section "Window Preferences and Attributes" below the examples for a list of the window attributes.

Note that the window title is not included in the attributes. To set the title, use the set_window_title command.

Certain window properties, such as height and width, can not be modified after the window is created. See "ahelp add_window" for more details on setting these properties when the window is created.

Advanced Functions

The module of advanced ChIPS functions contains other commands for setting attribute values (refer to "ahelp chips" for information on loading the module):

set_window_bgcolor
set_window_redraw

set_window_redraw is a boolean (see the Booleans section of "ahelp chipsopt") that determines whether the window is updated as each command is executed. The default value is True.


Examples

Example 1

chips> clear()
chips> add_curve(x, y, ["window.display", False, "symbol.style",
"none"])
chips> set_plot_xlabel(r"Wavelength (\AA)")
chips> set_plot_ylabel("Flux (erg cm^{-2} s^{-1})")
chips> log_scale()
chips> set_window(["display", True])

The add_curve call creates a window, due to the call to clear, ands sets its display attribute to False, which means that no window will be visible on screen. Several changes are made to the plot - axis labels added and both axes set to use a logarithmic scale - before the final set_window call changes the display setting back to True. At this point the window and its contents become visible, and any future changes to the visualization will be immediately reflected on screen.

Example 2

chips> add_window()
chips> set_window(["bgcolor", "blue"])

Using an attribute/value pair, set the window background color to blue.

Example 3

chips> set_window({"bgcolor": "blue"})

Use a dictionary, rather than a list, to change the bgcolor attribute of the window.

Example 4

chips> add_window()
chips> ws = ChipsWindow()
chips> ws.bgcolor = "blue"
chips> set_window (ws)

Using a ChIPS window attribute object, set the window background color to blue.

Example 5

chips> add_window(5, 8, "inches", ["bgcolor", "navy"])
chips> set_window("bgcolor=green")

Add a window with a navy background, then use a list to change it to green.


Window Preferences and Attributes

The attributes associated with windows are given in the following table, where the "Set?" column refers to whether the attribute can be changed using the set_window() command. To change the window preference settings prepend "window." to the attribute name.

Attribute Description Options Default Set?
bgcolor Background Color of the window name or hex; see the Color section of "ahelp chipsopt" default: white in the ChIPS window, black on printout Yes
display Flag indicating whether the window should be rendered see the Booleans section of "ahelp chipsopt" true Yes
geom A geometry hint to the window manager to say where the ChIPS window should be created (this setting may be ignored, depending on the window manager in use). The format is either a blank string or a string containing two signed integers such as "+100+50", "+0+20", or "+0+0". No
grid.color The color to draw the grid lines. name or hex; see the Color section of "ahelp chipsopt" default No
grid.scale Where should the grid lines be drawn? One of quarterinch, halfinch, cm, or normalized (spacing of a tenth of the window width/height). These can also be specified as default (for quarterinch) or the enumerations 0, 1, 2, 3, 4 for default, quarterinch, halfinch, cm, normalized respectively. quarterinch No
grid.style The style used to draw the grid lines. see the Line Style section of "ahelp chipsopt" longdash No
grid.thickness The thickness used to draw the grid lines. 0.5 to 10.0; see the Thickness section of "ahelp chipsopt" 1 No
grid.visible Should the grid be visible or not. see the Booleans section of "ahelp chipsopt" false No
height window height Numerical value expressed in either inches, centimeters, millimeters or pixels 360 pixels No
scaleheight factor to scale window to display at approximate height positive floating point value 1.25 No
scalewidth factor to scale window to display at approximate width positive floating point value 1.25 No
smoothing use VTK's smoothing to reduce anti-aliasing see the Booleans section of "ahelp chipsopt" true No
stem Stem used for window id An alpha-numeric character sequence that does not contain a space win No
prefix Prefix added to window id to create the text that the window manager may use to label the ChIPS window. "chips - " No
units Units of the window width and height dimensions inches|cm|mm|pixels pixels No
width window width Numerical value expressed in either inches, centimeters, millimeters or pixels 360 pixels No

Bugs

See the bugs pages on the ChIPS website for an up-to-date listing of known bugs.

See Also

utilities
clear
windows
add_window, current_window, deiconify_window, delete_window, get_window, iconify_window, print_window