Fantom

 

class

fwt::Window

sys::Obj
  fwt::Widget
    fwt::Pane
      fwt::ContentPane
        fwt::Window

@Js
@Serializable { simple=false collection=false }

Window is the base class for widgets which represent top level windows.

Slots

activateSource

native Void activate()

Set this Window to be the active window for the application.

alwaysOnTopSource

const Bool alwaysOnTop := false

Force window to always be on top of the desktop. Default is false. This field cannot be changed once the window is constructed.

closeSource

virtual native Void close(Obj? result := null)

Close the window.

iconSource

native Image? icon

Icon if window is a frame.

makeSource

new make(Window? parent := null, |This|? f := null)

Construct the window with an option parent window.

Menu? menuBar

Child menu bar widget if top level frame.

modeSource

const WindowMode mode := ...

Window mode defines the modal state of the window:

  • modeless: no blocking of other windows
  • windowModal: input is blocked to parent window
  • appModal: input is blocked to all other windows of application
  • sysModal: input is blocked to all windows of all applications The default is appModel for Dialogs and modeless for all other window types. This field cannot be changed once the window is constructed.
onActiveSource

@Transient
readonly EventListeners onActive := EventListeners()

Callback function when window becomes the active window on the desktop with focus.

Event id fired:

Event fields:

  • none
onCloseSource

@Transient
readonly EventListeners onClose := EventListeners()

Callback function when window is closed. Consume the event to prevent the window from closing.

Event id fired:

Event fields:

  • none
onDeiconifiedSource

@Transient
readonly EventListeners onDeiconified := EventListeners()

Callback function when window is deiconified from the taskbar.

Event id fired:

Event fields:

  • none
onIconifiedSource

@Transient
readonly EventListeners onIconified := EventListeners()

Callback function when window is iconified to the taskbar.

Event id fired:

Event fields:

  • none
onInactiveSource

@Transient
readonly EventListeners onInactive := EventListeners()

Callback function when window becomes an inactive window on the desktop and loses focus.

Event id fired:

Event fields:

  • none
openSource

virtual native Obj? open()

Open the window. If this is a dialog, then return result passed to the close method (typically the Command). Return null if canceled or closed without a result.

If the windows has not had its size explicitly set, then it is packed to use its preferred size. If the position is not explicitly set, then the windows is centered over its parent window (or primary monitor if no parent).

resizableSource

const Bool resizable := true

Can this window be resizable. Default is true. This field cannot be changed once the window is constructed.

showTrimSource

const Bool showTrim := true

Show all normal window decorations, such as the titlebar, and frame border. If false, only the window content will be visible. Defaults to true. This field cannot be changed once the window is constructed.

titleSource

native Str title

Title string if window is a frame. Defaults to "".