#
Prev |  | Next

# window

## Name

window -- A standard top level window.

## Synopsis

windows [`-option` `value`...]

## Screenshot

## Options

-allowGrow

  type: boolean

  Whether the window may be greater than its children require.

-allowShrink

  type: boolean

  Whether the window can be made smaller than the place that its children require.

-borderWidth

  type: integer or one of small, normal or big

  Space in pixel between the children and the border of the widget.

-child

  type: widget-ID

  Widget ID of the child.

-data

  type: string

  User defined data which can be retrieved via the cget subcommand.

-decorated

  type: boolean

  Whether the window should be decorated or not.

-defaultHeight

  type: integer

  Default height of the window.

-defaultWidth

  type: integer

  Default width of the window.

-dragTargets

  type: list of strings

  List of source targets (e.g. text/plain or application/x-color) which are supported.

-dropTargets

  type: list of strings

  List of destination targets (e.g. text/plain or application/x-color) which are supported.

-height

  type: integer

  Height of the window.

-heightRequest

  type: integer

  Requested height of the window.

-icon

  type: percent-string (default: "")

  Sets the icon of the window which is shown, depending on the window manager, in the window decoration, the window list, and/or if the window is iconified. This must be either a file name (prefix "%/") or empty.

-name

  type: string

  Name of the widget, can be used to set options in an rc file.

-onDelete

  type: string (default: "")

  Tcl command which is executed if the widget shall be deleted. If the command returns 0, the widget is not deleted. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE

-onDestroy

  type: string (default: "")

  Tcl command which is executed if the widget is destroyed. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE

-onDragData

  type: string (default: "")

  Tcl command which is executed if data is draged from this the widget to another. This command must return the data to be draged. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name %t | time %T | type of data TABLE

-onDropData

  type: string (default: "")

  Tcl command which is executed if data is dropped on the widget. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name %d | data %l | length of data %t | time %T | type of data %x | x coordinate %y | y coordinate TABLE

-onKeyPress

  type: string (default: "")

  Tcl command which is executed if a key is pressed while the widget is having the focus. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name %k | key code as integer %K | key code as symbol %a | unicode unicode character, or the empty string if there is no corresponding character. %s | state of the buttons and modifiers (bitmask) TABLE

-onKeyRelease

  type: string (default: "")

  Tcl command which is executed if a key is released while the widget is having the focus. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name %k | key code as integer %K | key code as symbol %a | unicode unicode character, or the empty string if there is no corresponding character. %s | state of the buttons and modifiers (bitmask) TABLE

-onPopupMenu

  type: string (default: "")

  Tcl command which is executed if the "popup-menu" signal is recieved, which is normally the case if the user presses Shift-F10. Before evaluation the following percent strings are substituated: %w by widget name.

-onRealize

  type: string (default: "")

  Tcl command whih is executed in the global scope if the widget has been realized. Before evaluation the following percent strings are substituated: TABLE %% | % %w | widget name. TABLE

-onShowHelp

  type: string (default: "")

  Tcl command which is executed in the global scope if the "show-help" signal is recieved, which is normally the case if the user presses F1 or Ctrl-F1. Before evaluation the following percent strings are substituated TABLE %% | % %w | widget name %h | help type: either "whatsThis" or "tooltip" TABLE

-resizable

  type: boolean (default: 1)

  Whether the user can change the size of the window.

-sensitive

  type: boolean (default: 1)

  Whether or not the item is sensitve to user input.

-title

  type: string (default: "")

  Title of the window.

-tooltip

  type: string

  Message that appear next to this widget when the mouse pointer is held over it for a short amount of time.

-modal

  type: boolean (default: 0)

  Whether the window is modal, i.e. it grabs all GTK+ events.

-visible

  type: boolean (default: 1)

  Whether or not the item is visible.

-width

  type: integer

  Width of the window.

-widthRequest

  type: integer

  Requested width of the window.

-x

  type: integer

  X position of the window.

-y

  type: integer

  Y position of the window.

## Description

To be visible each widget must be a direct or indirect children of a top level window. The window widget is the standard top level window. Its appearance is dependent of the window manager.

## Commands

`id` cget `option`

  Returns the value for one option. The option may have any of the values accepted by configure.

`id` configure [`-option` `value`...]

  Configures the widget. Option may have any of the values accepted on creation of the widget.

`id` delete

  Deletes the widget and the associated tcl command.

`id` iconify `?state?`

  Iconifies or deiconifies the window dependent on the value of state. The default value for state is true.

## Example

    set label [gnocl::label -text "Simple Window"]
    gnocl::window -title "Window" -child $label -defaultWidth 200

results in

## See also

dialog, `GtkWindow`

Prev | Home | Next
dialog | Up | box