Last modified: December 2013

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

add_frame

Context: frames

Synopsis

Creates a frame.

Syntax

add_frame([id,] [attributes])
add_frame([id,] x1, y1, x2, y2 [,attributes])

Description

The function arguments.

Argument Description
id A ChipsId structure identifying the item.
x1, y1, x2, y2 The lower left (x1,y1) and upper right (x2,y2) corners of the frame in window normalized coordinates.
attributes Configure object properties by giving an attribute string (a space-separated list of key=value pairs), list, dictionary, or a ChIPS object.

The add_frame command creates a frame whose attributes are specified by user preferences or in an attribute list. The new frame becomes current by default; providing a ChipsId overrides the currency state.

The frame takes up the full size of the window in which it is created, unless the corner values (x1, y1) and (x2, y2) are supplied.

Customizing the Frame

There are several attributes that control the frame characteristics. The attributes can be set to the ChIPS defaults, values provided in the add_frame command, or values from the user's preference file.

The attributes may also be modified with the set_frame command at any time; see "ahelp set_frame" and "ahelp setget" for more information.

Please see the section "Frame Preferences and Attributes" below the examples for a list of the frame preferences.


Examples

Example 1

chips> add_frame()

Add a frame that fills the window. If no ChIPS window exists then one will be created automatically.

Example 2

chips> add_frame(["bgcolor", "red"])
chips> add_frame(0.1, 0.1, 0.4, 0.7, "bgcolor=blue")

The first call creates a frame that fills the whole window and sets its background color to red. The second call creates a frame with the lower left corner at (0.1,0.1) and the upper right corner at (0.4,.7), with a background color of blue.

Example 3

chips> add_window(300, 500, "mm", "id=MM300500")
chips> add_window(4, 4, "inches", "id=Window2")
chips> id = ChipsId()
chips> id.window = "MM300500"
chips> add_frame(id)

Use the ChipsId structure to indicate to which window the new frame should be added.

Example 4

chips> frm = ChipsFrame()
chips> frm.transparency = True
chips> add_frame(frm)

Populate the "frm" structure with the attribute values, then add a frame.


Frame Preferences and Attributes

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

Attribute Description Options Default Set?
aspect Maintain the aspect ration of the frame when changing tiling modes? see the Booleans section of "ahelp chipsopt" true Yes
bgcolor Background color of the frame. name or hex; see the Color section of "ahelp chipsopt" default Yes
border.color Color of the border denoting the location of a frame in the window. name or hex; see the Color section of "ahelp chipsopt" default Yes
border.visible Boolean flag indicating if the frame border should be visible. see the Booleans section of "ahelp chipsopt" false Yes
mode how the frame is displayed in the window placed or single placed No
scale If set to true, all labels inside a window are rescaled as the window size is altered. see the Booleans section of "ahelp chipsopt" true Yes
stem Default stem for newly created frames An alpha-numeric character sequence that does not contain a space frm No
transparency Boolean flag indicating whether any object behind the frame is visible. see the Booleans section of "ahelp chipsopt" false Yes

Bugs

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

See Also

chips
chips, chipsgui, chipsrc, show_gui
concepts
aspectratio, attributes, chipsid, chipsopt, colors, coordsys, currency, depthcontrol, entitycreation, preferences, setget
frames
arrange_frames, blink_frames, current_frame, delete_frame, display_frame, get_frame, hide_frame, move_frame, next_frame, reposition_frame, set_frame, tile, view_placed_frame, view_single_frame
utilities
erase, get_object_count