ruby-****@sourc*****
ruby-****@sourc*****
2009年 2月 1日 (日) 20:37:42 JST
------------------------- REMOTE_ADDR = 83.237.44.220 REMOTE_HOST = URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?Gtk%3A%3AWindow ------------------------- @@ -1,755 +1,1194 @@ -= module Gtk += class Gtk::Window -Gtk module includes methods as Library initialization, main event loop, events, and standard constants. +Toplevel which can contain other widgets. -Like all GUI toolkits, Ruby/GTK uses an event-driven programming model. -When the user is doing nothing, Ruby/GTK sits in the main loop and waits for input. -If the user performs some action - say, a mouse click - then the main loop "wakes up" and delivers an event to Ruby/GTK. -Ruby/GTK forwards the event to one or more widgets. +== Object Hierarchy -When widgets receive an event, they frequently emit one or more signals. -Signals notify your program that "something interesting happened" by invoking blocks you've connected to the signal with GLib::Instantiatable#signal_connect. -Blocks connected to a signal are often termed callbacks. +* Object + * GLib::Instantiatable + * GLib::Object + * GLib::InitiallyUnowned + * Gtk::Object + * Gtk::Widget + * Gtk::Container + * Gtk::Bin + * Gtk::Window -When your callbacks are invoked, you would typically take some action - for example, when an Open button is clicked you might display a Gtk::FileChooserDialog. -After a callback finishes, Ruby/GTK will return to the main loop and await more user input. +== Class Methods -== Module Functions +--- Gtk::Window.new(type = Gtk::Window::TOPLEVEL) ---- Gtk.set_locale + Creates a new Gtk::Window, which is a toplevel window that can contain other widgets. Nearly always, the type of the window should be Gtk::Window::TOPLEVEL(So, you should omit the argument as "Gtk::Window.new"). If you're implementing something like a popup menu from scratch (which is a bad idea, just use Gtk::Menu), 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#decorated=, don't use Gtk::Window::POPUP. + * type: type of window. (Gtk::Window#Type). + * Returns: a new Gtk::Window. - Initializes internationalization support for GTK+. Gtk.init automatically does this, so there is typically no point in calling this function. - If you are calling this function because you changed the locale after GTK+ is was initialized, then calling this function may help a bit. (Note, however, that changing the locale after GTK+ is initialized may produce inconsistent results and is not really supported.) - In detail - sets the current locale according to the program environment. This is the same as calling the C library function setlocale (LC_ALL, "") but also takes care of the locale specific setup of the windowing system used by GDK. - ((* Note *)): Ruby-GNOME2 may not support this in the future, because setlocale doesn't match Ruby. - * Returns: a string corresponding to the locale set, typically in the form lang_COUNTRY, where lang is an ISO-639 language code, and COUNTRY is an ISO-3166 country code. On Unix, this form matches the result of the setlocale(); it is also used on other machines, such as Windows, where the C library returns a different result. The string is owned by GTK+ and should not be modified or freed. +--- Gtk::Window.new(title) ---- Gtk.disable_setlocale + Creates a new Gtk::Window with the title. + * title: a title of the window. + * Returns: a new Gtk::Window. - Prevents Gtk.init from automatically calling setlocale(LC_ALL, ""). You would want to use this function if you wanted to set the locale for your program to something other than the user's locale, or if you wanted to set different values for different locale categories. Most programs should not need to call this function. - ((* Note *)): Ruby-GNOME2 may not support this in the future, because setlocale doesn't match Ruby. - * Returns: nil +--- Gtk::Window.toplevels ---- Gtk.default_language + Returns an array of all existing toplevel windows. + * Returns: an array of Gtk::Widget(Gtk::Window). - Returns the Pango::Language for the default language currently in effect. (Note that this can change over the life of an application.) The default language is derived from the current locale. It determines, for example, whether GTK+ uses the right-to-left or left-to-right text direction. See _gtk_get_lc_ctype() for notes on behaviour on Windows. - * Returns: the default language as a Pango::Language +--- Gtk::Window.default_icon_list ---- Gtk.init(argv = ARGV) + Gets the value set by Gtk::Window.default_icon_list=. + * Returns : copy of default icon list - ((* Note *)) Since Ruby-GNOME2-0.15.0, this is included in gtk2.rb, so you don't need call this by yourself. If you want to call this by yourself, requre gtk2/base.rb instead of gtk2.rb. +--- Gtk::Window.default_icon_list=(icon_list) + + Sets an icon list to be used as fallback for windows that haven't had Gtk::Window#icon_list= called on them to set up a window-specific icon list. This method allows you to set up the icon for all windows in your app at once. + See Gtk::Window#icon_list= for more details. + * icon_list: an array of Gdk::Pixbuf + * Returns: icon_list + +--- Gtk::Window.set_default_icon_list(icon_list) + + Same as Gtk::Window.default_icon_list=. + * icon_list: an Array of Gdk::Pixbuf + * Returns: self + +--- Gtk::Window.set_default_icon(filename) + + Sets an icon to be used as fallback for windows that haven't had Gtk::Window#icon_list= called on them from a file on disk. Raise an Exception when the filename is wrong. ((* Since 2.2 *)) + * filename: icon file name + * Returns: self + +--- Gtk::Window.set_default_icon(icon) + + Sets an icon to be used as fallback for windows that haven't had Gtk::Window#icon= called on them from a pixbuf. ((* Since 2.4 *)) + * icon: the Gdk::Pixbuf + * Returns: self + +--- Gtk::Window.set_default_icon_name(name) + + Sets an icon to be used as fallback for windows that haven't had Gtk::Window#icon_list= called on them from a named themed icon, see Gtk::Window#icon_name=. ((* Since 2.6 *)) + * name: the name of the themed icon + * Returns: self + +--- Gtk::Window.auto_startup_notification=(setting) + + By default, after showing the first Gtk::Window for each Gdk::Screen, GTK+ calls gdk_screen_notify_startup_complete(). Call this method 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. ((* Since 2.2 *)) - Call this function before using any other GTK+ functions in your GUI applications. It will initialize everything needed to operate the toolkit and parses some standard command line options. - argv are adjusted accordingly so your own code will never see those standard arguments. - - Note: - This function will throw RuntimeError if it was unable to initialize the GUI for some reason. - * argv: the ARGV value. Any parameters understood by Gtk.init are stripped before return. + 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. + * setting: true to automatically do startup notification + * Returns: setting + +--- Gtk::Window.set_auto_startup_notification(setting) + + Same as Gtk::Window.auto_startup_notification=. ((* Since 2.2 *)) + * setting: true to automatically do startup notification * Returns: self ---- Gtk.events_pending? +--- Gtk::Window.default_icon= - Checks if any events are pending. This can be used to update the GUI and invoke timeouts etc. while doing some time intensive computation. + * Returns: self: ((*FIXME*)) - while (Gtk.events_pending?) - Gtk.main_iteration - end +--- Gtk::Window.default_icon_name= - * Returns: true if any events are pending, false otherwise. + * Returns: self: ((*FIXME*)) ---- Gtk.main +== Instance Methods - Runs the main loop until Gtk.main_quit is called. You can nest calls to Gtk.main. - In that case Gtk.main_quit will make the innermost invocation of the main loop return. - * Returns: nil +--- title ---- Gtk.main_level + Gets the title of the Gtk::Window. + * Returns: title - Asks for the current nesting level of the main loop. This can be useful when calling Gtk.quit_add. - * Returns: the nesting level of the current invocation of the main loop. +--- title=(title) ---- Gtk.main_quit + Sets the title of the Gtk::Window. 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. + * title: title of the window + * Returns: title - Makes the innermost invocation of the main loop return when it regains control. - * Returns: nil +--- set_title(title) ---- Gtk.main_iteration + Same as Gtk::Window#title=. + * title: title of the window + * Returns: self - Runs a single iteration of the mainloop. If no events are waiting to be processed GTK+ will block until the next event is noticed. If you don't want to block look****@Gtk*****_iteration_do or check if any events are pending with Gtk.events_pending? first. - * Returns: true if Gtk.main_quit has been called for the innermost mainloop. +--- type ---- Gtk.main_iteration_do(blocking) + Gets the type of the window. + * Returns: The type of the window (Gtk::Window#Type) - Runs a single iteration of the mainloop. If no events are available either return or block dependent on the value of blocking. - * blocking: true if you want GTK+ to block if no events are pending. - * Returns: true if Gtk.main_quit has been called for the innermost mainloop. +--- type=(type) ---- Gtk.main_do_event(event) + Sets the type of the window. + * type: The type of the window (Gtk::Window#Type) + * Returns: type - Processes a single GDK event. This is public only to allow filtering of events between GDK and GTK+. You will not usually need to call this function directly. - While you should not call this function directly, you might want to know how exactly events are handled. So here is what this function does with the event: - (1) Compress enter/leave notify events. If the event passed build an enter/leave pair together with the next event (peeked from GDK) both events are thrown away. This is to avoid a backlog of (de-)highlighting widgets crossed by the pointer. - (2) Find the widget which got the event. If the widget can't be determined the event is thrown away unless it belongs to a INCR transaction. In that case it is passed to gtk_selection_incr_event() (GTK+ inner function). - (3) Then the event is passed on a stack so you can query the currently handled event with Gtk.current_event. - - (4) The event is sent to a widget. If a grab is active all events for widgets that are not in the contained in the grab widget are sent to the latter with a few exceptions: - * Deletion and destruction events are still sent to the event widget for obvious reasons. - * Events which directly relate to the visual representation of the event widget. - * Leave events are delivered to the event widget if there was an enter event delivered to it before without the paired leave event. - * Drag events are not redirected because it is unclear what the semantics of that would be. - Another point of interest might be that all key events are first passed through the key snooper functions if there are any. Read the description of Gtk.key_snooper_install if you need this feature. - (5) After finishing the delivery the event is popped from the event stack. - * event: An Gdk::Event to process (normally) passed by GDK. +--- set_type(type) ---- Gtk.current_event + Same as Gtk::Window#type=. + * type: The type of the window (Gtk::Window#Type) + * Returns: self - Obtains a copy of the event currently being processed by GTK+. For example, if you get a "clicked" signal from Gtk::Button, the current event will be the Gdk::EventButton that triggered the "clicked" signal. If there is no current event, the function returns nil. - * Returns: a copy of the current event, or nil if no current event. +--- set_wmclass(wmclass_name, wmclass_class) ---- Gtk.grab_add(widget) + Don't use this method. 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 method is sort of pointless. However, you may want to call Gtk::Window#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. + * wmclass_name: window name hint + * wmclass_class: window class hint + * Returns: self - Makes widget the current grabbed widget. This means that interaction with other widgets in the same application is blocked and mouse as well as keyboard events are delivered to this widget. - * widget: The widget that grabs keyboard and pointer events. - * Returns: nil +--- resizable? ---- Gtk.current + Gets the value set by Gtk::Window#resizable=. + * Returns : true if the user can resize the window - Queries the current grab. - * Returns: The widget which currently has the grab or nil if no grab is active. +--- resizable=(resizable) ---- Gtk.grab_remove(widget) + Sets whether the user can resize a window. Windows are user resizable by default. + * resizable: true if the user can resize this window + * Returns: resizable - Removes the grab from the given widget. You have to pair calls to Gtk.grab_add and Gtk.grab_remove. - * widget : The widget which gives up the grab. - * Returns: nil +--- set_resizable(resizable) ---- Gtk.init_add { ... } + Same as Gtk::Window#resizable=. + * resizable: true if the user can resize this window + * Returns: self - Registers a block to be called when the mainloop is started. - * { ... }: A block to invoke when Gtk.main is called next. - * Returns: nil +--- add_accel_group(accel_group) ---- Gtk.quit_add(main_level) { ... } + Associate accel_group with window, such that calling Gtk::AccelGroup.activate on window will activate accelerators in accel_group. + * accel_group : a Gtk::AccelGroup + * Returns: self - Registers a block to be called when an instance of the mainloop is left. - * main_level: Level at which termination the block shall be called. You can pass 0 here to have the block run at the termination of the current mainloop. - * { ... } : A block to call. This should return true to be removed from the list of quit handlers. Otherwise the block might be called again. - * Returns : A handle ID for this quit handler (you need this for Gtk.quit_remove). +--- remove_accel_group(accel_group) ---- Gtk.quit_remove(handler_id) + Reverses the effects of Gtk::Window#add_accel_group. + * accel_group : a Gtk::AccelGroup - Removes a quit handler by its identifier. - * handler_id: Identifier for the handler returned when installing it. - * Returns: handler_id +--- active_focus ---- Gtk.timeout_add(interval){ ... } + Deprecated. Use Gtk::Window#activate_focus instead. - ((* Deprecated. *)) Use GLib::Timeout#add instead. - Sets a block to be called at regular intervals, with the default priority, GLib::PRIORITY_DEFAULT. The block is called repeatedly until it returns false, at which point the timeout is automatically destroyed and the block will not be called again. The first call to the block will be at the end of the first interval. - Note that timeout blocks may be delayed, due to the processing of other event sources. Thus they should not be relied on for precise timing. After each call to the timeout block, the time of the next timeout is recalculated based on the current time and the given interval (it does not try to 'catch up' time lost in delays). - * interval: the time between calls to the block, in milliseconds (1/1000ths of a second) - * { ... }: A block to call - * Returns: the timeout_handler_id of event source. +--- activate_focus ---- Gtk.timeout_remove(timeout_handler_id) + Activates the current focused widget within the window. + * Returns: true if a widget got activated. - Removes the given timeout destroying all information about it. - * timeout_handler_id: The identifier returned when installing the timeout. - * Returns: nil +--- active_default ---- Gtk.idle_add { ... } + Deprecated. Use Gtk::Window#activate_default instead. - ((* Deprecated. *)) Use GLib::Idle#add instead. - Causes the mainloop to call the given block whenever no events with higher priority are to be processed. The default priority is GLib::PRIORITY_DEFAULT, which is rather low. - * { ... }: The block to call. - * Returns: a unique handle for this registration. +--- activate_default ---- Gtk.idle_add_priority(priority) { ... } + Activates the default widget for the window, unless the current focused widget has been configured to receive the default action(See Gtk::Widget::RECEIVES_DEFAULT in ((<GtkWidgetFlags|Gtk::Widget#GtkWidgetFlags>)). + * Returns: true if a widget got activated. - Like Gtk.idle_add this function allows you to have a block called when the event loop is idle. The difference is that you can give a priority different from GLib::PRIORITY_DEFAULT to the idle block. - * priority: The priority which should not be above GLib::PRIORITY_HIGH_IDLE. Note that you will interfere with GTK+ if you use a priority above Gtk::PRIORITY_RESIZE. +--- modal? ---- Gtk.idle_remove(idle_handler_id) + Returns whether the window is modal. See Gtk::Window#modal=. + * Returns: true if the window is set to be modal and establishes a grab when shown - Removes the idle block with the given id. - * idle_handler_id: Identifies the idle block to remove. - * Returns: nil +--- modal=(modal) ---- Gtk.key_snooper_install {|grab_widget, event| ... } + 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#transient_for= to make the dialog transient for the parent; most window managers will then disallow lowering the dialog below the parent. + * modal: true if the window is modal. + * Returns: modal - Installs a key snooper block, which will get called on all key events before delivering them normally. - * {|grab_widget, event| ... }: a key snooper block which called before normal event delivery. They can be used to implement custom key event handling. - * grab_widget: the widget to which the event will be delivered. - * event: the key event(Gdk::EventKey). - * Returns: true to stop further processing of event, false to continue. - * Returns: a unique id for this key snooper for use with Gtk.key_snooper_remove. +--- set_modal(modal) ---- Gtk.key_snooper_remove(handler_id) + Same as Gtk::Window#modal=. + * modal: true if the window is modal. + * Returns: self - Removes the key snooper block with the given id. - * handler_id: Identifies the key snooper to remove +--- default_size ---- Gtk.current_event_time + Gets the value set by Gtk::Window#set_default_size. + * Returns : [width, height] - If there is a current event and it has a timestamp, return that timestamp, otherwise return Gdk::Event::CURRENT_TIME. - * Returns: the timestamp from the current event, or Gdk::Event::CURRENT_TIME. +--- set_default_size(width, height) ---- Gtk.current_event_state + 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 method 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 method. 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. + * width: width in pixels, or -1 to unset the default width + * height: height in pixels, or -1 to unset the default height + * Returns: self - If there is a current event and it has a state field, return the state, otherwise return nil. - * Returns: the state of the current event(((<GdkModifierType|Gdk::Window::GdkModifierType>))) or nil. +--- set_geometry_hints(geometry_widget, geometry, geom_mask) ---- Gtk.get_event_widget(event = nil) + This method 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 Gdk::Geometry. + * geometry_widget: widget the geometry hints will be applied to + * geometry: a Gdk::Geometry value + * geom_mask: mask indicating which constants should be paid attention to (((<GdkWindowHints|Gdk::Window#GdkWindowHints>))) + * Returns: self - If event is nil or the event was not associated with any widget, returns nil, otherwise returns the widget that received the event originally. - * event: a Gdk::Event - * Returns: the widget that originally received event, or nil +--- gravity ---- Gtk.propagate_event(widget, event) + Gets the value set by Gtk::Window#gravity=. + * Returns: window gravity - Sends an event to a widget, propagating the event to parent widgets if the event remains unhandled. Events received by GTK+ from GDK normally begin in Gtk.main_do_event. Depending on the type of event, existence of modal dialogs, grabs, etc., the event may be propagated; if so, this function is used. Gtk.propagate_event calls Gtk::Widget#event on each widget it decides to send the event to. So Gtk::Widget#event is the lowest-level function; it simply emits the "event" and possibly an event-specific signal on a widget. Gtk.propagate_event is a bit higher-level, and Gtk.main_do_event is the highest level. - All that said, you most likely don't want to use any of these functions; synthesizing events is rarely needed. Consider asking on the mailing list for better ways to achieve your goals. For example, use Gdk::Window#invalidate or Gtk::Widget#queue_draw instead of making up expose events. - * widget: a Gtk::Widget - * event: an Gdk::Event +--- gravity=(gravity) ---- Gtk.check_version(required_major, required_minor, required_micro) + Window gravity defines the meaning of coordinates passed to Gtk::Window#move. See Gtk::Window#move and ((<GdkGravity|Gdk::Window#GdkGravity>)) for more details. + The default window gravity is Gdk::Window#GRAVITY_NORTH_WEST which will typically "do what you mean." + * gravity: window gravity(((<GdkGravity|Gdk::Window#GdkGravity>))) + * Returns: gravity= - Checks that the GTK+ library in use is compatible with the given version. Generally you would pass in the constants Gtk::MAJOR_VERSION, Gtk::MINOR_VERSION, Gtk::MICRO_VERSION as the three arguments to this function; that produces a check that the library in use is compatible with the version of GTK+ the application or module was compiled against. - Compatibility is defined by two things: first the version of the running library is newer than the version required_major.required_minor.required_micro. Second the running library must be binary compatible with the version required_major.required_minor.required_micro (same major version.) - This function is primarily for GTK+ modules; the module can call this function to check that it wasn't loaded into an incompatible version of GTK+. However, such a a check isn't completely reliable, since the module may be linked against an old version of GTK+ and calling the old version of Gtk.check_version, but still get loaded into an application using a newer version of GTK+. - * required_major: the required major version. - * required_minor: the required minor version. - * required_micro: the required micro version. - * Returns: nil if the GTK+ library is compatible with the given version, or a string describing the version mismatch. +--- set_gravity(gravity) ---- Gtk.check_version?(required_major, required_minor, required_micro) + Same as Gtk::Window#gravity=. + * gravity: window gravity(((<GdkGravity|Gdk::Window#GdkGravity>))) + * Returns: self - Same as Gtk.check_version, but returns true if the library is compatible with the given version, otherwise false. - * required_major: the required major version. - * required_minor: the required minor version. - * required_micro: the required micro version. - * Returns: true if the library is compatible with the given version, otherwise false. +--- window_position -== Constants + Gets the value set by Gtk::Window#window_position=. + * Returns: window position (Gtk::Window#Position) -=== GtkAccelFlags +--- window_position=(position) ---- ACCEL_VISIBLE + Sets a position constraint for this window. If the old or new constraint is Gtk::Window::POS_CENTER_ALWAYS, this will also cause the window to be repositioned to satisfy the new constraint. + * position: a position constraint. (Gtk::Window#Position) + * Returns: position - = 1 << 0 +--- set_window_position(position) ---- ACCEL_LOCKED + Same as Gtk::Window#window_position=. + * position: a position constraint. (Gtk::Window#Position) + * Returns: self - = 1 << 1 +--- transient_for ---- ACCEL_MASK + Fetches the transient parent for this window. See Gtk::Window#transient_for=. + * Returns: the transient parent for this window, or nil if no transient parent has been set. - = 0x07 +--- transient_for=(parent) -=== GtkAnchorType + 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 and other convenience method in GTK+ will sometimes call Gtk::Window#transient_for= on your behalf. + On Windows, this method will and put the child window on top of the parent, much as the window manager would have done on X. + * parent: parent Gtk::Window + * Returns: parent ---- ANCHOR_CENTER ---- ANCHOR_NORTH ---- ANCHOR_NORTH_WEST ---- ANCHOR_NORTH_EAST ---- ANCHOR_SOUTH ---- ANCHOR_SOUTH_WEST ---- ANCHOR_SOUTH_EAST ---- ANCHOR_WEST ---- ANCHOR_EAST ---- ANCHOR_N +--- set_transient_for(parent) - = ANCHOR_NORTH + Same as Gtk::Window#transient_for=. + * parent: parent Gtk::Window + * Returns: self ---- ANCHOR_NW +--- destroy_with_parent? - = ANCHOR_NORTH_WEST + Returns whether the window will be destroyed with its transient parent. See Gtk::Window#destroy_with_parent=. + * Returns: true if the window will be destroyed with its transient parent. ---- ANCHOR_NE +--- destroy_with_parent=(setting) - = ANCHOR_NORTH_EAST + 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. + * setting : true if the window is destroyed window with its transient parent + * Returns: setting ---- ANCHOR_S +--- set_destroy_with_parent(setting) - = ANCHOR_SOUTH + Same as Gtk::Window#destroy_with_parent=. + * setting : true if the window will be destroyed with its transient parent. + * Returns: self ---- ANCHOR_SW +--- screen - = ANCHOR_SOUTH_WEST + Gets the Gdk::Screen where this window will be displayed. ((* Since 2.2 *)) + * Returns: The Gdk::Screen where this window will be displayed ---- ANCHOR_SE +--- screen=(screen) - = ANCHOR_SOUTH_EAST + Sets the Gdk::Screen where this window will be displayed. ((* Since 2.2 *)) + * screen: The screen where this window will be displayed + * Returns: screen ---- ANCHOR_W +--- set_screen(screen) - = ANCHOR_WEST + Same as Gtk::Window#screen=. ((* Since 2.2 *)) + * screen: The Gdk::Screen where this window will be displayed + * Returns: self ---- ANCHOR_E +--- active? - = ANCHOR_EAST + 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 Gtk::Plug embedded in the active toplevel. You might use this method 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 *)) + * Returns : true if the window part of the current active window. -=== GtkAttachOptions +--- has_toplevel_focus? -Denotes the expansion properties that a widget will have when it (or it's parent) is resized. + Returns whether the input focus is within this Gtk::Window. For real toplevel windows, this is identical to Gtk::Window#active?, but for embedded windows, like Gtk::Plug, the results will differ. ((* Since 2.4 *)) + * Returns: true if the input focus is within this Gtk::Window ---- EXPAND +--- add_mnemonic(keyval, target) - = 1 << 0. The widget should expand to take up any extra space in its container that has been allocated. + Adds a mnemonic to this window. + * keyval: the mnemonic (Integer) + * target: the Gtk::Widget that gets activated by the mnemonic + * Returns: self ---- SHRINK +--- remove_mnemonic(keyval, target) - = 1 << 1. The widget should shrink as and when possible. + Removes a mnemonic from this window. + * keyval: the mnemonic (Integer) + * target : the Gtk::Widget that gets activated by the mnemonic + * Returns: self ---- FILL +--- mnemonic_activate(keyval, modifier) - = 1 << 2. The widget should fill the space allocated to it. + Activates the targets associated with the mnemonic. + * keyval: the mnemonic (Integer) + * modifier: the modifiers(((<GdkModifierType|Gdk::Window#GdkModifierType>))) + * Returns: true if the activation is done. -=== GtkCornerType +--- focus -Specifies which corner a child widget should be placed in when packed into a Gtk::ScrolledWindow. This is effectively the opposite of where the scroll bars are placed. + 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? will not be true for the widget. + * Returns : the currently focused widget. ---- CORNER_TOP_LEFT +--- focus=(focus) - Place the scrollbars on the right and bottom of the widget (default behaviour). + If focus is not the current focus widget, and is focusable, sets it as the focus widget for the window. If focus is nil, 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 method. + * focus: Gtk::Widget to be the new focus widget, or nil to unset any focus widget for the toplevel window. + * Returns: focus ---- CORNER_BOTTOM_LEFT +--- set_focus(focus) - Place the scrollbars on the top and right of the widget. + Same as Gtk::Window#focus=. + * focus: Gtk::Widget to be the new focus widget, or nil to unset any focus widget for the toplevel window. + * Returns: self ---- CORNER_TOP_RIGHT +--- default=(default_widget) - Place the scrollbars on the left and bottom of the widget. + The default widget is the widget that's activated when the user presses Enter in a dialog (for example). This method sets or unsets the default widget for a Gtk::Window about. When setting (rather than unsetting) the default widget it's generally easier to call Gtk::Widget#grab_focus on the widget. Before making a widget the default widget, you must set the Gtk::Widget::CAN_DEFAULT flag on the widget you'd like to make the default using Gtk::Widget#flags=. + * default_widget : widget to be the default, or nil to unset the default widget for the toplevel. + * Returns: default_widget ---- CORNER_BOTTOM_RIGHT +--- set_default(default_widget) - Place the scrollbars on the top and left of the widget. + Same as Gtk::Window#default=. + * default_widget: widget to be the default, or nil to unset the default widget for the toplevel. + * Returns: self -=== GtkDeleteType +--- present(timestamp = nil) ---- DELETE_CHARS ---- DELETE_WORD_ENDS + 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 method calls Gtk::Widget#show as well. + This method 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. + * timestamp: ((*Since 2.8*)) the timestamp of the user interaction (typically a button or key press event) which triggered this call + * Returns: self - delete only the portion of the word to the left/right of cursor if we're in the middle of a word. +--- iconify ---- DELETE_WORDS ---- DELETE_DISPLAY_LINES ---- DELETE_DISPLAY_LINE_ENDS ---- DELETE_PARAGRAPH_ENDS + 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 method 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 Gtk::Widget. + * Returns: self - like C-k in Emacs (or its reverse) +--- deiconify ---- DELETE_PARAGRAPHS + 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 Gtk::Widget. + * Returns: self - C-k in pico, kill whole line +--- stick ---- DELETE_WHITESPACE + 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 method before showing a window. + You can track stickiness via the "window_state_event" signal on Gtk::Widget. + * Returns: self - M-\ in Emacs +--- unstick -=== GtkDirectionType + 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 Gtk::Widget. + * Returns: self ---- DIR_TAB_FORWARD ---- DIR_TAB_BACKWARD ---- DIR_UP ---- DIR_DOWN ---- DIR_LEFT ---- DIR_RIGHT -=== GtkExpanderStyle +--- maximize -Used to specify the style of the expanders drawn by a Gtk::TreeView. + 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 method 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 Gtk::Widget. + * Returns: self ---- EXPANDER_COLLAPSED +--- unmaximize - The style used for a collapsed subtree. + 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 Gtk::Widget. + * Returns: self ---- EXPANDER_SEMI_COLLAPSED +--- fullscreen - Intermediate style used during animation. + 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 Gtk::Widget. ((* Since 2.2 *)) + * Returns: self ---- EXPANDER_SEMI_EXPANDED +--- unfullscreen - Intermediate style used during animation. + 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 Gtk::Widget. + * Returns: self ---- EXPANDER_EXPANDED +--- keep_above=(setting) - The style used for an expanded subtree. + 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 method 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 Gtk::Widget. + + Note that, according to the ((<Extended Window Manager Hints|URL:http://www.freedesktop.org/Standards/wm-spec>)) 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 *)) + * setting: true if to keep window above other windows, otherwise false + * Returns: setting -=== GtkIMPreeditStyle +--- set_keep_above(setting) ---- IM_PREEDIT_NOTHING ---- IM_PREEDIT_CALLBACK -=== GtkIMStatusStyle + Same as Gtk::Window#keep_above=. ((* Since 2.4 *)) + * setting: true if to keep window above other windows, otherwise false + * Returns: self ---- IM_STATUS_NOTHING ---- IM_STATUS_CALLBACK -=== GtkJustification +--- keep_below=(setting) -Used for justifying the text inside a Gtk::Label widget. (See also Gtk::Alignment). + 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 method 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|URL:http://www.freedesktop.org/Standards/wm-spec>)) 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 *)) + * setting: true if to keep window below other windows, otherwise false + * Returns: setting ---- JUSTIFY_LEFT +--- set_keep_below(setting) - The text is placed at the left edge of the label. + Same as Gtk::Window#keep_below=. ((* Since 2.4 *)) + * setting: true if to keep window below other windows, otherwise false + * Returns: self ---- JUSTIFY_RIGHT +--- begin_resize_drag(edge, button, root_x, root_y, timestamp) - The text is placed at the right edge of the label. + Starts resizing a window. This method 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. + * edge: position of the resize control(((<GdkWindowEdge|Gdk::Window#GdkWindowEdge>))) + * button: mouse button that initiated the drag(Integer) + * root_x: X position where the user clicked to initiate the drag, in root window coordinates (Integer) + * root_y: Y position where the user clicked to initiate the drag (Integer) + * timestamp: timestamp from the click event that initiated the drag (Integer) + * Returns: self ---- JUSTIFY_CENTER +--- begin_move_drag(edge, button, root_x, root_y, timestamp) - The text is placed in the center of the label. + Starts moving a window. This method is used if an application has window movement 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 movement, potentially not all that well, depending on the windowing system. + * edge: position of the resize control(((<GdkWindowEdge|Gdk::Window#GdkWindowEdge>))) + * button: mouse button that initiated the drag(Integer) + * root_x: X position where the user clicked to initiate the drag, in root window coordinates (Integer) + * root_y: Y position where the user clicked to initiate the drag (Integer) + * timestamp: timestamp from the click event that initiated the drag (Integer) + * Returns: self ---- JUSTIFY_FILL +--- decorated? - The text is placed is distributed across the label. + Returns whether the window has been set to have decorations such as a title bar via Gtk::Window#decorated=. + * Returns: true if the window has been set to have decorations -=== GtkMetricType +--- decorated=(setting) -Used to indicate which metric is used by a Gtk::Ruler. + 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 method, GTK+ will do its best to convince the window manager not to decorate the window. + On Windows, this method always works, since there's no window manager policy involved. + * setting: true to decorate the window + * Returns: setting ---- PIXELS ---- INCHES ---- CENTIMETERS -=== GtkMovementStep +--- set_decorated(setting) ---- MOVEMENT_LOGICAL_POSITIONS + Same as Gtk::Window#decorated=. + * setting: true to decorate the window + * Returns: self - move by forward/back graphemes +--- frame_dimensions ---- MOVEMENT_VISUAL_POSITIONS + (((*Note: this is a special-purpose method intended for the framebuffer port; see Gtk::Window#has_frame=. It will not return the size of the window border drawn by the window manager, which is the normal case when using a windowing system. See Gdk::Window#frame_extents to get the standard window border extents.*))) + Retrieves the dimensions of the frame window for this toplevel. See Gtk::Window#has_frame?, Gtk::Window#set_frame_dimensions. + * Returns: [left, top, right, bottom] + * left: location to store the width of the frame at the left, or nil + * top: location to store the height of the frame at the top, or nil + * right: location to store the width of the frame at the returns, or nil + * bottom: location to store the height of the frame at the bottom, or nil - move by left/right graphemes +--- set_frame_dimensions(left, top, right, bottom) ---- MOVEMENT_WORDS + (((*Note: this is a special-purpose method intended for the framebuffer port; see Gtk::Window#has_frame?. It will have no effect on the window border drawn by the window manager, which is the normal case when using the X Window system.*))) + For windows with frames (see Gtk::Window#has_frame?) this method can be used to change the size of the frame border. + * left: The width of the left border(Integer) + * top: The height of the top border(Integer) + * right: The width of the right border(Integer) + * bottom: The height of the bottom border(Integer) + * Returns: self - move by forward/back words +--- has_frame? ---- MOVEMENT_DISPLAY_LINES + Accessor for whether the window has a frame window exterior to Gtk::Window#window.window. Gets the value set by Gtk::Window#has_frame=. + * Returns: true if a frame has been added to the window via Gtk::Window#has_frame=. - move up/down lines (wrapped lines) +--- has_frame= ---- MOVEMENT_DISPLAY_LINE_ENDS + (((*Note: this is a special-purpose method for the framebuffer port, that causes GTK+ to draw its own window border. For most applications, you want Gtk::Window#decorated= instead, which tells the window manager whether to draw the window border.*))) + If this method is called on a window with setting of true, before it is realized or showed, it will have a "frame" window around Gtk::Window.window, accessible in Gtk::Window.frame. Using the signal frame_event you can recieve all events targeted at the frame. + This method is used by the linux-fb port to implement managed windows, but it could concievably be used by X-programs that want to do their own window decorations. + * setting: true or false + * Returns: setting - move up/down lines (wrapped lines) +--- set_has_frame(setting) ---- MOVEMENT_PARAGRAPHS + Same as Gtk::Window#setting=. + * setting: true or false + * Returns: self - move up/down paragraphs (newline-ended lines) +--- mnemonic_modifier ---- MOVEMENT_PARAGRAPH_ENDS + Returns the mnemonic modifier for this window. See Gtk::Window#mnemonic_modifier=. + * Returns: the modifier mask used to activate mnemonics on this window. - move to either end of a paragraph +--- mnemonic_modifier=(modifier) ---- MOVEMENT_PAGES + Sets the mnemonic modifier for this window. + * modifier: the modifier mask(((<GdkModifierType|Gdk::Window#GdkModifierType>))) used to activate mnemonics on this window + * Returns: modifier - move by pages +--- set_mnemonic_modifier(modifier) ---- MOVEMENT_BUFFER_ENDS + Same as Gtk::Window#mnemonic_modifier=. + * modifier: the modifier mask(((<GdkModifierType|Gdk::Window#GdkModifierType>))) used to activate mnemonics on this window + * Returns: self - move to ends of the buffer +--- role ---- MOVEMENT_HORIZONTAL_PAGES + Returns the role of the window. See Gtk::Window#role= for further explanation. + * Returns : the role of the window if set, or nil. The returned is owned by the widget. - move horizontally by pages +--- role=(role) -=== Orientation + This method 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. + * role: unique identifier for the window to be used when restoring a session(String) + * Returns: role -Represents the orientation of widgets which can be switched between horizontal and vertical orientation on the fly, like Gtk::Toolbar. +--- set_role(role) ---- ORIENTATION_HORIZONTAL + Same as Gtk::Window#role=. + * role: unique identifier for the window to be used when restoring a session(String) + * Returns: self - The widget is in horizontal orientation. +--- type_hint ---- ORIENTATION_VERTICAL + Gets the type hint for this window. See Gtk::Window#type_hint=. + * Returns: the type hint for window. - The widget is in vertical orientation. +--- type_hint=(hint) -=== PackType + 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 method should be called before the window becomes visible. + Gtk::Dialog.new and other convenience methods in GTK+ will sometimes call Gtk::Window#type_hint= on your behalf. + * hint: the window type (((<GdkWindowTypeHint|Gdk::Window#GdkWindowTypeHint>))) + * Returns: hint -Represents the packing location Gtk::Box children. (See: Gtk::VBox, Gtk::HBox, and Gtk::ButtonBox). +--- set_type_hint(hint) ---- PACK_START + Same as Gtk::Window#type_hint=. + * hint: the window type (((<GdkWindowTypeHint|Gdk::Window#GdkWindowTypeHint>))) + * Returns: self - The child is packed into the start of the box +--- skip_taskbar_hint? ---- PACK_END + Gets the value set by Gtk::Window#skip_taskbar_hint=. ((* Since 2.2 *)) + * Returns: true if window shouldn't be in taskbar - The child is packed into the end of the box +--- skip_taskbar_hint=(setting) -=== GtkPathPriorityType + Windows may set a hint asking the desktop environment not to display the window in the task bar. This method sets this hint. ((* Since 2.2 *)) + * setting: true to keep this window from appearing in the task bar + * Returns: setting ---- PATH_PRIO_LOWEST +--- set_skip_taskbar_hint(setting) - = 0 + Same as Gtk::Window#skip_taskbar_hint=. ((* Since 2.2 *)) + * setting: true to keep this window from appearing in the task bar + * Returns: self ---- PATH_PRIO_GTK +--- skip_pager_hint? - = 4 + Gets the value set by Gtk::Window#skip_pager_hint=. ((* Since 2.2 *)) + * Returns: true if window shouldn't be in pager ---- PATH_PRIO_APPLICATION +--- skip_pager_hint=(setting) - = 8 + Windows may set a hint asking the desktop environment not to display the window in the pager. This method 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 *)) + * setting: true to keep this window from appearing in the pager + * Returns: setting ---- PATH_PRIO_THEME +--- set_skip_pager_hint(setting) - = 10 + Same as Gtk::Window#skip_pager_hint=. ((* Since 2.2 *)) + * setting: true to keep this window from appearing in the pager + * Returns: self ---- PATH_PRIO_RC +--- urgency_hint - = 12 + Gets the value set by Gtk::Window#urgency_hint=. ((*Since 2.8*)) ---- PATH_PRIO_HIGHEST +--- urgency_hint=(hint) - = 15 + Windows may set a hint asking the desktop environment to draw the users attention to the window. This method sets this hint. ((*Since 2.8*)) + * hint: the hint (true or false) + * returns: hint -=== GtkPathType +--- set_urgency_hint(hint) ---- PATH_WIDGET ---- PATH_WIDGET_CLASS ---- PATH_CLASS -=== GtkPolicyType + Same as Gtk::Window#urgency_hint=. ((*Since 2.8*)) + * hint: the hint (true or false) + * returns: self -Determines when a scroll bar will be visible. +--- accept_focus? ---- POLICY_ALWAYS + Gets the value set by Gtk::Window#accept_focus=. ((* Since 2.4 *)) + * Returns: true if window should receive the input focus - The scrollbar is always visible. +--- accept_focus=(setting) ---- POLICY_AUTOMATIC + Windows may set a hint asking the desktop environment not to receive the input focus. This method sets this hint. ((* Since 2.4 *)) + * setting: true to let this window receive input focus + * Returns: setting - The scrollbar will appear and disappear as necessary. +--- set_accept_focus(accept_focus) ---- POLICY_NEVER + Same as Gtk::Window#accept_focus=. ((* Since 2.4 *)) + * setting: true to let this window receive input focus + * Returns: self - The scrollbar will never appear. +--- focus_on_map? -=== GtkPositionType + Gets the value set by Gtk::Window#focus_on_map=. ((* Since 2.6 *)) + * Returns: true if window should receive the input focus when mapped. -Describes which edge of a widget a certain feature is positioned at, e.g. the tabs of a Gtk::Notebook, the handle of a Gtk::HandleBox or the label of a Gtk::Scale. +--- focus_on_map=(setting) ---- POS_LEFT + Windows may set a hint asking the desktop environment not to receive the input focus when the window is mapped. This method sets this hint. ((* Since 2.6 *)) + * setting: true to let this window receive input focus on map + * Returns: setting - The feature is at the left edge. +--- set_focus_on_map(setting) ---- POS_RIGHT + Same as Gtk::Window#focus_on_map=. ((* Since 2.6 *)) + * setting: true to let this window receive input focus on map + * Returns: self - The feature is at the right edge. +--- icon ---- POS_TOP + Gets the value set by Gtk::Window#icon= (or if you've called Gtk::Window#icon_list=, gets the first icon in the icon list). + * Returns: icon for window(Gdk::Pixbuf) - The feature is at the top edge. +--- icon=(icon) ---- POS_BOTTOM + Sets up the icon representing a Gtk::Window. 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. + + 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#icon_list=. Then the best size will be used. + + This method is equivalent to calling Gtk::Window#icon_list= with a 1-element array. + + See also Gtk::Window.default_icon_list= to set the icon for all windows in your application in one go. + * icon: icon image(Gdk::Pixbuf) or nil, also you can set the filename(String) since 2.2 + * Returns: icon - The feature is at the bottom edge. +--- set_icon(icon) -=== GtkReliefStyle + Same as Gtk::Window#icon=. + * icon: icon image(Gdk::Pixbuf) or nil, also you can set the filename(String) since 2.2 + * Returns: icon -Indicated the relief to be drawn around a Gtk::Button. +--- icon_list ---- RELIEF_NORMAL + Retrieves the list of icons set by Gtk::Window#icon_list=. The list is copied, but the reference count on each member won't be incremented. + * Returns: copy of window's icon list - Draw a normal relief. +--- icon_list=(icon_list) ---- RELIEF_HALF + Sets up the icon representing a Gtk::Window. 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. + Gtk::Window#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.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#transient_for=) will inherit their icon from their transient parent. So there's no need to explicitly set the icon on transient windows. + * icon_list: an array of Gdk::Pixbuf + * Returns: icon_list - A half relief. +--- set_icon_list(icon_list) ---- RELIEF_NONE + Same as Gtk::Window#icon_list=. + * icon_list: an array of Gdk::Pixbuf + * Returns: self - No relief. +--- icon_name -=== ResizeMode + Returns the name of the themed icon for the window, see Gtk::Window#icon_name=. ((* Since 2.6 *)) + * Returns: the icon name or nil if the window has no themed icon ---- RESIZE_PARENT +--- icon_name=(name) - Pass resize request to the parent + Sets the icon for the window from a named themed icon. See the docs for Gtk::IconTheme for more details. + + Note that this has nothing to do with the WM_ICON_NAME property which is mentioned in the ICCCM. ((* Since 2.6 *)) + * name: the name of the themed icon + * Returns: name ---- RESIZE_QUEUE +--- set_icon_name(name) - Queue resizes on this widget + Same as Gtk::Window#icon_name=. ((* Since 2.6 *)) + * name: the name of the themed icon + * Returns: self ---- RESIZE_IMMEDIATE +--- position - Perform the resizes now + This method 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. + If you haven't changed the window gravity, its gravity will be Gdk::Window::GRAVITY_NORTH_WEST. This means that Gtk::Window#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. + Gtk::Window#position is not 100% reliable because the X Window System does not specify a way to obtain the geometry of the decorations placed on a window by the window manager. Thus GTK+ is using a "best guess" that works with most window managers. + Moreover, nearly all window managers are historically broken with respect to their handling of window gravity. So moving a window to its current position as returned by Gtk::Window#position tends to result in moving the window slightly. Window managers are slowly getting better over time. + If a window has gravity Gdk::Window::GRAVITY_STATIC the window manager frame is not relevant, and thus Gtk::Window#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. + If you are saving and restoring your application's window positions, you should know that it's impossible for applications to do this without getting it somewhat wrong because applications do not have sufficient knowledge of window manager state. The Correct Mechanism is to support the session management protocol (see the "Gnome::Client" object in the Ruby/GNOME libraries for example) and allow the window manager to save your window sizes and positions. + * Returns: [root_x, root_y] + * root_x: return location for X coordinate of gravity-determined reference point + * root_y: return location for Y coordinate of gravity-determined reference point -=== GtkScrollStep +--- size -((*Since 2.4*)) + Obtains the current size of window. If window is not onscreen, it returns 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). The size obtained by Gtk::Window#size is the last size received in a Gdk::EventConfigure, that is, GTK+ uses its locally-stored size, rather than querying the X server for the size. As a result, if you call Gtk::Window#resize then immediately call Gtk::Window#size, the size won't have taken effect yet. After the window manager processes the resize request, GTK+ receives notification that the size has changed via a configure event, and the size of the window gets updated. + + Note 1: Nearly any use of this method creates a race condition, because the size of the window may change between the time that you get the size and the time that you perform some action assuming that size is the current size. To avoid race conditions, connect to "configure_event" on the window and adjust your size-dependent state to match the size delivered in the Gdk::EventConfigure. + + Note 2: The returned size does not include the size of the window manager decorations (aka the window frame or border). Those are not drawn by GTK+ and GTK+ has no reliable method of determining their size. + + Note 3: If you are getting a window size in order to position the window onscreen, there may be a better way. The preferred way is to simply set the window's semantic type with Gtk::Window#type_hint=, which allows the window manager to e.g. center dialogs. Also, if you set the transient parent of dialogs with Gtk::Window#transient_for= window managers will often center the dialog over its parent window. It's much preferred to let the window manager handle these things rather than doing it yourself, because all apps will behave consistently and according to user prefs if the window manager handles it. Also, the window manager can take the size of the window decorations/border into account, while your application cannot. + + In any case, if you insist on application-specified window positioning, there's still a better way than doing it yourself - Gtk::Window#window_position= will frequently handle the details for you. + * Returns: [width, height] + * width: the width, or nil + * height: the height, or nil ---- SCROLL_ENDS ---- SCROLL_PAGES ---- SCROLL_STEPS ---- SCROLL_HORIZONTAL_ENDS ---- SCROLL_HORIZONTAL_PAGES ---- SCROLL_HORIZONTAL_STEPS -=== GtkScrollType +--- move(x, y) ---- SCROLL_NONE ---- SCROLL_JUMP ---- SCROLL_STEP_BACKWARD ---- SCROLL_STEP_FORWARD ---- SCROLL_PAGE_BACKWARD ---- SCROLL_PAGE_FORWARD ---- SCROLL_STEP_UP ---- SCROLL_STEP_DOWN ---- SCROLL_PAGE_UP ---- SCROLL_PAGE_DOWN ---- SCROLL_STEP_LEFT ---- SCROLL_STEP_RIGHT ---- SCROLL_PAGE_LEFT ---- SCROLL_PAGE_RIGHT ---- SCROLL_START ---- SCROLL_END -=== GtkSelectionMode + 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::Window::GRAVITY_NORTH_WEST, so the reference point is simply the x, y supplied to Gtk::Widnow#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::Window::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::Window::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, Gdk.screen_width - window_width, Gdk.screen_height - window_height). + The extended window manager hints specification at http://www.freedesktop.org/standards/wm-spec.html has a nice table of gravities in the "implementation notes" section. + The Gtk::Window#position documentation may also be relevant. + * x: X coordinate to move window to + * y: Y coordinate to move window to + * Returns: self -Used to control what selections users are allowed to make. +--- parse_geometry(geometry) ---- SELECTION_NONE + 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::Window::HINT_USER_POS and/or Gdk::Window::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. + * geometry: geometry string + * Returns: true if string was parsed successfully - No selection is possible. +--- reshow_with_initial_size ---- SELECTION_SINGLE + Hides window, then reshows it, resetting the default size and position of the window. Used by GUI builders only. + * Returns: self - Zero or one element may be selected. +--- resize ---- SELECTION_BROWSE + 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. + * width: width in pixels to resize the window to + * height: height in pixels to resize the window to + * Returns: self - Exactly one element is selected. In some circumstances, such as initially or during a search operation, it's possible for no element to be selected with Gtk::SELECTION_BROWSE. What is really enforced is that the user can't deselect a currently selected element except by selecting another element. +--- allow_grow? ---- SELECTION_MULTIPLE + Retrieves the value whether the window can be resized to a larger size by the user. + * Returns: true if the window can be resized to a larger size by the user. - Any number of elements may be selected. Clicks toggle the state of an item. Any number of elements may be selected. Click-drag selects a range of elements; the Ctrl key may be used to enlarge the selection, and Shift key to select between the focus and the child pointed to. +--- allow_grow=(setting) -=== GtkShadowType + Sets the value whether the window can be resized to a larger size by the user. + * setting: true if the window can be resized to a larger size by the user. + * Returns: setting -Used to change the appearance of an outline typically provided by a Gtk::Frame. +--- set_allow_grow(setting) ---- SHADOW_NONE + Same as Gtk::Window#allow_grow=. + * setting: true if the window can be resized to a larger size by the user. + * Returns: self - No outline. +--- allow_shrink? ---- SHADOW_IN + Retrieves the value whether the window can be resized to a smaller size by the user. + * Returns: true if the window can be resized to a smaller size by the user. - The outline is bevelled inwards. +--- allow_shrink=(setting) ---- SHADOW_OUT + Sets the value whether the window can be resized to a smaller size by the user. + * setting: true if the window can be resized to a smaller size by the user. + * Returns: setting - The outline is bevelled outwards like a button. +--- set_allow_shrink(setting) ---- SHADOW_ETCHED_IN + Same as Gtk::Window#allow_shrink=. + * setting: true if the window can be resized to a smaller size by the user. + * Returns: self - The outline itself is an inward bevel, but the frame does +--- default_height ---- SHADOW_ETCHED_OUT + Retrieves the default height of the window, used when initially showing the window. + * Returns: the default height of the window - The outline itself is an outward bevel, but the frame does +--- default_height=(height) -=== GtkSortType + Sets the default height of the window, used when initially showing the window. + * height: Sets the default height of the window + * Returns: height -Determines the direction of a sort. +--- set_default_height(height) ---- SORT_ASCENDING + Same as Gtk::Window#default_height=. + * height: Sets the default height of the window + * Returns: self - Sorting is in ascending order. +--- default_width ---- SORT_DESCENDING + Retrieves the default width of the window, used when initially showing the window. + * Returns: the default width of the window - Sorting is in descending order. +--- default_width=(width) -=== GtkStateType + Sets the default width of the window, used when initially showing the window. + * width: Sets the default width of the window + * Returns: width -This constant indicates the current state of a widget; the state determines how the widget is drawn. The GtkStateType is also used to identify different colors in a Gtk::Style for drawing, so states can be used for subparts of a widget as well as entire widgets. +--- set_default_width(width) ---- STATE_NORMAL + Same as Gtk::Window#default_width=. + * width: Sets the default width of the window + * Returns: self - State during normal operation. +--- move_focus(dirtype) ---- STATE_ACTIVE + Emits a "move-focus" signal. + * dirtype: (Gtk#GtkDirectionType) + * Returns: self - State of a currently active widget, such as a depressed button. +--- deletable=(deletable) ---- STATE_PRELIGHT + Sets the value whether the window frame should have a close button or not. + * deletable: true if the window frame should have a close button + * Returns: deletable - State indicating that the mouse pointer is over the widget and the widget will respond to mouse clicks. +--- deletable? ---- STATE_SELECTED + Gets the value whether the window frame should have a close button or not. + * Returns: true if the window frame should have a close button - State of a selected item, such the selected row in a list. +--- group ---- STATE_INSENSITIVE + * Returns: self: ((*FIXME*)) - State indicating that the widget is unresponsive to user actions. +--- opacity -=== GtkUpdateType + Gets the opacity of the window, from 0 to 1. + * Returns: The opacity of the window, from 0 to 1 ---- UPDATE_CONTINUOUS ---- UPDATE_DISCONTINUOUS ---- UPDATE_DELAYED -=== GtkVisibility +--- opacity=(opacity) ---- VISIBILITY_NONE + Sets the opacity of the window, from 0 to 1. + * opacity: The opacity of the window, from 0 to 1 + * Returns: opacity - The row is not visible. +--- ref_accessible ---- VISIBILITY_PARTIAL + See Atk::Implementor#ref_accessible. - The row is partially visible. +--- set_deletable(deletable) ---- VISIBILITY_FULL + Same as deletable=. + * deletable: true if the window frame should have a close button + * Returns: self - The row is fully visible. +--- set_opacity(opacity) -=== Version Information + Same as opacity=. + * opacity: The opacity of the window, from 0 to 1 + * Returns: self ---- VERSION +--- set_startup_id(startup_id) - Current(runtime) GTK+ version. Same as [Gtk::MAJOR_VERSION, Gtk::MINOR_VERSION, Gtk::MICRO_VERSION]. + Same as startup_id=. + * startup_id: Unique startup identifier for the window used by startup-notification + * Returns: self ---- MAJOR_VERSION +--- startup_id=(startup_id) - Current(runtime) GTK+ major version + Sets the Unique startup identifier for the window used by startup-notification. + * startup_id: Unique startup identifier for the window used by startup-notification + * Returns: startup_id ---- MINOR_VERSION +--- urgency_hint? - Current(runtime) GTK+ minor version + Gets the true if the window should be brought to the user's attention.. + * Returns: true if the window should be brought to the user's attention. ---- MICRO_VERSION +--- add_child - Current(runtime) GTK+ minor version + See Gtk::Buildable#add_child. ---- BUILD_VERSION +--- construct_child - GTK+ version which Ruby/GTK is compiled. [major, minor, micro] + See Gtk::Buildable#construct_child. ---- BINDING_VERSION +--- get_internal_child - Ruby/GTK version. [major, minor, micro] + See Gtk::Buildable#get_internal_child. ---- BINARY_AGE +--- name - The binary age of the current GTK+. + See Gtk::Buildable#name. ---- INTERFACE_AGE +--- name= - The interface age of the current GTK+. + See Gtk::Buildable#name=. ---- DIRECTION_LEFT ---- DIRECTION_RIGHT ---- LEFT_RIGHT ---- LOG_DOMAIN ---- PRIORITY_RESIZE ---- SELECTION_EXTENDED ---- TOP_BOTTOM +--- set_buildable_property + See Gtk::Buildable#set_buildable_property. + +--- set_name + + See Gtk::Buildable#set_name. + +== Constants + +=== Position + +Window placement can be influenced using these constants. + +--- POS_NONE + + No influence is made on placement. + +--- POS_CENTER + + Windows should be placed in the center of the screen. + +--- POS_MOUSE + + Windows should be placed at the current mouse position. + +--- POS_CENTER_ALWAYS + + Keep window centered as it changes size, etc. + +--- POS_CENTER_ON_PARENT + + Center the window on its transient parent (see Gtk::Window#transient_for=). + +=== Type + +A Gtk::Window 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#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 Gtk::Menu 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#decorated= for that. + +--- TOPLEVEL + + A regular window, such as a dialog. + +--- POPUP + + A special window such as a tooltip. + +== Properties + +--- accept-focus: true or false (Read/Write) + + true if the window should receive the input focus. ((* Since 2.4 *)) + * Default value: true + +--- allow-grow: true or false (Read/Write) + + If true, users can expand the window beyond its minimum size + * Default value: true + +--- allow-shrink: true or false (Read/Write) + + If true, the window has no mimimum size. Setting this to true is 99% of the time a bad idea + * Default value: false + +--- decorated: true or false (Read/Write) + + Whether the window should be decorated by the window manager ((* Since 2.4 *)) + * Default value: true + +--- default-height: Integer (Read/Write) + + The default height of the window, used when initially showing the window + * Allowed values: >= -1 + * Default value: -1 + +--- default-width: Integer (Read/Write) + + The default width of the window, used when initially showing the window + * Allowed values: >= -1 + * Default value: -1 + +--- destroy-with-parent: true or false (Read/Write) + + If this window should be destroyed when the parent is destroyed + * Default value: false + +--- focus-on-map: true or false (Read/Write) + + true if the window should receive the input focus when mapped. ((* Since 2.6 *)) + * Default value: true + +--- gravity: Gdk::Widnow#GdkGravity (Read/Write) + + The window gravity of the window. See Gtk::Window#move and Gdk::Window#GdkGravity for more details about window gravity. + * Default value: Gdk::Window::GRAVITY_NORTH_WEST + +--- has-toplevel-focus: true or false (Read) + + Whether the input focus is within this Gtk::Window + * Default value: false + +--- icon: Gdk::Pixbuf (Read/Write) + + Icon for this window + +--- icon-name: String (Read/Write) + + The :icon-name property specifies the name of the themed icon to use as the window icon. See Gtk::IconTheme for more details. ((* Since 2.6 *)) + * Default value: nil + +--- is-active: true or false (Read) + + Whether the toplevel is the current active window + * Default value: false + +--- modal: true or false (Read/Write) + + If true, the window is modal (other windows are not usable while this one is up) + * Default value: false + +--- resizable: true or false (Read/Write) + + If true, users can resize the window + * Default value: true + +--- role: String (Read/Write) + + Unique identifier for the window to be used when restoring a session + * Default value: nil + +--- screen: Gdk::Screen (Read/Write) + + The screen where this window will be displayed + +--- skip-pager-hint: true or false (Read/Write) + + true if the window should not be in the pager. + * Default value: false + +--- skip-taskbar-hint: true or false (Read/Write) + + true if the window should not be in the task bar. + * Default value: false + +--- title: String (Read/Write) + + The title of the window + * Default value: nil + +--- type: Integer (Read/Write) + + The type of the window + * Default value: Gtk::Window::TOPLEVEL + +--- type-hint: Gdk::Window#GdkWindowTypeHint (Read/Write) + + Hint to help the desktop environment understand what kind of window this is and how to treat it. + * Default value: Gdk::Window::TYPE_HINT_NORMAL + +--- urgency-hint: true or false (Read/Write) + + True if the window should be brought to the user's attention. ((*Since 2.8*)) + * Default value: false + +--- window-position: Gtk::Window#Position (Read/Write) + + The initial position of the window + * Default value: Gtk::Window::POS_NONE + +--- deletable: true or false (Read/Write) + + Whether the window frame should have a close button + +--- opacity: Float (Read/Write) + + The opacity of the window, from 0 to 1 + +--- startup-id: String (Write) + + Unique startup identifier for the window used by startup-notification + +--- transient-for: Gtk::Window (Read/Write) + + The transient parent of the dialog + +== Signals + +--- activate-default: self + + * self: Gtk::Window + +--- activate-focus: self + + * self: Gtk::Window + +--- frame-event: self, event + + * self: Gtk::Window + * event: Gdk::Event + +--- keys-changed: self + + * self: Gtk::Window + +--- move-focus: self, dir_type + + * self: Gtk::Window + * dir_type: ((<GtkDirectionType|Gtk#GtkDirectionType>)) + +--- set-focus: self, widget + + * self: Gtk::Window + * widget: Gtk::Widget + == See Also == ChangeLog + +* 2006-01-24 Apply GTK+-2.2 - 2.8 methods. ((<Masao>)) -* 2009-01-30 Deprecated timeout_add idle_add. - Vincent -* 2006-01-08 Added "GtkScrollType". - Chris Moore -* 2006-01-08 Moved "GtkSortType" for alphabetical order. - Chris Moore -* 2005-10-24 Fix a typo. - Masao -* 2005-09-30 Added "Version Information". - Masao -* 2005-02-12 Revised. Reported by Chikara Takamatsu. - Masao -* 2003-03-24 Created. - Masao +- ((<Masao>))