ApplicationWindow

#GtkApplicationWindow is a #GtkWindow subclass that offers some extra functionality for better integration with #GtkApplication features. Notably, it can handle both the application menu as well as the menubar. See gtk_application_set_app_menu() and gtk_application_set_menubar().

This class implements the #GActionGroup and #GActionMap interfaces, to let you add window-specific actions that will be exported by the associated #GtkApplication, together with its application-wide actions. Window-specific actions are prefixed with the “win.” prefix and application-wide actions are prefixed with the “app.” prefix. Actions must be addressed with the prefixed name when referring to them from a #GMenuModel.

Note that widgets that are placed inside a #GtkApplicationWindow can also activate these actions, if they implement the #GtkActionable interface.

As with #GtkApplication, the GDK lock will be acquired when processing actions arriving from other processes and should therefore be held when activating actions locally (if GDK threads are enabled).

The settings #GtkSettings:gtk-shell-shows-app-menu and #GtkSettings:gtk-shell-shows-menubar tell GTK+ whether the desktop environment is showing the application menu and menubar models outside the application as part of the desktop shell. For instance, on OS X, both menus will be displayed remotely; on Windows neither will be. gnome-shell (starting with version 3.4) will display the application menu, but not the menubar.

If the desktop environment does not display the menubar, then #GtkApplicationWindow will automatically show a #GtkMenuBar for it. This behaviour can be overridden with the #GtkApplicationWindow:show-menubar property. If the desktop environment does not display the application menu, then it will automatically be included in the menubar or in the windows client-side decorations.

A GtkApplicationWindow with a menubar

|[<!-- language="C" --> app = gtk_application_new ();

builder = gtk_builder_new_from_string ( "<interface>" " <menu id='menubar'>" " <submenu label='_Edit'>" " <item label='_Copy' action='win.copy'/>" " <item label='_Paste' action='win.paste'/>" " </submenu>" " </menu>" "</interface>", -1);

menubar = G_MENU_MODEL (gtk_builder_get_object (builder, "menubar")); gtk_application_set_menubar (G_APPLICATION (app), menubar); g_object_unref (builder);

...

window = gtk_application_window_new (app); ]|

Handling fallback yourself

A simple example

The XML format understood by #GtkBuilder for #GMenuModel consists of a toplevel <menu> element, which contains one or more <item> elements. Each <item> element contains <attribute> and <link> elements with a mandatory name attribute. <link> elements have the same content model as <menu>. Instead of <link name="submenu> or <link name="section">, you can use <submenu> or <section> elements.

Attribute values can be translated using gettext, like other #GtkBuilder content. <attribute> elements can be marked for translation with a translatable="yes" attribute. It is also possible to specify message context and translator comments, using the context and comments attributes. To make use of this, the #GtkBuilder must have been given the gettext domain to use.

The following attributes are used when constructing menu items: - "label": a user-visible string to display - "action": the prefixed name of the action to trigger - "target": the parameter to use when activating the action - "icon" and "verb-icon": names of icons that may be displayed - "submenu-action": name of an action that may be used to determine if a submenu can be opened - "hidden-when": a string used to determine when the item will be hidden. Possible values include "action-disabled", "action-missing", "macos-menubar".

The following attributes are used when constructing sections: - "label": a user-visible string to use as section heading - "display-hint": a string used to determine special formatting for the section. Possible values include "horizontal-buttons". - "text-direction": a string used to determine the #GtkTextDirection to use when "display-hint" is set to "horizontal-buttons". Possible values include "rtl", "ltr", and "none".

The following attributes are used when constructing submenus: - "label": a user-visible string to display - "icon": icon name to display

Constructors

this
this(GtkApplicationWindow* gtkApplicationWindow, bool ownedRef)

Sets our main struct and passes it to the parent class.

this
this(Application application)

Creates a new #GtkApplicationWindow.

Members

Functions

getApplicationWindowStruct
GtkApplicationWindow* getApplicationWindowStruct()

Get the main Gtk struct

getHelpOverlay
ShortcutsWindow getHelpOverlay()

Gets the #GtkShortcutsWindow that has been set up with a prior call to gtk_application_window_set_help_overlay().

getId
uint getId()

Returns the unique ID of the window. If the window has not yet been added to a #GtkApplication, returns 0.

getShowMenubar
bool getShowMenubar()

Returns whether the window will display a menubar for the app menu and menubar as needed.

getStruct
void* getStruct()

the main Gtk struct as a void*

