-
AUTHENTICATION_TYPE
[string]
required
The authentication engine to use for credential authentication.
enum: Database, LDAP, JWT, Keystone, OIDC
Example: Database
-
BUILDLOGS_REDIS
[object]
required
Connection information for Redis for build logs caching
-
host
[string]
required
The hostname at which Redis is accessible
Example: my.redis.cluster
-
password
[string]
The password to connect to the Redis instance
Example: mypassword
-
port
[number]
The port at which Redis is accessible
Example: 1234
-
DB_URI
[string]
required
The URI at which to access the database, including any credentials.
Example<EMAIL_ADDRESS>-
DEFAULT_TAG_EXPIRATION
[string]
required
The default, configurable tag expiration time for time machine. Defaults to `2w`.
Pattern: ^[0-9]+(w|m|d|h|s)$
-
DISTRIBUTED_STORAGE_CONFIG
[object]
required
Configuration for storage engine(s) to use in Quay. Each key is a unique ID for a storage engine, with the value being a tuple of the type and configuration for that engine.
Example: {"local_storage": ["LocalStorage", {"storage_path": "some/path/"}]}
-
DISTRIBUTED_STORAGE_PREFERENCE
[array]
required
The preferred storage engine(s) (by ID in DISTRIBUTED_STORAGE_CONFIG) to use. A preferred engine means it is first checked for pullig and images are pushed to it.
Min Items: None
Example: [u's3_us_east', u's3_us_west']
-
PREFERRED_URL_SCHEME
[string]
required
The URL scheme to use when hitting Quay. If Quay is behind SSL *at all*, this *must* be `https`
enum: http, https
Example: https
-
SERVER_HOSTNAME
[string]
required
The URL at which Quay is accessible, without the scheme.
Example: quay.io
-
TAG_EXPIRATION_OPTIONS
[array]
required
The options that users can select for expiration of tags in their namespace (if enabled)
Min Items: None
-
array item
[string]
Pattern: ^[0-9]+(w|m|d|h|s)$
-
USER_EVENTS_REDIS
[object]
required
Connection information for Redis for user event handling
-
host
[string]
required
The hostname at which Redis is accessible
Example: my.redis.cluster
-
password
[string]
The password to connect to the Redis instance
Example: mypassword
-
port
[number]
The port at which Redis is accessible
Example: 1234
-
ALLOW_PULLS_WITHOUT_STRICT_LOGGING
[boolean]
If true, pulls in which the pull audit log entry cannot be written will still succeed. Useful if the database can fallback into a read-only state and it is desired for pulls to continue during that time. Defaults to False.
Example: True
-
AVATAR_KIND
[string]
The types of avatars to display, either generated inline (local) or Gravatar (gravatar)
enum: local, gravatar
-
CONTACT_INFO
[array]
If specified, contact information to display on the contact page. If only a single piece of contact information is specified, the contact footer will link directly.
Min Items: 1
Unique Items: True
-
array item 0
[string]
Adds a link to send an e-mail
Pattern: ^mailto:(.)+$
Example<EMAIL_ADDRESS>-
array item 1
[string]
Adds a link to visit an IRC chat room
Pattern: ^irc://(.)+$
Example: irc://irc.libera.chat:6667/quay
-
array item 2
[string]
Adds a link to call a phone number
Pattern: ^tel:(.)+$
Example: tel:+1-888-930-3475
-
array item 3
[string]
Adds a link to a defined URL
Pattern: ^http(s)?://(.)+$
Example: https://twitter.com/quayio
-
DIRECT_OAUTH_CLIENTID_WHITELIST
[array]
A list of client IDs of *Quay-managed* applications that are allowed to perform direct OAuth approval without user approval.
Min Items: None
Unique Items: True
-
DISTRIBUTED_STORAGE_DEFAULT_LOCATIONS
[array]
The list of storage engine(s) (by ID in DISTRIBUTED_STORAGE_CONFIG) whose images should be fully replicated, by default, to all other storage engines.
Min Items: None
Example: [u's3_us_east', u's3_us_west']
-
EXTERNAL_TLS_TERMINATION
[boolean]
If TLS is supported, but terminated at a layer before Quay, must be true.
Example: True
-
FEATURE_ACTION_LOG_ROTATION
[boolean]
Whether or not to rotate old action logs to storage. Defaults to False
Example: False
-
FEATURE_ADVERTISE_V2
[boolean]
Whether the v2/ endpoint is visible. Defaults to True
Example: True
-
FEATURE_ANONYMOUS_ACCESS
[boolean]
Whether to allow anonymous users to browse and pull public repositories. Defaults to True
Example: True
-
FEATURE_APP_REGISTRY
[boolean]
Whether to enable support for App repositories. Defaults to False
Example: False
-
FEATURE_REPO_MIRROR
[boolean]
Whether to enable support for repository mirroring. Defaults to False
Example: False
-
REPO_MIRROR_TLS_VERIFY
[boolean]
Require HTTPS and verify certificates of Quay registry during mirror. Defaults to True
Example: False
-
FEATURE_BITBUCKET_BUILD
[boolean]
Whether to support Bitbucket build triggers. Defaults to False
Example: False
-
FEATURE_BUILD_SUPPORT
[boolean]
Whether to support Dockerfile build. Defaults to True
Example: True
-
FEATURE_CHANGE_TAG_EXPIRATION
[boolean]
Whether users and organizations are allowed to change the tag expiration for tags in their namespace. Defaults to True.
Example: False
-
FEATURE_DIRECT_LOGIN
[boolean]
Whether users can directly login to the UI. Defaults to True
Example: True
-
FEATURE_GITHUB_BUILD
[boolean]
Whether to support GitHub build triggers. Defaults to False
Example: False
-
FEATURE_GITHUB_LOGIN
[boolean]
Whether GitHub login is supported. Defaults to False
Example: False
-
FEATURE_GITLAB_BUILD
[boolean]
Whether to support GitLab build triggers. Defaults to False
Example: False
-
FEATURE_GOOGLE_LOGIN
[boolean]
Whether Google login is supported. Defaults to False
Example: False
-
FEATURE_INVITE_ONLY_USER_CREATION
[boolean]
Whether users being created must be invited by another user. Defaults to False
Example: False
-
FEATURE_LIBRARY_SUPPORT
[boolean]
Whether to allow for "namespace-less" repositories when pulling and pushing from Docker. Defaults to True
Example: True
-
FEATURE_MAILING
[boolean]
Whether emails are enabled. Defaults to True
Example: True
-
FEATURE_PARTIAL_USER_AUTOCOMPLETE
[boolean]
If set to true, autocompletion will apply to partial usernames. Defaults to True
Example: True
-
FEATURE_PERMANENT_SESSIONS
[boolean]
Whether sessions are permanent. Defaults to True
Example: True
-
FEATURE_PROXY_STORAGE
[boolean]
Whether to proxy all direct download URLs in storage via the registry nginx. Defaults to False
Example: False
-
FEATURE_PUBLIC_CATALOG
[boolean]
If set to true, the _catalog endpoint returns public repositories. Otherwise, only private repositories can be returned. Defaults to False
Example: False
-
FEATURE_READER_BUILD_LOGS
[boolean]
If set to true, build logs may be read by those with read access to the repo, rather than only write access or admin access. Defaults to False
Example: False
-
FEATURE_REQUIRE_ENCRYPTED_BASIC_AUTH
[boolean]
Whether non-encrypted passwords (as opposed to encrypted tokens) can be used for basic auth. Defaults to False
Example: False
-
FEATURE_REQUIRE_TEAM_INVITE
[boolean]
Whether to require invitations when adding a user to a team. Defaults to True
Example: True
-
FEATURE_SECURITY_NOTIFICATIONS
[boolean]
If the security scanner is enabled, whether to turn of/off security notificaitons. Defaults to False
Example: False
-
FEATURE_SECURITY_SCANNER
[boolean]
Whether to turn of/off the security scanner. Defaults to False
Example: False
-
FEATURE_STORAGE_REPLICATION
[boolean]
Whether to automatically replicate between storage engines. Defaults to False
Example: False
-
FEATURE_SUPER_USERS
[boolean]
Whether super users are supported. Defaults to True
Example: True
-
FEATURE_TEAM_SYNCING
[boolean]
Whether to allow for team membership to be synced from a backing group in the authentication engine (LDAP or Keystone)
Example: True
-
FEATURE_USER_CREATION
[boolean]
Whether users can be created (by non-super users). Defaults to True
Example: True
-
FEATURE_USER_METADATA
[boolean]
Whether to collect and support user metadata. Defaults to False
Example: False
-
GITHUB_LOGIN_CONFIG
[object]
Configuration for using GitHub (Enterprise) as an external login provider
-
ALLOWED_ORGANIZATIONS
[array]
The names of the GitHub (Enterprise) organizations whitelisted to work with the ORG_RESTRICT option
Min Items: None
Unique Items: True
-
API_ENDPOINT
[string]
The endpoint of the GitHub (Enterprise) API to use. Must be overridden for github.com
Example: https://api.github.com/
-
CLIENT_ID
[string]
required
The registered client ID for this Quay instance; cannot be shared with GITHUB_TRIGGER_CONFIG
Example: 0e8dbe15c4c7630b6780
-
CLIENT_SECRET
[string]
required
The registered client secret for this Quay instance
Example: e4a58ddd3d7408b7aec109e85564a0d153d3e846
-
GITHUB_ENDPOINT
[string]
required
The endpoint of the GitHub (Enterprise) being hit
Example: https://github.com/
-
ORG_RESTRICT
[boolean]
If true, only users within the organization whitelist can login using this provider
Example: True
-
GITHUB_TRIGGER_CONFIG
[object]
Configuration for using GitHub (Enterprise) for build triggers
-
API_ENDPOINT
[string]
The endpoint of the GitHub (Enterprise) API to use. Must be overridden for github.com
Example: https://api.github.com/
-
CLIENT_ID
[string]
required
The registered client ID for this Quay instance; cannot be shared with GITHUB_LOGIN_CONFIG
Example: 0e8dbe15c4c7630b6780
-
CLIENT_SECRET
[string]
required
The registered client secret for this Quay instance
Example: e4a58ddd3d7408b7aec109e85564a0d153d3e846
-
GITHUB_ENDPOINT
[string]
required
The endpoint of the GitHub (Enterprise) being hit
Example: https://github.com/
-
GITLAB_TRIGGER_CONFIG
[object]
Configuration for using Gitlab (Enterprise) for external authentication
-
CLIENT_ID
[string]
required
The registered client ID for this Quay instance
Example: 0e8dbe15c4c7630b6780
-
CLIENT_SECRET
[string]
required
The registered client secret for this Quay instance
Example: e4a58ddd3d7408b7aec109e85564a0d153d3e846
-
GITLAB_ENDPOINT
[string]
required
The endpoint at which Gitlab(Enterprise) is running
Example: https://gitlab.com
-
GOOGLE_LOGIN_CONFIG
[object]
Configuration for using Google for external authentication
-
CLIENT_ID
[string]
required
The registered client ID for this Quay instance
Example: 0e8dbe15c4c7630b6780
-
CLIENT_SECRET
[string]
required
The registered client secret for this Quay instance
Example: e4a58ddd3d7408b7aec109e85564a0d153d3e846
-
MAIL_DEFAULT_SENDER
[string]
If specified, the e-mail address used as the `from` when Quay sends e-mails. If none, defaults to<EMAIL_ADDRESS>Example<EMAIL_ADDRESS>-
MAIL_PASSWORD
[string]
The SMTP password to use when sending e-mails.
Example: mypassword
-
MAIL_PORT
[number]
The SMTP port to use. If not specified, defaults to 587.
Example: 588
-
MAIL_SERVER
[string]
The SMTP server to use for sending e-mails. Only required if FEATURE_MAILING is set to true.
Example: smtp.somedomain.com
-
MAIL_USERNAME
[string]
The SMTP username to use when sending e-mails.
Example: myuser
-
MAIL_USE_TLS
[boolean]
If specified, whether to use TLS for sending e-mails.
Example: True
-
MAXIMUM_LAYER_SIZE
[string]
Maximum allowed size of an image layer. Defaults to 20G
Pattern: ^[0-9]+(G|M)$
Example: 100G
-
PUBLIC_NAMESPACES
[array]
If a namespace is defined in the public namespace list, then it will appear on *all* user's repository list pages, regardless of whether that user is a member of the namespace. Typically, this is used by an enterprise customer in configuring a set of "well-known" namespaces.
Min Items: None
Unique Items: True
-
REGISTRY_TITLE
[string]
If specified, the long-form title for the registry. Defaults to `Red Hat Quay`.
Example: Corp Container Service
-
REGISTRY_TITLE_SHORT
[string]
If specified, the short-form title for the registry. Defaults to `Red Hat Quay`.
Example: CCS
-
SECURITY_SCANNER_ENDPOINT
[string]
The endpoint for the security scanner
Pattern: ^http(s)?://(.)+$
Example: http://<IP_ADDRESS>:6060
-
SECURITY_SCANNER_INDEXING_INTERVAL
[number]
The number of seconds between indexing intervals in the security scanner. Defaults to 30.
Example: 30
-
SUPER_USERS
[array]
Quay usernames of those users to be granted superuser privileges
Min Items: None
Unique Items: True
-
TEAM_RESYNC_STALE_TIME
[string]
If team syncing is enabled for a team, how often to check its membership and resync if necessary (Default: 30m)
Pattern: ^[0-9]+(w|m|d|h|s)$
Example: 2h


