WindowHandleView:
Filter:
WindowHandleView/Classes (extension) | GUI

WindowHandleView
ExtensionExtension

A custom view that enables dragging of it's parent window.

Description

WindowHandleView is a view that acts as a drag handle for it's parent window. This is generally useful for windows without titlebars.

NOTE: By default WindowHandleView has no content other than it's background, so if it's contained in a layout it may be resized to a 0px width or height. To prevent this, specify an explicit size using View: -minHeight / View: -minWidth / View: -minSize or View: -fixedHeight / View: -fixedWidth / View: -fixedSize.

Class Methods

.new

Creates a new instance of View and makes it a child of another View or Window, effectively placing it within the parent's visual space. If there is a decorator installed on the parent, it will manage the position of the new View.

NOTE: The 'parent' argument may be omitted, in which case the view will be displayed as a window on its own, when shown.

The 'bounds' argument may be omitted, in which case the view will be created with its preferred size at position (0,0).

If a parent is given and there is a layout installed on it, the layout will manage the position and size of this view and the 'bounds' argument will have no effect.

Arguments:

parent

The instance of View or Window that the new View will become a child of.

bounds

A Rect or a Point describing size and position of the new View. If a Point is given, its coordinates will denote the view's size, while the view's position will be (0,0). Position is measured relative to the parent's top-left corner.

Instance Methods

.setBackgroundImage

Set the background image for the view. Default option is to x-y tile, unlike base class implementation of this function.

Arguments:

image

An image for the background. Can be nil for no background image. Defaults to a crosshatch pattern.

Examples