LMMS
Loading...
Searching...
No Matches
Frame

Functions

PUGL_API PuglRect puglGetFrame (const PuglView *view)
PUGL_API PuglStatus puglSetFrame (PuglView *view, PuglRect frame)
PUGL_API PuglStatus puglSetPosition (PuglView *view, int x, int y)
PUGL_API PuglStatus puglSetSize (PuglView *view, unsigned width, unsigned height)
PUGL_API PuglStatus puglSetSizeHint (PuglView *view, PuglSizeHint hint, PuglSpan width, PuglSpan height)

Detailed Description

Functions for working with the position and size of a view.

Function Documentation

◆ puglGetFrame()

PUGL_API PuglRect puglGetFrame ( const PuglView * view)

Get the current position and size of the view.

The position is in screen coordinates with an upper left origin.

◆ puglSetFrame()

PUGL_API PuglStatus puglSetFrame ( PuglView * view,
PuglRect frame )

Set the current position and size of the view.

The position is in screen coordinates with an upper left origin.

Returns
PUGL_UNKNOWN_ERROR on failure, in which case the view frame is unchanged.

◆ puglSetPosition()

PUGL_API PuglStatus puglSetPosition ( PuglView * view,
int x,
int y )

Set the current position of the view.

Returns
PUGL_UNKNOWN_ERROR on failure, in which case the view frame is unchanged.

◆ puglSetSize()

PUGL_API PuglStatus puglSetSize ( PuglView * view,
unsigned width,
unsigned height )

Set the current size of the view.

Returns
PUGL_UNKNOWN_ERROR on failure, in which case the view frame is unchanged.

◆ puglSetSizeHint()

PUGL_API PuglStatus puglSetSizeHint ( PuglView * view,
PuglSizeHint hint,
PuglSpan width,
PuglSpan height )

Set a size hint for the view.

This can be used to set the default, minimum, and maximum size of a view, as well as the supported range of aspect ratios.

This should be called before puglRealize() so the initial window for the view can be configured correctly.

Returns
PUGL_UNKNOWN_ERROR on failure, but always succeeds if the view is not yet realized.