setHelpOverlay
void setHelpOverlay(ShortcutsWindow helpOverlay)

Associates a shortcuts window with the application window, and sets up an action with the name win.show-help-overlay to present it.

setShowMenubar
void setShowMenubar(bool showMenubar)

Sets whether the window will display a menubar for the app menu and menubar as needed.

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.

Mixins

__anonymous
mixin ActionGroupT!(GtkApplicationWindow)
Undocumented in source.
__anonymous
mixin ActionMapT!(GtkApplicationWindow)
Undocumented in source.

Static functions

getType
GType getType()

Variables

gtkApplicationWindow
GtkApplicationWindow* gtkApplicationWindow;

the main Gtk struct

Inherited Members

From Window

gtkWindow
GtkWindow* gtkWindow;

the main Gtk struct

getWindowStruct
GtkWindow* getWindowStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

setStruct
void setStruct(GObject* obj)
Undocumented in source. Be warned that the author may not have intended to support it.
move
void move(double x, double y)

Move the window to an absolute position. just calls move(int, int). convinience because GdkEvent structs return the position coords as doubles

getType
GType getType()
getDefaultIconList
ListG getDefaultIconList()

Gets the value set by gtk_window_set_default_icon_list(). The list is a copy and should be freed with g_list_free(), but the pixbufs in the list have not had their reference count incremented.

getDefaultIconName
string getDefaultIconName()

Returns the fallback icon name for windows that has been set with gtk_window_set_default_icon_name(). The returned string is owned by GTK+ and should not be modified. It is only valid until the next call to gtk_window_set_default_icon_name().

listToplevels
ListG listToplevels()

Returns a list of all existing toplevel windows. The widgets in the list are not individually referenced. If you want to iterate through the list and perform actions involving callbacks that might destroy the widgets, you must call g_list_foreach (result, (GFunc)g_object_ref, NULL) first, and then unref all the widgets afterwards.

setAutoStartupNotification
void setAutoStartupNotification(bool setting)

By default, after showing the first #GtkWindow, GTK+ calls gdk_notify_startup_complete(). Call this function to disable the automatic startup notification. You might do this if your first window is a splash screen, and you want to delay notification until after your real main window has been shown, for example.

setDefaultIcon
void setDefaultIcon(Pixbuf icon)

Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon() called on them from a pixbuf.

setDefaultIconFromFile
bool setDefaultIconFromFile(string filename)

Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them from a file on disk. Warns on failure if @err is %NULL.

setDefaultIconList
void setDefaultIconList(ListG list)

Sets an icon list to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them to set up a window-specific icon list. This function allows you to set up the icon for all windows in your app at once.

setDefaultIconName
void setDefaultIconName(string name)

Sets an icon to be used as fallback for windows that haven't had gtk_window_set_icon_list() called on them from a named themed icon, see gtk_window_set_icon_name().

setInteractiveDebugging
void setInteractiveDebugging(bool enable)

Opens or closes the [interactive debugger][interactive-debugging], which offers access to the widget hierarchy of the application and to useful debugging tools.

activateDefault
bool activateDefault()

Activates the default widget for the window, unless the current focused widget has been configured to receive the default action (see gtk_widget_set_receives_default()), in which case the focused widget is activated.

activateFocus
bool activateFocus()

Activates the current focused widget within the window.

activateKey
bool activateKey(GdkEventKey* event)

Activates mnemonics and accelerators for this #GtkWindow. This is normally called by the default ::key_press_event handler for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window.

addAccelGroup
void addAccelGroup(AccelGroup accelGroup)

Associate @accel_group with @window, such that calling gtk_accel_groups_activate() on @window will activate accelerators in @accel_group.

addMnemonic
void addMnemonic(uint keyval, Widget target)

Adds a mnemonic to this window.

beginMoveDrag
void beginMoveDrag(int button, int rootX, int rootY, uint timestamp)

Starts moving a window. This function is used if an application has window movement grips. When GDK can support it, the window movement will be done using the standard mechanism for the [window manager][gtk-X11-arch] or windowing system. Otherwise, GDK will try to emulate window movement, potentially not all that well, depending on the windowing system.

beginResizeDrag
void beginResizeDrag(GdkWindowEdge edge, int button, int rootX, int rootY, uint timestamp)

Starts resizing a window. This function is used if an application has window resizing controls. When GDK can support it, the resize will be done using the standard mechanism for the [window manager][gtk-X11-arch] or windowing system. Otherwise, GDK will try to emulate window resizing, potentially not all that well, depending on the windowing system.