Wind fetch is the unobstructed length of water over which wind can blow from a certain direction. The wind fetch is typically calculated for many directions around the compass rose for a given location, which can then be incorporated into a larger model (such as the InVEST coastal vulnerability model; <http://data.naturalcapitalproject.org/invest-releases/documentation/2_2_0/coastal_vulnerability.html>), or simply averaged for a reasonable measure of the overall wind exposure for a specific marine location. The process of calculating wind fetch can be extremely time-consuming and tedious, particularly if a large number of fetch vectors are required at many locations. The 'fetchR' package calculates wind fetch and summarises the information efficiently. There are also plot methods to help visualise the wind exposure at the various locations, and methods to output the fetch vectors to a KML file for further investigation.
| Version: | 2.1-1 |
| Imports: | rgdal, sp, methods, rgeos, plotKML, utils |
| Suggests: | knitr, ggplot2, maps, rmarkdown |
| Published: | 2018-06-26 |
| Author: | Blake Seers [aut, cre] |
| Maintainer: | Blake Seers <blake.seers at gmail.com> |
| BugReports: | https://github.com/blasee/fetchR/issues |
| License: | GPL-2 |
| URL: | https://cran.r-project.org/package=fetchR |
| NeedsCompilation: | no |
| Materials: | README NEWS |
| CRAN checks: | fetchR results |
| Reference manual: | fetchR.pdf |
| Vignettes: |
Calculating Wind Fetch in R |
| Package source: | fetchR_2.1-1.tar.gz |
| Windows binaries: | r-devel: fetchR_2.1-1.zip, r-release: fetchR_2.1-1.zip, r-oldrel: fetchR_2.1-1.zip |
| OS X binaries: | r-release: fetchR_2.1-1.tgz, r-oldrel: fetchR_2.1-1.tgz |
| Old sources: | fetchR archive |
Please use the canonical form https://CRAN.R-project.org/package=fetchR to link to this page.


Home
Blog
Contacts
tags: test1, test, Date:3 may
this is the titile
Please enable JavaScript to view the
comments powered by Disqus.


Noninferiority tests for difference in failure rates at a prespecified control rate or prespecified time.
| Version: | 0.3 |
| Depends: | stats, bpcp, ssanv |
| Published: | 2015-09-26 |
| Author: | Michael P. Fay |
| Maintainer: | Michael P. Fay <mfay at niaid.nih.gov> |
| License: | GPL (≥ 3) |
| NeedsCompilation: | no |
| CRAN checks: | nivm results |
| Reference manual: | nivm.pdf |
| Package source: | nivm_0.3.tar.gz |
| Windows binaries: | r-devel: nivm_0.3.zip, r-release: nivm_0.3.zip, r-oldrel: nivm_0.3.zip |
| OS X binaries: | r-release: nivm_0.3.tgz, r-oldrel: nivm_0.3.tgz |
Please use the canonical form https://CRAN.R-project.org/package=nivm to link to this page.


Conway
Settings
Solid
About
Conway's Game of Life as a 3D mesh's texture
Inspired by this
gif
from
Wikipedia
Available solids
Trefoil knot
Torus


The TypeScript solution / projects has a specific requirements in order to be possible to fully use debugging features (in VS works with Internet Explorer only) and source mappings for all projects in the solution.
This section is splitted to two topics, one related to the Ajs framework End-Users (application developers) and Ajs framework contributors.


in Singapore
Book a value-added, free-and-easy stopover holiday in Singapore and other nearby destinations.  Whatever your travel needs, Tradewinds, the tour-operating arm of Singapore Airlines and SilkAir, offers a wide range of services and tour packages to help you meet them.
Book a value-added, free-and-easy stopover holiday in Singapore and other nearby destinations.  Whatever your travel needs, Tradewinds, the tour-operating arm of Singapore Airlines and SilkAir, offers a wide range of services and tour packages to help you meet them.


--- layout: default header-img: /img/header-bg-websites.jpg title: Privacy Notice --- Craig Chamberlain IT Services Privacy Notice {% capture my_include %}{% include privacy.md %}{% endcapture %} {{ my_include | markdownify }} {% include footer.html %}


| Top |
| void | activate-default | Action |
| void | activate-focus | Action |
| gboolean | enable-debugging | Action |
| void | keys-changed | Run First |
| void | set-focus | Run Last |
GObject ╰── GInitiallyUnowned ╰── GtkWidget ╰── GtkContainer ╰── GtkBin ╰── GtkWindow ├── GtkDialog ├── GtkApplicationWindow ├── GtkAssistant ├── GtkOffscreenWindow ├── GtkPlug ╰── GtkShortcutsWindow
A GtkWindow is a toplevel window which can contain other widgets. Windows normally have decorations that are under the control of the windowing system and allow the user to manipulate the window (resize it, move it, close it,...).
The GtkWindow implementation of the GtkBuildable interface supports a
custom <accel-groups> element, which supports any number of <group>
elements representing the GtkAccelGroup objects you want to add to
your window (synonymous with gtk_window_add_accel_group()
.
It also supports the <initial-focus> element, whose name property names the widget to receive the focus when the window is mapped.
An example of a UI definition fragment with accel groups:
1 2 3 4 5 6 7 8 9 10 |
<object class="GtkWindow"> <accel-groups> <group name="accelgroup1"/> </accel-groups> <initial-focus name="thunderclap"/> </object> ... <object class="GtkAccelGroup" id="accelgroup1"/> |
The GtkWindow implementation of the GtkBuildable interface supports setting a child as the titlebar by specifying “titlebar” as the “type” attribute of a <child> element.
1 2 3 |
window ├── decoration ╰── <child> |
GtkWindow has a main CSS node with name window and style class .background, and a subnode with name decoration.
Style classes that are typically used with the main CSS node are .csd (when client-side decorations are in use), .solid-csd (for client-side decorations without invisible borders), .ssd (used by mutter when rendering server-side decorations). GtkWindow also represents window states with the following style classes on the main node: .tiled, .maximized, .fullscreen. Specialized types of window often add their own discriminating style classes, such as .popup or .tooltip.
GtkWindow adds the .titlebar and .default-decoration style classes to the widget that is added as a titlebar child.
GtkWidget *
gtk_window_new (GtkWindowType type
);
Creates a new GtkWindow, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should be GTK_WINDOW_TOPLEVEL. If you’re implementing something like a popup menu from scratch (which is a bad idea, just use GtkMenu), you might use GTK_WINDOW_POPUP. GTK_WINDOW_POPUP is not for dialogs, though in some other toolkits dialogs are called “popups”. In GTK+, GTK_WINDOW_POPUP means a pop-up menu or pop-up tooltip. On X11, popup windows are not controlled by the window manager.
If you simply want an undecorated window (no window borders), use
gtk_window_set_decorated()
, don’t use GTK_WINDOW_POPUP.
All top-level windows created by gtk_window_new()
are stored in
an internal top-level window list. This list can be obtained from
gtk_window_list_toplevels()
. Due to Gtk+ keeping a reference to
the window internally, gtk_window_new()
does not return a reference
to the caller.
To delete a GtkWindow, call gtk_widget_destroy()
.
void gtk_window_set_title (GtkWindow *window
,const gchar *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, 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.
void gtk_window_set_wmclass (GtkWindow *window
,const gchar *wmclass_name
,const gchar *wmclass_class
);
gtk_window_set_wmclass
has been deprecated since version 3.22 and should not be used in newly-written code.
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.
void gtk_window_set_resizable (GtkWindow *window
,gboolean resizable
);
Sets whether the user can resize a window. Windows are user resizable by default.
gboolean
gtk_window_get_resizable (GtkWindow *window
);
Gets the value set by gtk_window_set_resizable()
.
void gtk_window_add_accel_group (GtkWindow *window
,GtkAccelGroup *accel_group
);
Associate accel_group
with window
, such that calling
gtk_accel_groups_activate()
on window
will activate accelerators
in accel_group
.
void gtk_window_remove_accel_group (GtkWindow *window
,GtkAccelGroup *accel_group
);
Reverses the effects of gtk_window_add_accel_group()
.
gboolean
gtk_window_activate_focus (GtkWindow *window
);
Activates the current focused widget within the window.
gboolean
gtk_window_activate_default (GtkWindow *window
);
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.
void gtk_window_set_modal (GtkWindow *window
,gboolean 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
will then disallow lowering the dialog below the parent.
void gtk_window_set_default_size (GtkWindow *window
,gint width
,gint 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.
Unlike gtk_widget_set_size_request()
, which sets a size request for
a widget and thus would keep users from shrinking the window, this
function only sets the initial size, just as if the user had
resized the window themselves. Users can still shrink the window
again as they normally would. Setting a default size of -1 means to
use the “natural” default size (the size request of the window).
For more control over a window’s initial size and how resizing works,
investigate gtk_window_set_geometry_hints()
.
For some uses, gtk_window_resize()
is a more appropriate function.
gtk_window_resize()
changes the current size of the window, rather
than the size to be used on initial display. gtk_window_resize()
always
affects the window itself, not the geometry widget.
The default size of a window only affects the first time a window is shown; if a window is hidden and re-shown, it will remember the size it had prior to hiding, rather than using the default size.
Windows can’t actually be 0x0 in size, they must be at least 1x1, but
passing 0 for width
and height
is OK, resulting in a 1x1 default size.
If you use this function to reestablish a previously saved window size,
note that the appropriate size to save is the one returned by
gtk_window_get_size()
. Using the window allocation directly will not
work in all circumstances and can lead to growing or shrinking windows.
void gtk_window_set_default_geometry (GtkWindow *window
,gint width
,gint height
);
gtk_window_set_default_geometry
has been deprecated since version 3.20 and should not be used in newly-written code.
This function does nothing. If you want to set a default
size, use gtk_window_set_default_size()
instead.
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.
window |
||
width |
width in resize increments, or -1 to unset the default width |
|
height |
height in resize increments, or -1 to unset the default height |
Since: 3.0
void gtk_window_set_geometry_hints (GtkWindow *window
,GtkWidget *geometry_widget
,GdkGeometry *geometry
,GdkWindowHints geom_mask
);
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.
window |
||
geometry_widget |
widget the geometry hints used to be applied to
or |
[allow-none] |
geometry |
struct containing geometry information or |
[allow-none] |
geom_mask |
mask indicating which struct fields should be paid attention to |
void gtk_window_set_gravity (GtkWindow *window
,GdkGravity gravity
);
Window gravity defines the meaning of coordinates passed to
gtk_window_move()
. See gtk_window_move()
and GdkGravity for
more details.
The default window gravity is GDK_GRAVITY_NORTH_WEST which will typically “do what you mean.”
GdkGravity
gtk_window_get_gravity (GtkWindow *window
);
Gets the value set by gtk_window_set_gravity()
.
void gtk_window_set_position (GtkWindow *window
,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.
void gtk_window_set_transient_for (GtkWindow *window
,GtkWindow *parent
);
Dialog windows should be set transient for the main application
window they were spawned from. This allows
window managers 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.
Passing NULL
for parent
unsets the current transient window.
On Wayland, this function can also be used to attach a new GTK_WINDOW_POPUP to a GTK_WINDOW_TOPLEVEL parent already mapped on screen so that the GTK_WINDOW_POPUP will be created as a subsurface-based window GDK_WINDOW_SUBSURFACE which can be positioned at will relatively to the GTK_WINDOW_TOPLEVEL surface.
On Windows, this function puts the child window on top of the parent, much as the window manager would have done on X.
void gtk_window_set_attached_to (GtkWindow *window
,GtkWidget *attach_widget
);
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
.
Examples of places where specifying this relation is useful are for instance a GtkMenu created by a GtkComboBox, a completion popup window created by GtkEntry or a typeahead search entry created by GtkTreeView.
Note that this function should not be confused with
gtk_window_set_transient_for()
, which specifies a window manager relation
between two toplevels instead.
Passing NULL
for attach_widget
detaches the window.
Since: 3.4
void gtk_window_set_destroy_with_parent (GtkWindow *window
,gboolean 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.
void gtk_window_set_hide_titlebar_when_maximized (GtkWindow *window
,gboolean 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.
Note that custom titlebars set with gtk_window_set_titlebar()
are
not affected by this. The application is in full control of their
content and visibility anyway.
Since: 3.4
void gtk_window_set_screen (GtkWindow *window
,GdkScreen *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.
Since: 2.2
GdkScreen *
gtk_window_get_screen (GtkWindow *window
);
Returns the GdkScreen associated with window
.
Since: 2.2
gboolean
gtk_window_is_active (GtkWindow *window
);
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()
Since: 2.4
gboolean
gtk_window_is_maximized (GtkWindow *window
);
Retrieves the current maximized state of window
.
Note that since maximization is ultimately handled by the window
manager and happens asynchronously to an application request, you
shouldn’t assume the return value of this function changing
immediately (or at all), as an effect of calling
gtk_window_maximize()
or gtk_window_unmaximize()
.
Since: 3.12
gboolean
gtk_window_has_toplevel_focus (GtkWindow *window
);
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.
Since: 2.4
GList *
gtk_window_list_toplevels (void
);
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.
void gtk_window_add_mnemonic (GtkWindow *window
,guint keyval
,GtkWidget *target
);
Adds a mnemonic to this window.
void gtk_window_remove_mnemonic (GtkWindow *window
,guint keyval
,GtkWidget *target
);
Removes a mnemonic from this window.
gboolean gtk_window_mnemonic_activate (GtkWindow *window
,guint keyval
,GdkModifierType modifier
);
Activates the targets associated with the mnemonic.
gboolean gtk_window_activate_key (GtkWindow *window
,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.
Since: 2.4
gboolean gtk_window_propagate_key_event (GtkWindow *window
,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.
Since: 2.4
GtkWidget *
gtk_window_get_focus (GtkWindow *window
);
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.
void gtk_window_set_focus (GtkWindow *window
,GtkWidget *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.
GtkWidget *
gtk_window_get_default_widget (GtkWindow *window
);
Returns the default widget for window
. See
gtk_window_set_default()
for more details.
Since: 2.14
void gtk_window_set_default (GtkWindow *window
,GtkWidget *default_widget
);
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.
void
gtk_window_present (GtkWindow *window
);
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.
If window
is hidden, this function calls gtk_widget_show()
as well.
This function should be used when the user tries to open a window
that’s already open. Say for example the preferences dialog is
currently open, and the user chooses Preferences from the menu
a second time; use gtk_window_present()
to move the already-open dialog
where the user can see it.
If you are calling this function in response to a user interaction,
it is preferable to use gtk_window_present_with_time()
.
void gtk_window_present_with_time (GtkWindow *window
,guint32 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.
window |
||
timestamp |
the timestamp of the user interaction (typically a button or key press event) which triggered this call |
Since: 2.8
void
gtk_window_close (GtkWindow *window
);
Requests that the window is closed, similar to what happens when a window manager close button is clicked.
This function can be used with close buttons in custom titlebars.
Since: 3.10
void
gtk_window_iconify (GtkWindow *window
);
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) 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.
It’s permitted to call this function before showing a window, in which case the window will be iconified before it ever appears onscreen.
You can track iconification via the “window-state-event” signal on GtkWidget.
void
gtk_window_deiconify (GtkWindow *window
);
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)) could iconify it
again before your code which assumes deiconification gets to run.
You can track iconification via the “window-state-event” signal on GtkWidget.
void
gtk_window_stick (GtkWindow *window
);
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 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.
It’s permitted to call this function before showing a window.
You can track stickiness via the “window-state-event” signal on GtkWidget.
void
gtk_window_unstick (GtkWindow *window
);
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) could
stick it again. But normally the window will
end up stuck. Just don’t write code that crashes if not.
You can track stickiness via the “window-state-event” signal on GtkWidget.
void
gtk_window_maximize (GtkWindow *window
);
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) 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.
It’s permitted to call this function before showing a window, in which case the window will be maximized when it appears onscreen initially.
You can track maximization via the “window-state-event” signal on GtkWidget, or by listening to notifications on the “is-maximized” property.
void
gtk_window_unmaximize (GtkWindow *window
);
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)
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.
You can track maximization via the “window-state-event” signal on GtkWidget.
void
gtk_window_fullscreen (GtkWindow *window
);
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) 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.
You can track the fullscreen state via the “window-state-event” signal on GtkWidget.
Since: 2.2
void gtk_window_fullscreen_on_monitor (GtkWindow *window
,GdkScreen *screen
,gint monitor
);
Asks to place window
in the fullscreen state. Note that you shouldn't assume
the window is definitely full screen afterward.
You can track the fullscreen state via the "window-state-event" signal on GtkWidget.
Since: 3.18
void
gtk_window_unfullscreen (GtkWindow *window
);
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) 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.
You can track the fullscreen state via the “window-state-event” signal on GtkWidget.
Since: 2.2
void gtk_window_set_keep_above (GtkWindow *window
,gboolean 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) 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.
It’s permitted to call this function before showing a window, in which case the window will be kept above when it appears onscreen initially.
You can track the above state via the “window-state-event” signal on GtkWidget.
Note that, according to the Extended Window Manager Hints Specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs.
Since: 2.4
void gtk_window_set_keep_below (GtkWindow *window
,gboolean 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) 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.
It’s permitted to call this function before showing a window, in which case the window will be kept below when it appears onscreen initially.
You can track the below state via the “window-state-event” signal on GtkWidget.
Note that, according to the Extended Window Manager Hints Specification, the above state is mainly meant for user preferences and should not be used by applications e.g. for drawing attention to their dialogs.
Since: 2.4
void gtk_window_begin_resize_drag (GtkWindow *window
,GdkWindowEdge edge
,gint button
,gint root_x
,gint root_y
,guint32 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 or windowing system. Otherwise, GDK will try to emulate window resizing, potentially not all that well, depending on the windowing system.
window |
||
button |
mouse button that initiated the drag |
|
edge |
position of the resize control |
|
root_x |
X position where the user clicked to initiate the drag, in root window coordinates |
|
root_y |
Y position where the user clicked to initiate the drag |
|
timestamp |
timestamp from the click event that initiated the drag |
void gtk_window_begin_move_drag (GtkWindow *window
,gint button
,gint root_x
,gint root_y
,guint32 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 or windowing system. Otherwise, GDK will try to emulate window movement, potentially not all that well, depending on the windowing system.
void gtk_window_set_decorated (GtkWindow *window
,gboolean setting
);
By default, windows are decorated with a title bar, resize
controls, etc. Some window managers
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()
.
On Windows, this function always works, since there’s no window manager policy involved.
void gtk_window_set_deletable (GtkWindow *window
,gboolean setting
);
By default, windows have a close button in the window frame. Some
window managers 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()
.
On Windows, this function always works, since there’s no window manager policy involved.
Since: 2.10
void gtk_window_set_mnemonic_modifier (GtkWindow *window
,GdkModifierType modifier
);
Sets the mnemonic modifier for this window.
void gtk_window_set_type_hint (GtkWindow *window
,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.
This function should be called before the window becomes visible.
gtk_dialog_new_with_buttons() and other convenience functions in GTK+
will sometimes call gtk_window_set_type_hint()
on your behalf.
void gtk_window_set_skip_taskbar_hint (GtkWindow *window
,gboolean setting
);
Windows may set a hint asking the desktop environment not to display the window in the task bar. This function sets this hint.
Since: 2.2
void gtk_window_set_skip_pager_hint (GtkWindow *window
,gboolean 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.)
Since: 2.2
void gtk_window_set_urgency_hint (GtkWindow *window
,gboolean setting
);
Windows may set a hint asking the desktop environment to draw the users attention to the window. This function sets this hint.
Since: 2.8
void gtk_window_set_accept_focus (GtkWindow *window
,gboolean setting
);
Windows may set a hint asking the desktop environment not to receive the input focus. This function sets this hint.
Since: 2.4
void gtk_window_set_focus_on_map (GtkWindow *window
,gboolean 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.
Since: 2.6
void gtk_window_set_startup_id (GtkWindow *window
,const gchar *startup_id
);
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.
This function is only useful on X11, not with other GTK+ targets.
Since: 2.12
void gtk_window_set_role (GtkWindow *window
,const gchar *role
);
This function is only useful on X11, not with other GTK+ targets.
In combination with the window title, the window role allows a window manager to identify "the same" window when an application is restarted. So for example you might set the “toolbox” role on your app’s toolbox window, so that when the user restarts their session, the window manager can put the toolbox back in the same place.
If a window already has a unique title, you don’t need to set the role, since the WM can use the title to identify the window when restoring the session.
gboolean
gtk_window_get_decorated (GtkWindow *window
);
Returns whether the window has been set to have decorations
such as a title bar via gtk_window_set_decorated()
.
gboolean
gtk_window_get_deletable (GtkWindow *window
);
Returns whether the window has been set to have a close button
via gtk_window_set_deletable()
.
Since: 2.10
GList *
gtk_window_get_default_icon_list (void
);
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.
const gchar *
gtk_window_get_default_icon_name (void
);
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()
.
Since: 2.16
void gtk_window_get_default_size (GtkWindow *window
,gint *width
,gint *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.
gboolean
gtk_window_get_destroy_with_parent (GtkWindow *window
);
Returns whether the window will be destroyed with its transient parent. See
gtk_window_set_destroy_with_parent()
.
gboolean
gtk_window_get_hide_titlebar_when_maximized
(GtkWindow *window
);
Returns whether the window has requested to have its titlebar hidden
when maximized. See gtk_window_set_hide_titlebar_when_maximized()
.
Since: 3.4
GdkPixbuf *
gtk_window_get_icon (GtkWindow *window
);
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).
GList *
gtk_window_get_icon_list (GtkWindow *window
);
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.
const gchar *
gtk_window_get_icon_name (GtkWindow *window
);
Returns the name of the themed icon for the window,
see gtk_window_set_icon_name()
.
Since: 2.6
GdkModifierType
gtk_window_get_mnemonic_modifier (GtkWindow *window
);
Returns the mnemonic modifier for this window. See
gtk_window_set_mnemonic_modifier()
.
gboolean
gtk_window_get_modal (GtkWindow *window
);
Returns whether the window is modal. See gtk_window_set_modal()
.
void gtk_window_get_position (GtkWindow *window
,gint *root_x
,gint *root_y
);
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.
The reliability of this function depends on the windowing system currently in use. Some windowing systems, such as Wayland, do not support a global coordinate system, and thus the position of the window will always be (0, 0). Others, like X11, do not have a reliable way to obtain the geometry of the decorations of a window if they are provided by the window manager. Additionally, on X11, window manager have been known to mismanage window gravity, which result in windows moving even if you use the coordinates of the current position as returned by this function.
If you haven’t changed the window gravity, its gravity will be
GDK_GRAVITY_NORTH_WEST. This means that gtk_window_get_position()
gets the position of the top-left corner of the window manager
frame for the window. gtk_window_move()
sets the position of this
same top-left corner.
If a window has gravity GDK_GRAVITY_STATIC the window manager
frame is not relevant, and thus gtk_window_get_position()
will
always produce accurate results. However you can’t use static
gravity to do things like place a window in a corner of the screen,
because static gravity ignores the window manager decorations.
Ideally, this function should return appropriate values if the window has client side decorations, assuming that the windowing system supports global coordinates.
In practice, saving the window position should not be left to applications, as they lack enough knowledge of the windowing system and the window manager state to effectively do so. The appropriate way to implement saving the window position is to use a platform-specific protocol, wherever that is available.
const gchar *
gtk_window_get_role (GtkWindow *window
);
Returns the role of the window. See gtk_window_set_role()
for
further explanation.
the role of the window if set, or NULL
. The
returned is owned by the widget and must not be modified or freed.
[nullable]
void gtk_window_get_size (GtkWindow *window
,gint *width
,gint *height
);
Obtains the current size of window
.
If window
is not visible on screen, this function return the size GTK+
will suggest to the window manager for the initial window
size (but this is not reliably the same as the size the window manager
will actually select). See: gtk_window_set_default_size()
.
Depending on the windowing system and the window manager constraints,
the size returned by this function may not match the size set using
gtk_window_resize()
; additionally, since gtk_window_resize()
may be
implemented as an asynchronous operation, GTK+ cannot guarantee in any
way that this code:
1 2 3 4 5 |
// width and height are set elsewhere gtk_window_resize (window, width, height); int new_width, new_height; gtk_window_get_size (window, &new_width, &new_height); |
will result in new_width
and new_height
matching width
and
height
, respectively.
This function will return the logical size of the GtkWindow, excluding the widgets used in client side decorations; there is, however, no guarantee that the result will be completely accurate because client side decoration may include widgets that depend on the user preferences and that may not be visibile at the time you call this function.
The dimensions returned by this function are suitable for being
stored across sessions; use gtk_window_set_default_size()
to
restore them when before showing the window.
To avoid potential race conditions, you should only call this function in response to a size change notification, for instance inside a handler for the “size-allocate” signal, or inside a handler for the “configure-event” signal:
1 2 3 4 5 6 7 8 9 |
static void on_size_allocate (GtkWidget *widget, GtkAllocation *allocation) { int new_width, new_height; gtk_window_get_size (GTK_WINDOW (widget), &new_width, &new_height); ... } |
Note that, if you connect to the “size-allocate” signal, you should not use the dimensions of the GtkAllocation passed to the signal handler, as the allocation may contain client side decorations added by GTK+, depending on the windowing system in use.
If you are getting a window size in order to position the window
on the screen, you should, instead, simply set the window’s semantic
type with gtk_window_set_type_hint()
, which allows the window manager
to e.g. center dialogs. Also, if you set the transient parent of
dialogs with gtk_window_set_transient_for()
window managers will
often center the dialog over its parent window. It's much preferred
to let the window manager handle these cases rather than doing it
yourself, because all apps will behave consistently and according to
user or system preferences, if the window manager handles it. Also,
the window manager can take into account the size of the window
decorations and border that it may add, and of which GTK+ has no
knowledge. Additionally, positioning windows in global screen coordinates
may not be allowed by the windowing system. For more information,
see: gtk_window_set_position()
.
const gchar *
gtk_window_get_title (GtkWindow *window
);
Retrieves the title of the window. See gtk_window_set_title()
.
the title of the window, or NULL
if none has
been set explicitly. The returned string is owned by the widget
and must not be modified or freed.
[nullable]
GtkWindow *
gtk_window_get_transient_for (GtkWindow *window
);
Fetches the transient parent for this window. See
gtk_window_set_transient_for()
.
the transient parent for this
window, or NULL
if no transient parent has been set.
[nullable][transfer none]
GtkWidget *
gtk_window_get_attached_to (GtkWindow *window
);
Fetches the attach widget for this window. See
gtk_window_set_attached_to()
.
the widget where the window
is attached, or NULL
if the window is not attached to any widget.
[nullable][transfer none]
Since: 3.4
GdkWindowTypeHint
gtk_window_get_type_hint (GtkWindow *window
);
Gets the type hint for this window. See gtk_window_set_type_hint()
.
gboolean
gtk_window_get_skip_taskbar_hint (GtkWindow *window
);
Gets the value set by gtk_window_set_skip_taskbar_hint()
Since: 2.2
gboolean
gtk_window_get_skip_pager_hint (GtkWindow *window
);
Gets the value set by gtk_window_set_skip_pager_hint()
.
Since: 2.2
gboolean
gtk_window_get_urgency_hint (GtkWindow *window
);
Gets the value set by gtk_window_set_urgency_hint()
Since: 2.8
gboolean
gtk_window_get_accept_focus (GtkWindow *window
);
Gets the value set by gtk_window_set_accept_focus()
.
Since: 2.4
gboolean
gtk_window_get_focus_on_map (GtkWindow *window
);
Gets the value set by gtk_window_set_focus_on_map()
.
Since: 2.6
GtkWindowGroup *
gtk_window_get_group (GtkWindow *window
);
Returns the group for window
or the default group, if
window
is NULL
or if window
does not have an explicit
window group.
Since: 2.10
gboolean
gtk_window_has_group (GtkWindow *window
);
Returns whether window
has an explicit window group.
GtkWindowType
gtk_window_get_window_type (GtkWindow *window
);
Gets the type of the window. See GtkWindowType.
Since: 2.20
void gtk_window_move (GtkWindow *window
,gint x
,gint y
);
Asks the window manager 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.
Note: the position is the position of the gravity-determined reference point for the window. The gravity determines two things: first, the location of the reference point in root window coordinates; and second, which point on the window is positioned at the reference point.
By default the gravity is GDK_GRAVITY_NORTH_WEST, so the reference
point is simply the x
, y
supplied to gtk_window_move()
. The
top-left corner of the window decorations (aka window frame or
border) will be placed at x
, y
. Therefore, to position a window
at the top left of the screen, you want to use the default gravity
(which is GDK_GRAVITY_NORTH_WEST) and move the window to 0,0.
To position a window at the bottom right corner of the screen, you
would set GDK_GRAVITY_SOUTH_EAST, which means that the reference
point is at x
+ the window width and y
+ the window height, and
the bottom-right corner of the window border will be placed at that
reference point. So, to place a window in the bottom right corner
you would first set gravity to south east, then write:
gtk_window_move (window,
(note that this
example does not take multi-head scenarios into account).gdk_screen_width()
- window_width,
gdk_screen_height()
- window_height)
The Extended Window Manager Hints Specification has a nice table of gravities in the “implementation notes” section.
The gtk_window_get_position()
documentation may also be relevant.
gboolean gtk_window_parse_geometry (GtkWindow *window
,const gchar *geometry
);
gtk_window_parse_geometry
has been deprecated since version 3.20 and should not be used in newly-written code.
Geometry handling in GTK is deprecated.
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.
If either a size or a position can be extracted from the
geometry string, gtk_window_parse_geometry()
returns TRUE
and calls gtk_window_set_default_size()
and/or gtk_window_move()
to resize/move the window.
If gtk_window_parse_geometry()
returns TRUE
, it will also
set the GDK_HINT_USER_POS and/or GDK_HINT_USER_SIZE hints
indicating to the window manager that the size/position of
the window was user-specified. This causes most window
managers to honor the geometry.
Note that for gtk_window_parse_geometry()
to work as expected, it has
to be called when the window has its “final” size, i.e. after calling
gtk_widget_show_all()
on the contents and gtk_window_set_geometry_hints()
on the window.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 |
#include <gtk/gtk.h> static void fill_with_content (GtkWidget *vbox) { // fill with content... } int main (int argc, char *argv[]) { GtkWidget *window, *vbox; GdkGeometry size_hints = { 100, 50, 0, 0, 100, 50, 10, 10, 0.0, 0.0, GDK_GRAVITY_NORTH_WEST }; gtk_init (&argc, &argv); window = gtk_window_new (GTK_WINDOW_TOPLEVEL); vbox = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); gtk_container_add (GTK_CONTAINER (window), vbox); fill_with_content (vbox); gtk_widget_show_all (vbox); gtk_window_set_geometry_hints (GTK_WINDOW (window), NULL, &size_hints, GDK_HINT_MIN_SIZE | GDK_HINT_BASE_SIZE | GDK_HINT_RESIZE_INC); if (argc > 1) { gboolean res; res = gtk_window_parse_geometry (GTK_WINDOW (window), argv[1]); if (! res) fprintf (stderr, "Failed to parse “%s”\n", argv[1]); } gtk_widget_show_all (window); gtk_main (); return 0; } |
void
gtk_window_reshow_with_initial_size (GtkWindow *window
);
gtk_window_reshow_with_initial_size
has been deprecated since version 3.10 and should not be used in newly-written code.
GUI builders can call gtk_widget_hide()
,
gtk_widget_unrealize()
and then gtk_widget_show()
on window
themselves, if they still need this functionality.
Hides window
, then reshows it, resetting the
default size and position of the window. Used
by GUI builders only.
void gtk_window_resize (GtkWindow *window
,gint width
,gint 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.
If gtk_window_resize()
is called before showing a window for the
first time, it overrides any default size set with
gtk_window_set_default_size()
.
Windows may not be resized smaller than 1 by 1 pixels.
When using client side decorations, GTK+ will do its best to adjust
the given size so that the resulting window size matches the
requested size without the title bar, borders and shadows added for
the client side decorations, but there is no garantee that the
result will be totally accurate because these widgets added for
client side decorations depend on the theme and may not be realized
or visible at the time gtk_window_resize()
is issued.
Typically, gtk_window_resize()
will compensate for the GtkHeaderBar
height only if it's known at the time the resulting GtkWindow
configuration is issued.
For example, if new widgets are added after the GtkWindow configuration
and cause the GtkHeaderBar to grow in height, this will result in a
window content smaller that specified by gtk_window_resize()
and not
a larger window.
void gtk_window_resize_to_geometry (GtkWindow *window
,gint width
,gint height
);
gtk_window_resize_to_geometry
has been deprecated since version 3.20 and should not be used in newly-written code.
This function does nothing. Use
gtk_window_resize()
and compute the geometry yourself.
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.
window |
||
width |
width in resize increments to resize the window to |
|
height |
height in resize increments to resize the window to |
Since: 3.0
void
gtk_window_set_default_icon_list (GList *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.
See gtk_window_set_icon_list()
for more details.
void
gtk_window_set_default_icon (GdkPixbuf *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.
Since: 2.4
gboolean gtk_window_set_default_icon_from_file (const gchar *filename
,GError **err
);
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
.
filename |
location of icon file. |
[type filename] |
err |
location to store error, or |
[allow-none] |
Since: 2.2
void
gtk_window_set_default_icon_name (const gchar *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()
.
Since: 2.6
void gtk_window_set_icon (GtkWindow *window
,GdkPixbuf *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.
The icon should be provided in whatever size it was naturally drawn; that is, don’t scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
If you have your icon hand-drawn in multiple sizes, use
gtk_window_set_icon_list()
. Then the best size will be used.
This function is equivalent to calling gtk_window_set_icon_list()
with a 1-element list.
See also gtk_window_set_default_icon_list()
to set the icon
for all windows in your application in one go.
void gtk_window_set_icon_list (GtkWindow *window
,GList *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.
gtk_window_set_icon_list() allows you to pass in the same icon in several hand-drawn sizes. The list should contain the natural sizes your icon is available in; that is, don’t scale the image before passing it to GTK+. Scaling is postponed until the last minute, when the desired final size is known, to allow best quality.
By passing several sizes, you may improve the final image quality of the icon, by reducing or eliminating automatic image scaling.
Recommended sizes to provide: 16x16, 32x32, 48x48 at minimum, and larger images (64x64, 128x128) if you have them.
See also gtk_window_set_default_icon_list()
to set the icon
for all windows in your application in one go.
Note that transient windows (those who have been set transient for another
window using gtk_window_set_transient_for()
) will inherit their
icon from their transient parent. So there’s no need to explicitly
set the icon on transient windows.
gboolean gtk_window_set_icon_from_file (GtkWindow *window
,const gchar *filename
,GError **err
);
Sets the icon for window
.
Warns on failure if err
is NULL
.
This function is equivalent to calling gtk_window_set_icon()
with a pixbuf created by loading the image from filename
.
Since: 2.2
void gtk_window_set_icon_name (GtkWindow *window
,const gchar *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.
Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM.
Since: 2.6
void
gtk_window_set_auto_startup_notification
(gboolean 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.
In that example, you would disable startup notification temporarily, show your splash screen, then re-enable it so that showing the main window would automatically result in notification.
Since: 2.2
gdouble
gtk_window_get_opacity (GtkWindow *window
);
gtk_window_get_opacity
has been deprecated since version 3.8 and should not be used in newly-written code.
Use gtk_widget_get_opacity instead.
Fetches the requested opacity for this window. See
gtk_window_set_opacity()
.
Since: 2.12
void gtk_window_set_opacity (GtkWindow *window
,gdouble opacity
);
gtk_window_set_opacity
has been deprecated since version 3.8 and should not be used in newly-written code.
Use gtk_widget_set_opacity instead.
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.
Note that setting a window’s opacity after the window has been shown causes it to flicker once on Windows.
Since: 2.12
gboolean
gtk_window_get_mnemonics_visible (GtkWindow *window
);
Gets the value of the “mnemonics-visible” property.
Since: 2.20
void gtk_window_set_mnemonics_visible (GtkWindow *window
,gboolean setting
);
Sets the “mnemonics-visible” property.
Since: 2.20
gboolean
gtk_window_get_focus_visible (GtkWindow *window
);
Gets the value of the “focus-visible” property.
Since: 3.2
void gtk_window_set_focus_visible (GtkWindow *window
,gboolean setting
);
Sets the “focus-visible” property.
Since: 3.2
void gtk_window_set_has_resize_grip (GtkWindow *window
,gboolean value
);
gtk_window_set_has_resize_grip
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
Sets whether window
has a corner resize grip.
Note that the resize grip is only shown if the window
is actually resizable and not maximized. Use
gtk_window_resize_grip_is_visible()
to find out if the
resize grip is currently shown.
Since: 3.0
gboolean
gtk_window_get_has_resize_grip (GtkWindow *window
);
gtk_window_get_has_resize_grip
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
Determines whether the window may have a resize grip.
Since: 3.0
gboolean
gtk_window_resize_grip_is_visible (GtkWindow *window
);
gtk_window_resize_grip_is_visible
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
Determines whether a resize grip is visible for the specified window.
Since: 3.0
gboolean gtk_window_get_resize_grip_area (GtkWindow *window
,GdkRectangle *rect
);
gtk_window_get_resize_grip_area
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
If a window has a resize grip, this will retrieve the grip position, width and height into the specified GdkRectangle.
window |
||
rect |
a pointer to a GdkRectangle which we should store the resize grip area. |
[out] |
Since: 3.0
GtkApplication *
gtk_window_get_application (GtkWindow *window
);
Gets the GtkApplication associated with the window (if any).
Since: 3.0
void gtk_window_set_application (GtkWindow *window
,GtkApplication *application
);
Sets or unsets the GtkApplication associated with the window.
The application will be kept alive for at least as long as the window is open.
Since: 3.0
void gtk_window_set_has_user_ref_count (GtkWindow *window
,gboolean setting
);
Tells GTK+ whether to drop its extra reference to the window
when gtk_widget_destroy()
is called.
This function is only exported for the benefit of language bindings which may need to keep the window alive until their wrapper object is garbage collected. There is no justification for ever calling this function in an application.
Since: 3.0
void gtk_window_set_titlebar (GtkWindow *window
,GtkWidget *titlebar
);
Sets a custom titlebar for window
.
If you set a custom titlebar, GTK+ will do its best to convince
the window manager not to put its own titlebar on the window.
Depending on the system, this function may not work for a window
that is already visible, so you set the titlebar before calling
gtk_widget_show()
.
Since: 3.10
GtkWidget *
gtk_window_get_titlebar (GtkWindow *window
);
Returns the custom titlebar that has been set with
gtk_window_set_titlebar()
.
Since: 3.16
void
gtk_window_set_interactive_debugging (gboolean enable
);
Opens or closes the interactive debugger, which offers access to the widget hierarchy of the application and to useful debugging tools.
Since: 3.14
struct GtkWindowClass { GtkBinClass parent_class; void (* set_focus) (GtkWindow *window, GtkWidget *focus); /* G_SIGNAL_ACTION signals for keybindings */ void (* activate_focus) (GtkWindow *window); void (* activate_default) (GtkWindow *window); void (* keys_changed) (GtkWindow *window); gboolean (* enable_debugging) (GtkWindow *window, gboolean toggle); };
Sets child as the focus widget for the window. |
||
Activates the current focused widget within the window. |
||
Activates the default widget for the window. |
||
Signal gets emitted when the set of accelerators or mnemonics that are associated with window changes. |
||
Class handler for the “enable-debugging” keybinding signal. Since: 3.14 |
A GtkWindow can be one of these types. Most things you’d consider a
“window” should have type GTK_WINDOW_TOPLEVEL; windows with this type
are managed by the window manager and have a frame by default (call
gtk_window_set_decorated()
to toggle the frame). Windows with type
GTK_WINDOW_POPUP are ignored by the window manager; window manager
keybindings won’t work on them, the window manager won’t decorate the
window with a frame, many GTK+ features that rely on the window
manager will not work (e.g. resize grips and
maximization/minimization). GTK_WINDOW_POPUP is used to implement
widgets such as GtkMenu or tooltips that you normally don’t think of
as windows per se. Nearly all windows should be GTK_WINDOW_TOPLEVEL.
In particular, do not use GTK_WINDOW_POPUP just to turn off
the window borders; use gtk_window_set_decorated()
for that.
Window placement can be influenced using this enumeration. Note that using GTK_WIN_POS_CENTER_ALWAYS is almost always a bad idea. It won’t necessarily work well with all window managers or on all windowing systems.
|
No influence is made on placement. |
||
|
Windows should be placed in the center of the screen. |
||
|
Windows should be placed at the current mouse position. |
||
|
Keep window centered as it changes size, etc. |
||
|
Center the window on its transient
parent (see |
“accept-focus”
property“accept-focus” gboolean
Whether the window should receive the input focus.
Flags: Read / Write
Default value: TRUE
Since: 2.4
“application”
property“application” GtkApplication *
The GtkApplication associated with the window.
The application will be kept alive for at least as long as it
has any windows associated with it (see g_application_hold()
for a way to keep it alive without windows).
Normally, the connection between the application and the window
will remain until the window is destroyed, but you can explicitly
remove it by setting the :application property to NULL
.
Flags: Read / Write
Since: 3.0
“attached-to”
property“attached-to” GtkWidget *
The widget to which this window is attached.
See gtk_window_set_attached_to()
.
Examples of places where specifying this relation is useful are for instance a GtkMenu created by a GtkComboBox, a completion popup window created by GtkEntry or a typeahead search entry created by GtkTreeView.
Flags: Read / Write / Construct
Since: 3.4
“decorated”
property“decorated” gboolean
Whether the window should be decorated by the window manager.
Flags: Read / Write
Default value: TRUE
Since: 2.4
“default-height”
property“default-height” gint
The default height of the window, used when initially showing the window.
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“default-width”
property“default-width” gint
The default width of the window, used when initially showing the window.
Flags: Read / Write
Allowed values: >= -1
Default value: -1
“deletable”
property“deletable” gboolean
Whether the window frame should have a close button.
Flags: Read / Write
Default value: TRUE
Since: 2.10
“destroy-with-parent”
property“destroy-with-parent” gboolean
If this window should be destroyed when the parent is destroyed.
Flags: Read / Write
Default value: FALSE
“focus-on-map”
property“focus-on-map” gboolean
Whether the window should receive the input focus when mapped.
Flags: Read / Write
Default value: TRUE
Since: 2.6
“focus-visible”
property“focus-visible” gboolean
Whether 'focus rectangles' are currently visible in this window.
This property is maintained by GTK+ based on user input and should not be set by applications.
Flags: Read / Write
Default value: TRUE
Since: 2.20
“gravity”
property“gravity” GdkGravity
The window gravity of the window. See gtk_window_move()
and GdkGravity for
more details about window gravity.
Flags: Read / Write
Default value: GDK_GRAVITY_NORTH_WEST
Since: 2.4
“has-resize-grip”
property“has-resize-grip” gboolean
Whether the window has a corner resize grip.
Note that the resize grip is only shown if the window is actually resizable and not maximized. Use “resize-grip-visible” to find out if the resize grip is currently shown.
GtkWindow:has-resize-grip
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
Flags: Read / Write
Default value: FALSE
Since: 3.0
“has-toplevel-focus”
property“has-toplevel-focus” gboolean
Whether the input focus is within this GtkWindow.
Flags: Read
Default value: FALSE
“hide-titlebar-when-maximized”
property“hide-titlebar-when-maximized” gboolean
Whether the titlebar should be hidden during maximization.
Flags: Read / Write
Default value: FALSE
Since: 3.4
“icon-name”
property“icon-name” gchar *
The :icon-name property specifies the name of the themed icon to use as the window icon. See GtkIconTheme for more details.
Flags: Read / Write
Default value: NULL
Since: 2.6
“is-active”
property“is-active” gboolean
Whether the toplevel is the current active window.
Flags: Read
Default value: FALSE
“is-maximized”
property“is-maximized” gboolean
Whether the window is maximized.
Flags: Read
Default value: FALSE
“mnemonics-visible”
property“mnemonics-visible” gboolean
Whether mnemonics are currently visible in this window.
This property is maintained by GTK+ based on user input, and should not be set by applications.
Flags: Read / Write
Default value: TRUE
Since: 2.20
“modal”
property“modal” gboolean
If TRUE, the window is modal (other windows are not usable while this one is up).
Flags: Read / Write
Default value: FALSE
“resizable”
property“resizable” gboolean
If TRUE, users can resize the window.
Flags: Read / Write
Default value: TRUE
“resize-grip-visible”
property“resize-grip-visible” gboolean
Whether a corner resize grip is currently shown.
GtkWindow:resize-grip-visible
has been deprecated since version 3.14 and should not be used in newly-written code.
Resize grips have been removed.
Flags: Read
Default value: FALSE
Since: 3.0
“role”
property“role” gchar *
Unique identifier for the window to be used when restoring a session.
Flags: Read / Write
Default value: NULL
“screen”
property“screen” GdkScreen *
The screen where this window will be displayed.
Flags: Read / Write
“skip-pager-hint”
property“skip-pager-hint” gboolean
TRUE if the window should not be in the pager.
Flags: Read / Write
Default value: FALSE
“skip-taskbar-hint”
property“skip-taskbar-hint” gboolean
TRUE if the window should not be in the task bar.
Flags: Read / Write
Default value: FALSE
“startup-id”
property“startup-id” gchar *
The :startup-id is a write-only property for setting window's
startup notification identifier. See gtk_window_set_startup_id()
for more details.
Flags: Write
Default value: NULL
Since: 2.12
“title”
property“title” gchar *
The title of the window.
Flags: Read / Write
Default value: NULL
“transient-for”
property“transient-for” GtkWindow *
The transient parent of the window. See gtk_window_set_transient_for()
for
more details about transient windows.
Flags: Read / Write / Construct
Since: 2.10
“type”
property“type” GtkWindowType
The type of the window.
Flags: Read / Write / Construct Only
Default value: GTK_WINDOW_TOPLEVEL
“type-hint”
property“type-hint” GdkWindowTypeHint
Hint to help the desktop environment understand what kind of window this is and how to treat it.
Flags: Read / Write
Default value: GDK_WINDOW_TYPE_HINT_NORMAL
“urgency-hint”
property“urgency-hint” gboolean
TRUE if the window should be brought to the user's attention.
Flags: Read / Write
Default value: FALSE
“window-position”
property“window-position” GtkWindowPosition
The initial position of the window.
Flags: Read / Write
Default value: GTK_WIN_POS_NONE
“decoration-button-layout”
style property“decoration-button-layout” gchar *
Decorated button layout.
Flags: Read
Default value: "menu:close"
“decoration-resize-handle”
style property“decoration-resize-handle” gint
Decoration resize handle size.
Flags: Read / Write
Allowed values: >= 0
Default value: 20
“activate-default”
signalvoid user_function (GtkWindow *window, gpointer user_data)
The ::activate-default signal is a
keybinding signal
which gets emitted when the user activates the default widget
of window
.
window |
the window which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“activate-focus”
signalvoid user_function (GtkWindow *window, gpointer user_data)
The ::activate-focus signal is a
keybinding signal
which gets emitted when the user activates the currently
focused widget of window
.
window |
the window which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“enable-debugging”
signalgboolean user_function (GtkWindow *window, gboolean toggle, gpointer user_data)
The ::enable-debugging signal is a keybinding signal
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.
The default bindings for this signal are Ctrl-Shift-I and Ctrl-Shift-D.
Return: TRUE
if the key binding was handled
window |
the window on which the signal is emitted |
|
toggle |
toggle the debugger |
|
user_data |
user data set when the signal handler was connected. |
Flags: Action
“keys-changed”
signalvoid user_function (GtkWindow *window, gpointer user_data)
The ::keys-changed signal gets emitted when the set of accelerators
or mnemonics that are associated with window
changes.
window |
the window which received the signal |
|
user_data |
user data set when the signal handler was connected. |
Flags: Run First


Learn how to use compiling Scss, change brand colors and more.
Learn more about colors, typography, icons and the grid system we used for .
Browse our 50 beautiful handcrafted components offered in the Free version.


CSSO (CSS Optimizer) is a CSS minifier. It performs three sort of transformations: cleaning (removing redundant), compression (replacement for shorter form) and restructuring (merge of declarations, rulesets and so on). As a result your CSS becomes much smaller.
npm install -g csso
Or try out CSSO right in your browser (web interface).
csso [input] [output] [options]
Options:
--comments <value> Comments to keep: exclamation (default), first-exclamation or none
--debug [level] Output intermediate state of CSS during compression
-h, --help Output usage information
-i, --input <filename> Input file
--input-map <source> Input source map: none, auto (default) or <filename>
-m, --map <destination> Generate source map: none (default), inline, file or <filename>
-o, --output <filename> Output file (result outputs to stdout if not set)
--restructure-off Turns structure minimization off
--stat Output statistics in stderr
-u, --usage <filenane> Usage data file
-v, --version Output version
Some examples:
> csso in.css
...output result in stdout...
> csso in.css --output out.css
> echo '.test { color: #ff0000; }' | csso
.test{color:red}
> cat source1.css source2.css | csso | gzip -9 -c > production.css.gz
Source map doesn't generate by default. To generate map use --map
CLI option, that can be:
none
(default) – don't generate source mapinline
– add source map into result CSS (via /*# sourceMappingURL=application/json;base64,... */
)file
– write source map into file with same name as output file, but with .map
extension (in this case --output
option is required)Examples:
> csso my.css --map inline
> csso my.css --output my.min.css --map file
> csso my.css --output my.min.css --map maps/my.min.map
Use --input-map
option to specify input source map if needed. Possible values for option:
auto
(default) - attempt to fetch input source map by follow steps:
--input
is specified) check file with same name as input file but with .map
extension exists and read its contentnone
- don't use input source map; actually it's using to disable auto
-fetchingGenerally you shouldn't care about input source map since defaults behaviour (auto
) covers most use cases.
NOTE: Input source map is using only if output source map is generating.
CSSO
can use data about how CSS
is using for better compression. File with this data (JSON
format) can be set using --usage
option. Usage data may contain follow sections:
tags
– white list of tagsids
– white list of idsclasses
– white list of classesscopes
– groups of classes which never used with classes from other groups on single elementAll sections are optional. Value of tags
, ids
and classes
should be array of strings, value of scopes
should be an array of arrays of strings. Other values are ignoring.
tags
, ids
and classes
are using on clean stage to filter selectors that contains something that not in list. Selectors are filtering only by those kind of simple selector which white list is specified. For example, if only tags
list is specified then type selectors are checking, and if selector hasn't any type selector (or even any type selector) it isn't filter.
ids
andclasses
names are case sensitive,tags
– is not.
Input CSS:
* { color: green; }
ul, ol, li { color: blue; }
UL.foo, span.bar { color: red; }
Usage data:
{
"tags": ["ul", "LI"]
}
Result CSS:
*{color:green}ul,li{color:blue}ul.foo{color:red}
Scopes is designed for CSS scope isolation solutions such as css-modules. Scopes are similar to namespaces and defines lists of class names that exclusively used on some markup. This information allows the optimizer to move rulesets more agressive. Since it assumes selectors from different scopes can't to be matched on the same element. That leads to better ruleset merging.
Suppose we have a file:
.module1-foo { color: red; }
.module1-bar { font-size: 1.5em; background: yellow; }
.module2-baz { color: red; }
.module2-qux { font-size: 1.5em; background: yellow; width: 50px; }
It can be assumed that first two rules never used with second two on the same markup. But we can't know that for sure without markup. The optimizer doesn't know it eather and will perform safe transformations only. The result will be the same as input but with no spaces and some semicolons:
.module1-foo{color:red}.module1-bar{font-size:1.5em;background:#ff0}.module2-baz{color:red}.module2-qux{font-size:1.5em;background:#ff0;width:50px}
But with usage data CSSO
can get better output. If follow usage data is provided:
{
"scopes": [
["module1-foo", "module1-bar"],
["module2-baz", "module2-qux"]
]
}
New result (29 bytes extra saving):
.module1-foo,.module2-baz{color:red}.module1-bar,.module2-qux{font-size:1.5em;background:#ff0}.module2-qux{width:50px}
If class name doesn't specified in scopes
it belongs to default "scope". scopes
doesn't affect classes
. If class name presents in scopes
but missed in classes
(both sections specified) it will be filtered.
Note that class name can't be specified in several scopes. Also selector can't has classes from different scopes. In both cases an exception throws.
Currently the optimizer doesn't care about out-of-bounds selectors order changing safety (i.e. selectors that may be matched to elements with no class name of scope, e.g. .scope div
or .scope ~ :last-child
) since assumes scoped CSS modules doesn't relay on it's order. It may be fix in future if to be an issue.
var csso = require('csso');
var compressedCss = csso.minify('.test { color: #ff0000; }').css;
console.log(compressedCss);
// .test{color:red}
You may minify CSS by yourself step by step:
var ast = csso.parse('.test { color: #ff0000; }');
var compressResult = csso.compress(ast);
var compressedCss = csso.translate(compressResult.ast);
console.log(compressedCss);
// .test{color:red}
Working with source maps:
var css = fs.readFileSync('path/to/my.css', 'utf8');
var result = csso.minify(css, {
filename: 'path/to/my.css', // will be added to source map as reference to source file
sourceMap: true // generate source map
});
console.log(result);
// { css: '...minified...', map: SourceMapGenerator {} }
console.log(result.map.toString());
// '{ .. source map content .. }'
Minify source
CSS passed as String
.
Options:
Boolean
- generate source map if true
String
- filename of input, uses for source mapBoolean
- output debug information to stderr
function|array<function>
- called right after parse is run. Callbacks arguments are ast, options
.function|array<function>
- called right after compress is run. Callbacks arguments are compressResult, options
.compress()
Returns an object with properties:
String
– resulting CSSObject
– instance of SourceMapGenerator
or null
var result = csso.minify('.test { color: #ff0000; }', {
restructure: false, // don't change CSS structure, i.e. don't merge declarations, rulesets etc
debug: true // show additional debug information:
// true or number from 1 to 3 (greater number - more details)
});
console.log(result.css);
// > .test{color:red}
The same as minify()
but for style block. Usualy it's a style
attribute content.
var result = csso.minifyBlock('color: rgba(255, 0, 0, 1); color: #ff0000').css;
console.log(result.css);
// > color:red
Parse CSS to AST.
NOTE: Currenly parser omit redundant separators, spaces and comments (except exclamation comments, i.e.
/*! comment */
) on AST build, since those things are removing by compressor anyway.
Options:
String
– parsing context, useful when some part of CSS is parsing (see below)Boolean
– should AST contains node position or not, store data in info
property of nodes (false
by default)String
– filename of source that adds to info when positions
is true, uses for source map generation (<unknown>
by default)Number
– initial line number, useful when parse fragment of CSS to compute correct positionsNumber
– initial column number, useful when parse fragment of CSS to compute correct positionsContexts:
stylesheet
(default) – regular stylesheet, should be suitable in most casesatrule
– at-rule (e.g. @media screen, print { ... }
)atruleExpression
– at-rule expression (screen, print
for example above)ruleset
– rule (e.g. .foo, .bar:hover { color: red; border: 1px solid black; }
)selector
– selector group (.foo, .bar:hover
for ruleset example)simpleSelector
– selector (.foo
or .bar:hover
for ruleset example)block
– block content w/o curly braces (color: red; border: 1px solid black;
for ruleset example)declaration
– declaration (color: red
or border: 1px solid black
for ruleset example)value
– declaration value (red
or 1px solid black
for ruleset example)// simple parsing with no options
var ast = csso.parse('.example { color: red }');
// parse with options
var ast = csso.parse('.foo.bar', {
context: 'simpleSelector',
positions: true
});
Does the main task – compress AST.
NOTE:
compress
performs AST compression by transforming input AST by default (since AST cloning is expensive and needed in rare cases). Useclone
option with truthy value in case you want to keep input AST untouched.
Options:
Boolean
– do the structure optimisations or not (true
by default)Boolean
- transform a copy of input AST if true
, useful in case of AST reuse (false
by default)String
or Boolean
– specify what comments to left
'exclamation'
or true
(default) – left all exclamation comments (i.e. /*! .. */
)'first-exclamation'
– remove every comments except first onefalse
– remove every commentsObject
- usage data for advanced optimisations (see Usage data for details)Function
- function to track every step of transformationsMake an AST node deep copy.
var orig = csso.parse('.test { color: red }');
var copy = csso.clone(orig);
csso.walk(copy, function(node) {
if (node.type === 'Class') {
node.name = 'replaced';
}
});
console.log(csso.translate(orig));
// .test{color:red}
console.log(csso.translate(copy));
// .replaced{color:red}
Converts AST to string.
var ast = csso.parse('.test { color: red }');
console.log(csso.translate(ast));
// > .test{color:red}
The same as translate()
but also generates source map (nodes should contain positions in info
property).
var ast = csso.parse('.test { color: red }', {
filename: 'my.css',
positions: true
});
console.log(csso.translateWithSourceMap(ast));
// { css: '.test{color:red}', map: SourceMapGenerator {} }
Visit all nodes of AST and call handler for each one. handler
receives three arguments:
prev
and next
nodes in listremove()
or insert()
Context for handler an object, that contains references to some parent nodes:
ast
or root nodeStyleSheet
node, it may be a top-level or at-rule block stylesheetAtruleExpression
node if current node inside at-rule expressionRuleset
node if current node inside a rulesetSelector
node if current node inside a selectorDeclaration
node if current node inside a declarationFunction
or FunctionalPseudo
node if current node inside one of them// collect all urls in declarations
var csso = require('./lib/index.js');
var urls = [];
var ast = csso.parse(`
@import url(import.css);
.foo { background: url('foo.jpg'); }
.bar { background-image: url(bar.png); }
`);
csso.walk(ast, function(node) {
if (this.declaration !== null && node.type === 'Url') {
var value = node.value;
if (value.type === 'Raw') {
urls.push(value.value);
} else {
urls.push(value.value.substr(1, value.value.length - 2));
}
}
});
console.log(urls);
// [ 'foo.jpg', 'bar.png' ]
Same as walk()
but visits Ruleset
and Atrule
nodes only.
Same as walkRules()
but visits nodes in reverse order (from last to first).
MIT


--- layout: null title: Coronavirus Update (Live) - Novel COVID description: Coronavirus Update (Live) - track the COVID-19 World Status. image: "/assets/sanstatus-covid-19.jpg" permalink: /covid/ ---
| Country | Cases | Today Cases | Deaths | Today Deaths | Recovered | Active | Critical | Cases Per One Million |
|---|
Stay at Home - Wash your Hands with Soap - Have a Healthy Life