package Agar::Window; use strict; use Agar; 1; __END__ =head1 NAME Agar::Window - Agar GUI window =head1 SYNOPSIS use Agar; use Agar::Window; use Agar::Surface; my $win = Agar::Window->new; my $modalWin = Agar::Window->new({ modal => 1 }); my $namedWin = Agar::Window->newNamed("Hello"); $win->caption("Hello, world"); $win->icon(Agar::Surface->newFromBMP('icon.bmp')); =head1 DESCRIPTION The B object is the basic container of the Agar GUI system. If the active Agar driver (see L) interfaces with an external window system, then the B object also represents the window which will be created in the underlying window system. =head1 INHERITANCE HIERARCHY L -> L -> B =head1 METHODS =over 4 =item B<$win = Agar::Window-Enew([%options])> Create a new, unnamed window. Available options include: =over 4 =item C Always keep this window on top of the other windows. =item C Always keep this window below the other windows. =item C Don't automatically grab focus in response to a click on the window area. =item C Place window in foreground and prevent all other windows from catching any events. Multiple modal windows are arranged in a stack and whichever was shown last (with the B method) is the effective one. Implies the C and C options. =item C Don't fill the window background prior to rendering its contents. =item C Disable automatic updates of the video region corresponding to the window area (may not be relevant depending on the display mode in use). =item C Disable the window titlebar. =item C Don't draw decorative window borders. =item C Implies C and C. =item C Disable the horizontal window resize control. =item C Disable the vertical window resize control. =item C Disable both resize controls. =item C Disable the "close window" button in the titlebar. =item C Disable the "minimize window" button in the titlebar. =item C Disable the "maximize window" button in the titlebar. =item C Arrange for the width of the window to always match the width of the display (and set the window in a horizontally-maximized state, if such a state is defined by the underlying window system). =item C Arrange for the height of the window to always match the height of the display (and set the window in a vertically-maximized state, if such a state is defined by the underlying window system). =back =item B<$win = Agar::Window-EnewNamed($name, [%options])> Same as the B constructor, except that a name is associated with the window. If an already existing window has the given name, the constructor returns undef. =item B<$text = $win-Ecaption([$text])> Return the current caption string. If the $text argument is given, set the caption as well. $text may contain valid UTF-8. =item B<$icon = $win-Eicon([$icon])> Windows have icons associated with them. These icons are displayed by Agar's internal window manager when windows are minimized. This method return the current icon associated with the window. If the $icon argument is given, set the icon as well. Both the $icon parameter and the return value are L objects. =item B<$win-EsetGeometry($x,$y,$w,$h)> Sets the position and size of the window to the specified (x,y) coordinates and width and height. =item B<$win-EsetMinSize($w,$h)> Enforce a minimum width and height on the window. =item B<$win-Eshow()> Enable drawing of this window. =item B<$win-Ehide()> Disable drawing of this window. =item B<$win-Edraw()> Cause the window to draw itself. Only really useful when writing a custom event loop. =item B<$win-Eattach()> Attach a "logical" child window to this window. When the window is detached, the child window will be automatically detached as well. =item B<$win-Edetach()> Remove a "logical" child window from this window. =item B<$widget = $win-EfindFocused()> Returns the child widget that currently has focus, or undef if there is none. =back =head1 AUTHOR Mat Sutcliffe EFE Julien Nadeau Carriere EFE =head1 SEE ALSO L, L, L, L, L, L =cut