close
void close()

Requests that the window is closed, similar to what happens when a window manager close button is clicked.

deiconify
void deiconify()

Asks to deiconify (i.e. unminimize) the specified @window. Note that you shouldn’t assume the window is definitely deiconified afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch])) could iconify it again before your code which assumes deiconification gets to run.

fullscreen
void fullscreen()

Asks to place @window in the fullscreen state. Note that you shouldn’t assume the window is definitely full screen afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could unfullscreen it again, and not all window managers honor requests to fullscreen windows. But normally the window will end up fullscreen. Just don’t write code that crashes if not.

fullscreenOnMonitor
void fullscreenOnMonitor(Screen screen, int monitor)

Asks to place @window in the fullscreen state. Note that you shouldn't assume the window is definitely full screen afterward.

getAcceptFocus
bool getAcceptFocus()

Gets the value set by gtk_window_set_accept_focus().

getApplication
Application getApplication()

Gets the #GtkApplication associated with the window (if any).

getAttachedTo
Widget getAttachedTo()

Fetches the attach widget for this window. See gtk_window_set_attached_to().

getDecorated
bool getDecorated()

Returns whether the window has been set to have decorations such as a title bar via gtk_window_set_decorated().

getDefaultSize
void getDefaultSize(int width, int height)

Gets the default size of the window. A value of -1 for the width or height indicates that a default size has not been explicitly set for that dimension, so the “natural” size of the window will be used.

getDefaultWidget
Widget getDefaultWidget()

Returns the default widget for @window. See gtk_window_set_default() for more details.

getDeletable
bool getDeletable()

Returns whether the window has been set to have a close button via gtk_window_set_deletable().

getDestroyWithParent
bool getDestroyWithParent()

Returns whether the window will be destroyed with its transient parent. See gtk_window_set_destroy_with_parent ().

getFocus
Widget getFocus()

Retrieves the current focused widget within the window. Note that this is the widget that would have the focus if the toplevel window focused; if the toplevel window is not focused then gtk_widget_has_focus (widget) will not be %TRUE for the widget.

getFocusOnMap
bool getFocusOnMap()

Gets the value set by gtk_window_set_focus_on_map().

getFocusVisible
bool getFocusVisible()

Gets the value of the #GtkWindow:focus-visible property.

getGravity
GdkGravity getGravity()

Gets the value set by gtk_window_set_gravity().

getGroup
WindowGroup getGroup()

Returns the group for @window or the default group, if @window is %NULL or if @window does not have an explicit window group.

getHasResizeGrip
bool getHasResizeGrip()

Determines whether the window may have a resize grip.

getHideTitlebarWhenMaximized
bool getHideTitlebarWhenMaximized()

Returns whether the window has requested to have its titlebar hidden when maximized. See gtk_window_set_hide_titlebar_when_maximized ().

getIcon
Pixbuf getIcon()

Gets the value set by gtk_window_set_icon() (or if you've called gtk_window_set_icon_list(), gets the first icon in the icon list).

getIconList
ListG getIconList()

Retrieves the list of icons set by gtk_window_set_icon_list(). The list is copied, but the reference count on each member won’t be incremented.

getIconName
string getIconName()

Returns the name of the themed icon for the window, see gtk_window_set_icon_name().

getMnemonicModifier
GdkModifierType getMnemonicModifier()

Returns the mnemonic modifier for this window. See gtk_window_set_mnemonic_modifier().

getMnemonicsVisible
bool getMnemonicsVisible()

Gets the value of the #GtkWindow:mnemonics-visible property.

getModal
bool getModal()

Returns whether the window is modal. See gtk_window_set_modal().

getOpacity
double getOpacity()

Fetches the requested opacity for this window. See gtk_window_set_opacity().

getPosition
void getPosition(int rootX, int rootY)

This function returns the position you need to pass to gtk_window_move() to keep @window in its current position. This means that the meaning of the returned value varies with window gravity. See gtk_window_move() for more details.

getResizable
bool getResizable()

Gets the value set by gtk_window_set_resizable().

getResizeGripArea
bool getResizeGripArea(GdkRectangle rect)

If a window has a resize grip, this will retrieve the grip position, width and height into the specified #GdkRectangle.

getRole
string getRole()

Returns the role of the window. See gtk_window_set_role() for further explanation.

getScreen
Screen getScreen()

Returns the #GdkScreen associated with @window.

getSize
void getSize(int width, int height)

Obtains the current size of @window.

getSkipPagerHint
bool getSkipPagerHint()

Gets the value set by gtk_window_set_skip_pager_hint().

getSkipTaskbarHint
bool getSkipTaskbarHint()

Gets the value set by gtk_window_set_skip_taskbar_hint()

getTitle
string getTitle()

Retrieves the title of the window. See gtk_window_set_title().

getTitlebar
Widget getTitlebar()

Returns the custom titlebar that has been set with gtk_window_set_titlebar().

getTransientFor
Window getTransientFor()

Fetches the transient parent for this window. See gtk_window_set_transient_for().

getTypeHint
GdkWindowTypeHint getTypeHint()

Gets the type hint for this window. See gtk_window_set_type_hint().

getUrgencyHint
bool getUrgencyHint()

Gets the value set by gtk_window_set_urgency_hint()

getWindowType
GtkWindowType getWindowType()

Gets the type of the window. See #GtkWindowType.

hasGroup
bool hasGroup()

Returns whether @window has an explicit window group.

hasToplevelFocus
bool hasToplevelFocus()

Returns whether the input focus is within this GtkWindow. For real toplevel windows, this is identical to gtk_window_is_active(), but for embedded windows, like #GtkPlug, the results will differ.

iconify
void iconify()

Asks to iconify (i.e. minimize) the specified @window. Note that you shouldn’t assume the window is definitely iconified afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could deiconify it again, or there may not be a window manager in which case iconification isn’t possible, etc. But normally the window will end up iconified. Just don’t write code that crashes if not.

isActive
bool isActive()

Returns whether the window is part of the current active toplevel. (That is, the toplevel window receiving keystrokes.) The return value is %TRUE if the window is active toplevel itself, but also if it is, say, a #GtkPlug embedded in the active toplevel. You might use this function if you wanted to draw a widget differently in an active window from a widget in an inactive window. See gtk_window_has_toplevel_focus()

isMaximized
bool isMaximized()

Retrieves the current maximized state of @window.

maximize
void maximize()

Asks to maximize @window, so that it becomes full-screen. Note that you shouldn’t assume the window is definitely maximized afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could unmaximize it again, and not all window managers support maximization. But normally the window will end up maximized. Just don’t write code that crashes if not.

mnemonicActivate
bool mnemonicActivate(uint keyval, GdkModifierType modifier)

Activates the targets associated with the mnemonic.

move
void move(int x, int y)

Asks the [window manager][gtk-X11-arch] to move @window to the given position. Window managers are free to ignore this; most window managers ignore requests for initial window positions (instead using a user-defined placement algorithm) and honor requests after the window has already been shown.

parseGeometry
bool parseGeometry(string geometry)

Parses a standard X Window System geometry string - see the manual page for X (type “man X”) for details on this. gtk_window_parse_geometry() does work on all GTK+ ports including Win32 but is primarily intended for an X environment.

present
void present()

Presents a window to the user. This may mean raising the window in the stacking order, deiconifying it, moving it to the current desktop, and/or giving it the keyboard focus, possibly dependent on the user’s platform, window manager, and preferences.

presentWithTime
void presentWithTime(uint timestamp)

Presents a window to the user in response to a user interaction. If you need to present a window without a timestamp, use gtk_window_present(). See gtk_window_present() for details.

propagateKeyEvent
bool propagateKeyEvent(GdkEventKey* event)

Propagate a key press or release event to the focus widget and up the focus container chain until a widget handles @event. This is normally called by the default ::key_press_event and ::key_release_event handlers for toplevel windows, however in some cases it may be useful to call this directly when overriding the standard key handling for a toplevel window.

removeAccelGroup
void removeAccelGroup(AccelGroup accelGroup)

Reverses the effects of gtk_window_add_accel_group().

removeMnemonic
void removeMnemonic(uint keyval, Widget target)

Removes a mnemonic from this window.

reshowWithInitialSize
void reshowWithInitialSize()

Hides @window, then reshows it, resetting the default size and position of the window. Used by GUI builders only.

resize
void resize(int width, int height)

Resizes the window as if the user had done so, obeying geometry constraints. The default geometry constraint is that windows may not be smaller than their size request; to override this constraint, call gtk_widget_set_size_request() to set the window's request to a smaller value.

resizeGripIsVisible
bool resizeGripIsVisible()

Determines whether a resize grip is visible for the specified window.

resizeToGeometry
void resizeToGeometry(int width, int height)

Like gtk_window_resize(), but @width and @height are interpreted in terms of the base size and increment set with gtk_window_set_geometry_hints.

setAcceptFocus
void setAcceptFocus(bool setting)

Windows may set a hint asking the desktop environment not to receive the input focus. This function sets this hint.

setApplication
void setApplication(Application application)

Sets or unsets the #GtkApplication associated with the window.

setAttachedTo
void setAttachedTo(Widget attachWidget)

Marks @window as attached to @attach_widget. This creates a logical binding between the window and the widget it belongs to, which is used by GTK+ to propagate information such as styling or accessibility to @window as if it was a children of @attach_widget.

setDecorated
void setDecorated(bool setting)

By default, windows are decorated with a title bar, resize controls, etc. Some [window managers][gtk-X11-arch] allow GTK+ to disable these decorations, creating a borderless window. If you set the decorated property to %FALSE using this function, GTK+ will do its best to convince the window manager not to decorate the window. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling gtk_widget_show().

setDefault
void setDefault(Widget defaultWidget)

The default widget is the widget that’s activated when the user presses Enter in a dialog (for example). This function sets or unsets the default widget for a #GtkWindow. When setting (rather than unsetting) the default widget it’s generally easier to call gtk_widget_grab_default() on the widget. Before making a widget the default widget, you must call gtk_widget_set_can_default() on the widget you’d like to make the default.

setDefaultGeometry
void setDefaultGeometry(int width, int height)

Like gtk_window_set_default_size(), but @width and @height are interpreted in terms of the base size and increment set with gtk_window_set_geometry_hints.

setDefaultSize
void setDefaultSize(int width, int height)

Sets the default size of a window. If the window’s “natural” size (its size request) is larger than the default, the default will be ignored. More generally, if the default size does not obey the geometry hints for the window (gtk_window_set_geometry_hints() can be used to set these explicitly), the default size will be clamped to the nearest permitted size.

setDeletable
void setDeletable(bool setting)

By default, windows have a close button in the window frame. Some [window managers][gtk-X11-arch] allow GTK+ to disable this button. If you set the deletable property to %FALSE using this function, GTK+ will do its best to convince the window manager not to show a close button. Depending on the system, this function may not have any effect when called on a window that is already visible, so you should call it before calling gtk_widget_show().

setDestroyWithParent
void setDestroyWithParent(bool setting)

If @setting is %TRUE, then destroying the transient parent of @window will also destroy @window itself. This is useful for dialogs that shouldn’t persist beyond the lifetime of the main window they're associated with, for example.

setFocus
void setFocus(Widget focus)

If @focus is not the current focus widget, and is focusable, sets it as the focus widget for the window. If @focus is %NULL, unsets the focus widget for this window. To set the focus to a particular widget in the toplevel, it is usually more convenient to use gtk_widget_grab_focus() instead of this function.

setFocusOnMap
void setFocusOnMap(bool setting)

Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped. This function sets this hint.

setFocusVisible
void setFocusVisible(bool setting)

Sets the #GtkWindow:focus-visible property.

setGeometryHints
void setGeometryHints(Widget geometryWidget, GdkGeometry* geometry, GdkWindowHints geomMask)

This function sets up hints about how a window can be resized by the user. You can set a minimum and maximum size; allowed resize increments (e.g. for xterm, you can only resize by the size of a character); aspect ratios; and more. See the #GdkGeometry struct.

setGravity
void setGravity(GdkGravity gravity)

Window gravity defines the meaning of coordinates passed to gtk_window_move(). See gtk_window_move() and #GdkGravity for more details.

setHasResizeGrip
void setHasResizeGrip(bool value)

Sets whether @window has a corner resize grip.

setHasUserRefCount
void setHasUserRefCount(bool setting)

Tells GTK+ whether to drop its extra reference to the window when gtk_widget_destroy() is called.

setHideTitlebarWhenMaximized
void setHideTitlebarWhenMaximized(bool setting)

If @setting is %TRUE, then @window will request that it’s titlebar should be hidden when maximized. This is useful for windows that don’t convey any information other than the application name in the titlebar, to put the available screen space to better use. If the underlying window system does not support the request, the setting will not have any effect.

setIcon
void setIcon(Pixbuf icon)

Sets up the icon representing a #GtkWindow. This icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary.

setIconFromFile
bool setIconFromFile(string filename)

Sets the icon for @window. Warns on failure if @err is %NULL.

setIconList
void setIconList(ListG list)

Sets up the icon representing a #GtkWindow. The icon is used when the window is minimized (also known as iconified). Some window managers or desktop environments may also place it in the window frame, or display it in other contexts. On others, the icon is not used at all, so your mileage may vary.

setIconName
void setIconName(string name)

Sets the icon for the window from a named themed icon. See the docs for #GtkIconTheme for more details. On some platforms, the window icon is not used at all.

setKeepAbove
void setKeepAbove(bool setting)

Asks to keep @window above, so that it stays on top. Note that you shouldn’t assume the window is definitely above afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could not keep it above, and not all window managers support keeping windows above. But normally the window will end kept above. Just don’t write code that crashes if not.

setKeepBelow
void setKeepBelow(bool setting)

Asks to keep @window below, so that it stays in bottom. Note that you shouldn’t assume the window is definitely below afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could not keep it below, and not all window managers support putting windows below. But normally the window will be kept below. Just don’t write code that crashes if not.

setMnemonicModifier
void setMnemonicModifier(GdkModifierType modifier)

Sets the mnemonic modifier for this window.

setMnemonicsVisible
void setMnemonicsVisible(bool setting)

Sets the #GtkWindow:mnemonics-visible property.

setModal
void setModal(bool modal)

Sets a window modal or non-modal. Modal windows prevent interaction with other windows in the same application. To keep modal dialogs on top of main application windows, use gtk_window_set_transient_for() to make the dialog transient for the parent; most [window managers][gtk-X11-arch] will then disallow lowering the dialog below the parent.

setOpacity
void setOpacity(double opacity)

Request the windowing system to make @window partially transparent, with opacity 0 being fully transparent and 1 fully opaque. (Values of the opacity parameter are clamped to the [0,1] range.) On X11 this has any effect only on X screens with a compositing manager running. See gtk_widget_is_composited(). On Windows it should work always.

setPosition
void setPosition(GtkWindowPosition position)

Sets a position constraint for this window. If the old or new constraint is %GTK_WIN_POS_CENTER_ALWAYS, this will also cause the window to be repositioned to satisfy the new constraint.

setResizable
void setResizable(bool resizable)

Sets whether the user can resize a window. Windows are user resizable by default.

setRole
void setRole(string role)

This function is only useful on X11, not with other GTK+ targets.

setScreen
void setScreen(Screen screen)

Sets the #GdkScreen where the @window is displayed; if the window is already mapped, it will be unmapped, and then remapped on the new screen.

setSkipPagerHint
void setSkipPagerHint(bool setting)

Windows may set a hint asking the desktop environment not to display the window in the pager. This function sets this hint. (A "pager" is any desktop navigation tool such as a workspace switcher that displays a thumbnail representation of the windows on the screen.)

setSkipTaskbarHint
void setSkipTaskbarHint(bool setting)

Windows may set a hint asking the desktop environment not to display the window in the task bar. This function sets this hint.

setStartupId
void setStartupId(string startupId)

Startup notification identifiers are used by desktop environment to track application startup, to provide user feedback and other features. This function changes the corresponding property on the underlying GdkWindow. Normally, startup identifier is managed automatically and you should only use this function in special cases like transferring focus from other processes. You should use this function before calling gtk_window_present() or any equivalent function generating a window map event.

setTitle
void setTitle(string title)

Sets the title of the #GtkWindow. The title of a window will be displayed in its title bar; on the X Window System, the title bar is rendered by the [window manager][gtk-X11-arch], so exactly how the title appears to users may vary according to a user’s exact configuration. The title should help a user distinguish this window from other windows they may have open. A good title might include the application name and current document filename, for example.

setTitlebar
void setTitlebar(Widget titlebar)

Sets a custom titlebar for @window.

setTransientFor
void setTransientFor(Window parent)

Dialog windows should be set transient for the main application window they were spawned from. This allows [window managers][gtk-X11-arch] to e.g. keep the dialog on top of the main window, or center the dialog over the main window. gtk_dialog_new_with_buttons() and other convenience functions in GTK+ will sometimes call gtk_window_set_transient_for() on your behalf.

setTypeHint
void setTypeHint(GdkWindowTypeHint hint)

By setting the type hint for the window, you allow the window manager to decorate and handle the window in a way which is suitable to the function of the window in your application.

setUrgencyHint
void setUrgencyHint(bool setting)

Windows may set a hint asking the desktop environment to draw the users attention to the window. This function sets this hint.

setWmclass
void setWmclass(string wmclassName, string wmclassClass)

Don’t use this function. It sets the X Window System “class” and “name” hints for a window. According to the ICCCM, you should always set these to the same value for all windows in an application, and GTK+ sets them to that value by default, so calling this function is sort of pointless. However, you may want to call gtk_window_set_role() on each window in your application, for the benefit of the session manager. Setting the role allows the window manager to restore window positions when loading a saved session.

stick
void stick()

Asks to stick @window, which means that it will appear on all user desktops. Note that you shouldn’t assume the window is definitely stuck afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch] could unstick it again, and some window managers do not support sticking windows. But normally the window will end up stuck. Just don't write code that crashes if not.

unfullscreen
void unfullscreen()

Asks to toggle off the fullscreen state for @window. Note that you shouldn’t assume the window is definitely not full screen afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could fullscreen it again, and not all window managers honor requests to unfullscreen windows. But normally the window will end up restored to its normal state. Just don’t write code that crashes if not.

unmaximize
void unmaximize()

Asks to unmaximize @window. Note that you shouldn’t assume the window is definitely unmaximized afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could maximize it again, and not all window managers honor requests to unmaximize. But normally the window will end up unmaximized. Just don’t write code that crashes if not.

unstick
void unstick()

Asks to unstick @window, which means that it will appear on only one of the user’s desktops. Note that you shouldn’t assume the window is definitely unstuck afterward, because other entities (e.g. the user or [window manager][gtk-X11-arch]) could stick it again. But normally the window will end up stuck. Just don’t write code that crashes if not.

OnActivateDefaultDelegateWrapper
class OnActivateDefaultDelegateWrapper
Undocumented in source.
onActivateDefaultListeners
OnActivateDefaultDelegateWrapper[] onActivateDefaultListeners;
Undocumented in source.
addOnActivateDefault
gulong addOnActivateDefault(void delegate(Window) dlg, ConnectFlags connectFlags)

The ::activate-default signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user activates the default widget of @window.

callBackActivateDefault
void callBackActivateDefault(GtkWindow* windowStruct, OnActivateDefaultDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackActivateDefaultDestroy
void callBackActivateDefaultDestroy(OnActivateDefaultDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnActivateDefault
void internalRemoveOnActivateDefault(OnActivateDefaultDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnActivateFocusDelegateWrapper
class OnActivateFocusDelegateWrapper
Undocumented in source.
onActivateFocusListeners
OnActivateFocusDelegateWrapper[] onActivateFocusListeners;
Undocumented in source.
addOnActivateFocus
gulong addOnActivateFocus(void delegate(Window) dlg, ConnectFlags connectFlags)

The ::activate-focus signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user activates the currently focused widget of @window.

callBackActivateFocus
void callBackActivateFocus(GtkWindow* windowStruct, OnActivateFocusDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackActivateFocusDestroy
void callBackActivateFocusDestroy(OnActivateFocusDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnActivateFocus
void internalRemoveOnActivateFocus(OnActivateFocusDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnEnableDebuggingDelegateWrapper
class OnEnableDebuggingDelegateWrapper
Undocumented in source.
onEnableDebuggingListeners
OnEnableDebuggingDelegateWrapper[] onEnableDebuggingListeners;
Undocumented in source.
addOnEnableDebugging
gulong addOnEnableDebugging(bool delegate(bool, Window) dlg, ConnectFlags connectFlags)

The ::enable-debugging signal is a [keybinding signal]GtkBindingSignal which gets emitted when the user enables or disables interactive debugging. When @toggle is %TRUE, interactive debugging is toggled on or off, when it is %FALSE, the debugger will be pointed at the widget under the pointer.

callBackEnableDebugging
int callBackEnableDebugging(GtkWindow* windowStruct, bool toggle, OnEnableDebuggingDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackEnableDebuggingDestroy
void callBackEnableDebuggingDestroy(OnEnableDebuggingDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnEnableDebugging
void internalRemoveOnEnableDebugging(OnEnableDebuggingDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnKeysChangedDelegateWrapper
class OnKeysChangedDelegateWrapper
Undocumented in source.
onKeysChangedListeners
OnKeysChangedDelegateWrapper[] onKeysChangedListeners;
Undocumented in source.
addOnKeysChanged
gulong addOnKeysChanged(void delegate(Window) dlg, ConnectFlags connectFlags)

The ::keys-changed signal gets emitted when the set of accelerators or mnemonics that are associated with @window changes.

callBackKeysChanged
void callBackKeysChanged(GtkWindow* windowStruct, OnKeysChangedDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackKeysChangedDestroy
void callBackKeysChangedDestroy(OnKeysChangedDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnKeysChanged
void internalRemoveOnKeysChanged(OnKeysChangedDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
OnSetFocusDelegateWrapper
class OnSetFocusDelegateWrapper
Undocumented in source.
onSetFocusListeners
OnSetFocusDelegateWrapper[] onSetFocusListeners;
Undocumented in source.
addOnSetFocus
gulong addOnSetFocus(void delegate(Widget, Window) dlg, ConnectFlags connectFlags)
callBackSetFocus
void callBackSetFocus(GtkWindow* windowStruct, GtkWidget* object, OnSetFocusDelegateWrapper wrapper)
Undocumented in source. Be warned that the author may not have intended to support it.
callBackSetFocusDestroy
void callBackSetFocusDestroy(OnSetFocusDelegateWrapper wrapper, GClosure* closure)
Undocumented in source. Be warned that the author may not have intended to support it.
internalRemoveOnSetFocus
void internalRemoveOnSetFocus(OnSetFocusDelegateWrapper source)
Undocumented in source. Be warned that the author may not have intended to support it.
showUriOnWindow
bool showUriOnWindow(Window parent, string uri, uint timestamp)

A convenience function for launching the default application to show the uri. Like gtk_show_uri(), but takes a window as transient parent instead of a screen.

From ActionGroupIF

getActionGroupStruct
GActionGroup* getActionGroupStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

actionAdded
void actionAdded(string actionName)

Emits the #GActionGroup::action-added signal on @action_group.

actionEnabledChanged
void actionEnabledChanged(string actionName, bool enabled)

Emits the #GActionGroup::action-enabled-changed signal on @action_group.

actionRemoved
void actionRemoved(string actionName)

Emits the #GActionGroup::action-removed signal on @action_group.

actionStateChanged
void actionStateChanged(string actionName, Variant state)

Emits the #GActionGroup::action-state-changed signal on @action_group.

activateAction
void activateAction(string actionName, Variant parameter)

Activate the named action within @action_group.

changeActionState
void changeActionState(string actionName, Variant value)

Request for the state of the named action within @action_group to be changed to @value.

getActionEnabled
bool getActionEnabled(string actionName)

Checks if the named action within @action_group is currently enabled.

getActionParameterType
VariantType getActionParameterType(string actionName)

Queries the type of the parameter that must be given when activating the named action within @action_group.

getActionState
Variant getActionState(string actionName)

Queries the current state of the named action within @action_group.

getActionStateHint
Variant getActionStateHint(string actionName)

Requests a hint about the valid range of values for the state of the named action within @action_group.

getActionStateType
VariantType getActionStateType(string actionName)

Queries the type of the state of the named action within @action_group.

hasAction
bool hasAction(string actionName)

Checks if the named action exists within @action_group.

listActions
string[] listActions()

Lists the actions contained within @action_group.

queryAction
bool queryAction(string actionName, bool enabled, VariantType parameterType, VariantType stateType, Variant stateHint, Variant state)

Queries all aspects of the named action within an @action_group.

addOnActionAdded
gulong addOnActionAdded(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags)

Signals that a new action was just added to the group. This signal is emitted after the action has been added and is now visible.

addOnActionEnabledChanged
gulong addOnActionEnabledChanged(void delegate(string, bool, ActionGroupIF) dlg, ConnectFlags connectFlags)

Signals that the enabled status of the named action has changed.

addOnActionRemoved
gulong addOnActionRemoved(void delegate(string, ActionGroupIF) dlg, ConnectFlags connectFlags)

Signals that an action is just about to be removed from the group. This signal is emitted before the action is removed, so the action is still visible and can be queried from the signal handler.

addOnActionStateChanged
gulong addOnActionStateChanged(void delegate(string, Variant, ActionGroupIF) dlg, ConnectFlags connectFlags)

Signals that the state of the named action has changed.

From ActionMapIF

getActionMapStruct
GActionMap* getActionMapStruct()

Get the main Gtk struct

getStruct
void* getStruct()

the main Gtk struct as a void*

addAction
void addAction(ActionIF action)

Adds an action to the @action_map.

addActionEntries
void addActionEntries(GActionEntry[] entries, void* userData)

A convenience function for creating multiple #GSimpleAction instances and adding them to a #GActionMap.

lookupAction
ActionIF lookupAction(string actionName)

Looks up the action with the name @action_name in @action_map.

removeAction
void removeAction(string actionName)

Removes the named action from the action map.

Meta