新規作成  編集  Ruby-GNOME2 Project Website  ページ一覧  検索  更新履歴  編集履歴  RSS  ログイン

Gtk::Widget

Gtk::Widget クラス

インクルードされているモジュール

  • Gtk::Buildable?
  • Atk::Implementor
  • GLib::Interface?

クラスメソッド

Gtk::Widget.default_colormap
Obtains the default colormap used to create widgets.
  • Returns: default widget colormap
Gtk::Widget.set_default_colormap(colormap)
Sets the default colormap to use when creating widgets. Gtk::Widget.push_colormap is a better method to use if you only want to affect a few widgets, rather than all widgets.
Gtk::Widget.default_direction
Obtains the current default reading direction. See Gtk::Widget.set_default_direction.
  • Returns: the current default direction.
Gtk::Widget.set_default_direction(direction)
Sets the default reading direction for widgets where the direction has not been explicitly set by Gtk::Widget.set_direction.
Gtk::Widget.default_style
Returns the default style used by all widgets initially.
  • Returns: the default style. This Gtk::Style object is owned by GTK+ and should not be modified or freed.
Gtk::Widget.default_visual
Obtains the visual of the default colormap. Not really useful; used to be useful before Gdk::Colormap#visual existed.
  • Returns: visual of the default colormap
Gtk::Widget.push_colormap(cmap)
Pushes cmap onto a global stack of colormaps; the topmost colormap on the stack will be used to create all widgets. Remove cmap with Gtk::Widget.pop_colormap. There's little reason to use this method.
Gtk::Widget.pop_colormap
Removes a colormap pushed with Gtk::Widget.push_colormap.
  • Returns: self
Gtk::Widget.push_composite_child
Makes all newly-created widgets as composite children until the corresponding Gtk::Widget.pop_composite_child call. A composite child is a child that's an implementation detail of the container it's inside and should not be visible to people using the container. Composite children aren't treated differently by GTK, but e.g. GUI builders might want to treat them in a different way.
  • Returns: self
Gtk::Widget.pop_composite_child
Cancels the effect of a previous call to Gtk::Widget.push_composite_child.
  • Returns: self
Gtk::Widget.install_style_property(pspec)
Install style property to the class.
  • pspec: a subclass of GLib::Param?
  • Returns: self
Gtk::Widget.install_style_property(pspec) {|pspec, str| ... val}
Install style property to the class and use the block for parsing the resource information from a string.
  • pspec: a subclass of GLib::Param?.
  • {|pspec, str| ... val}: a block which parses the resource information from a string and returns it.
  • Returns: self
Gtk::Widget.style_properties(inherited_too = true)
Gets the style property names. Since 2.2
  • inherited_too: true if you get all of the names, false if you get the names which defined by this class.
  • Returns: an array of style property names.
Gtk::Widget.style_property(prop_name)
Gets the style property. Since 2.2
  • prop_name: the property name.
  • Returns: the style property.
Gtk::Widget.default_direction=()
要編集
Gtk::Widget.default_colormap=()
要編集
Gtk::Widget.binding_set()

Ruby/GTK3 only

要編集

インスタンスメソッド

flags
Returns the widget flags.
flags=(flags)
Turns on certain widget flags.
set_flags(flags)
Same as Gtk::Widget#flags=.
unset_flags(flags)
Turns off certain widget flags.
unparent
This method is only for use in widget implementations. Should be called by implementations of the remove method on Gtk::Container, to dissociate a child from the container.
  • Returns: self
show
Flags a widget to be displayed. Any widget that isn't shown will not appear on the screen. If you want to show all the widgets in a container, it's easier to call Gtk::Widget#show_all on the container, instead of individually showing the widgets. Remember that you have to show the containers containing a widget, in addition to the widget itself, before it will appear onscreen. When a toplevel container is shown, it is immediately realized and mapped; other shown widgets are realized and mapped when their toplevel container is realized and mapped.
  • Returns: self
show_now
Shows a widget. If the widget is an unmapped toplevel widget (i.e. a Gtk::Window that has not yet been shown), enter the main loop and wait for the window to actually be mapped. Be careful; because the main loop is running, anything can happen during this method.
  • Returns: self
hide
Reverses the effects of Gtk::Widget#show, causing the widget to be hidden(invisible to the user).
  • Returns: self
show_all
Recursively shows a widget, and any child widgets (if the widget is a container).
  • Returns: self
hide_all
Recursively hides a widget and any child widgets.
  • Returns: self
map
This method is only for use in widget implementations. Causes a widget to be mapped if it isn't already.
  • Returns: self
unmap
This method is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped.
  • Returns: self
realize
Creates the GDK (windowing system) resources associated with a widget. For example, Gtk::Widget#window will be created when a widget is realized. Normally realization happens implicitly; if you show a widget and all its parent containers, then the widget will be realized and mapped automatically. Realizing a widget requires all the widget's parent widgets to be realized; calling Gtk::Widget#realize realizes the widget's parents in addition to widget itself. If a widget is not yet inside a toplevel window when you realize it, bad things will happen. This method is primarily used in widget implementations, and isn't very useful otherwise. Many times when you think you might need it, a better approach is to connect to a signal that will be called after the widget is realized automatically, such as "expose_event". Or simply GLib::Instantiatable#signal_connect_after to the "realize" signal.
  • Returns: self
unrealize
This method is only useful in widget implementations. Causes a widget to be unrealized (frees all GDK resources associated with the widget, such as Gtk::Widget#window).
  • Returns: self
queue_draw
Equivalent to calling Gtk::Widget#queue_draw_area for the entire area of a widget.
  • Returns: self
queue_resize
This method is only for use in widget implementations. Flags a widget to have its size renegotiated; should be called when a widget for some reason has a new size request. For example, when you change the text in a Gtk::Label, Gtk::Label queues a resize to ensure there's enough space for the new text.
  • Returns: self
queue_resize_no_redraw
This function works like #queue_resize, except that the widget is not invalidated. Since 2.4
  • Returns: self
size_request

This method is typically used when implementing a Gtk::Container subclass. Obtains the preferred size of a widget. The container uses this information to arrange its child widgets and decide what size allocations to give them with Gtk::Widget#size_allocate(). You can also call this method from an application, with some caveats. Most notably, getting a size request requires the widget to be associated with a screen, because font information may be needed. Multihead-aware applications should keep this in mind. Also remember that the size request is not necessarily the size a widget will actually be allocated. See also Gtk::Widget#child_requisition.

(Notice):This method name is special in Ruby-GNOME2. This method is not reverses the effects of Gtk::Widget#set_size_request. If you need that purpose, use Gtk::Widget#get_size_request instead.

  • Returns: a [width, height]
get_size_request

Gets the size request that was explicitly set for the widget using Gtk::Widget#set_size_request. A value of -1 stored in width or height indicates that that dimension has not been set explicitly and the natural requisition of the widget will be used intead. See Gtk::Widget#set_size_request. To get the size a widget will actually use, call Gtk::Widget#size_request instead of this method.

(Notice):This method name is special in Ruby-GNOME2. Usually we should name this as Gtk::Widget#size_request. But there has been Gtk::Widget#size_request as another method already. So we named this method same as original GTK+ name.

  • Returns: [width, height]
set_size_request(width, height)
Sets the minimum size of a widget; that is, the widget's size request will be width by height. You can use this method to force a widget to be either larger or smaller than it normally would be. In most cases, Gtk::Window#set_default_size is a better choice for toplevel windows than this method; setting the default size will still allow users to shrink the window. Setting the size request will force them to leave the window at least as large as the size request. When dealing with window sizes, Gtk::Window#set_geometry_hints can be a useful method as well. Note the inherent danger of setting any fixed size - themes, translations into other languages, different fonts, and user action can all change the appropriate size for a given widget. So, it's basically impossible to hardcode a size that will always be correct. The size request of a widget is the smallest size a widget can accept while still functioning well and drawing itself correctly. However in some strange cases a widget may be allocated less than its requested size, and in many cases a widget may be allocated more space than it requested. If the size request in a given direction is -1 (unset), then the "natural" size request of the widget will be used instead. Widgets can't actually be allocated a size less than 1 by 1, but you can pass 0,0 to this method to mean "as small as possible."
  • width: width widget should request, or -1 to unset
  • height: height widget should request, or -1 to unset
  • Returns: self
width_request
Returns the width request of the widget
  • Returns: width widget should request, or -1 to unset
width_request=(width)
Override for width request of the widget, or -1 if natural request should be used.
  • width: width widget should request, or -1 to unset
  • Returns: width
set_width_request(width)
Same as Gtk::Widget#width_request=.
  • width: width widget should request, or -1 to unset
  • Returns: self
height_request
Returns the height request of the widget
  • Returns: height widget should request, or -1 to unset
height_request=(height)
Override for height request of the widget, or -1 if natural request should be used.
  • height: height widget should request, or -1 to unset
  • Returns: height
set_height_request(height)
Same as Gtk::Widget#height_request=.
  • height: height widget should request, or -1 to unset
  • Returns: self
child_requisition
This method is only for use in widget implementations. Obtains widget.requisition, unless someone has forced a particular geometry on the widget (e.g. with Gtk::Widget#set_usize), in which case it returns that geometry instead of the widget's requisition. This method differs from Gtk::Widget#size_request in that it retrieves the last size request value from widget.requisition, while Gtk::Widget#size_request actually calls the "size_request" method on widget to compute the size request and fill in widget.requisition, and only then returns widget.requisition. Because this method does not call the "size_request" method, it can only be used when you know that widget.requisition is up-to-date, that is, Gtk::Widget#size_request has been called since the last time a resize was queued. In general, only container implementations have this information; applications should use Gtk::Widget#size_request.
  • Returns: a [width, height]
size_allocate(allocation)
This function is only used by Gtk::Container subclasses, to assign a size and position to their child widgets.
  • allocation: position and size to be allocated to widget
  • Returns: self
add_accelerator(accel_signal, accel_group, accel_key, accel_mods, accel_flags)
Installs an accelerator for this widget in accel_group that causes accel_signal to be emitted if the accelerator is activated. The accel_group needs to be added to the widget's toplevel via Gtk::Window#add_accel_group, and the signal must be of type G_RUN_ACTION(not implemented yet). Accelerators added through this function are not user changeable during runtime. If you want to support accelerators that can be changed by the user, use Gtk::AccelMap#add_entry and Gtk::Widget#set_accel_path or Gtk::MenuItem#accel_path= instead.
remove_accelerator(accel_group, accel_key, accel_mods)
Removes an accelerator from widget, previously installed with Gtk::Widget#add_accelerator.
  • accel_group: a Gtk::AccelGroup for this widget
  • accel_key: GDK keyval of the accelerator (Gdk::Keyval)
  • accel_mods: modifier key combination of the accelerator (GdkModifierType)
  • Returns: true if an accelerator was installed and could be removed
set_accel_path(accel_path, accel_group)
Given an accelerator group, accel_group, and an accelerator path, accel_path, sets up an accelerator in accel_group so whenever the key binding that is defined for accel_path is pressed, widget will be activated. This removes any accelerators (for any accelerator group) installed by previous calls to Gtk::Widget#set_accel_path. Associating accelerators with paths allows them to be modified by the user and the modifications to be saved for future use. (See Gtk::AccelMap#save.) This function is a low level function that would most likely be used by a menu creation system like Gtk::ItemFactory. If you use Gtk::ItemFactory, setting up accelerator paths will be done automatically. Even when you you aren't using Gtk::ItemFactory, if you only want to set up accelerators on menu items Gtk::MenuItem#accel_path= provides a somewhat more convenient interface.
  • accel_path : path used to look up the the accelerator (String)
  • accel_group : a Gtk::AccelGroup.
  • Returns: self
accel_closures
Lists the closures used by widget for accelerator group connections with Gtk::AccelGroup#connect(). The closures can be used to monitor accelerator changes on widget, by connecting to the ::accel_changed signal of the Gtk::AccelGroup of a closure which can be found out with Gtk::AccelGroup.from_accel_closure().
  • Returns : an array of closures(GLib::Closure?)
can_activate_accel?(signal_id)
Determines whether an accelerator that activates the signal identified by signal_id can currently be activated. This is done by emitting the Gtk::Widget#can-activate-accel signal on self; if the signal isn't overridden by a handler or in a derived widget, then the default check is that the widget must be sensitive, and the widget and all its ancestors mapped. Since 2.4
  • signal_id: the ID of a signal installed on widget (Fixnum)
  • Returns: true if the accelerator can be activated.
event(event)
Rarely-used method. This method is used to emit the event signals on a widget (those signals should never be emitted without using this method to do so). If you want to synthesize an event though, don't use this method; instead, use Gtk.main_do_event so the event will behave as if it were in the event queue. Don't synthesize expose events; instead, use Gdk::Window#invalidate to invalidate a region of the window.
  • event: a Gdk::Event
  • Returns: return from the event signal emission (true if the event was handled)
activate
For widgets that can be "activated" (buttons, menu items, etc.) this method activates them. Activation is what happens when you press Enter on a widget during key navigation; clicking a button, selecting a menu item, etc. If widget isn't activatable, the method returns false.
  • Returns: true if the widget was activatable
reparent(new_parent)
Moves a widget from one Gtk::Container to another, handling reference count issues to avoid destroying the widget.
intersect(area, intersection)
Computes the intersection of a widget's area and area, storing the intersection in intersection, and returns true if there was an intersection. intersection may be null if you're only interested in whether there was an intersection.
focus?
Determines if the widget is the focus widget within its toplevel. (This does not mean that the Gtk::Widget#has_focus= is necessarily set true; Gtk::Widget#has_focus will only be set if the toplevel widget additionally has the global input focus.)
  • Returns: true if the widget is the focus widget.
grab_focus
Causes widget to have the keyboard focus for the Gtk::Window it's inside. widget must be a focusable widget, such as a Gtk::Entry; something like Gtk::Frame won't work. (More precisely, it must have the Gtk::Widget#can_focus= set true.) Returns: self
grab_default
Causes widget to become the default widget. widget must have the Gtk::Widget#can_default? flag set true; typically you have to set this flag yourself by calling Gtk::Widget#can_default=. The default widget is activated when the user presses Enter in a window. Default widgets must be activatable, that is, Gtk::Widget#activate should affect them.
name
Retrieves the name of a widget. See Gtk::Widget#name= for the significance of widget names.
  • Returns: name of the widget
name=(name)
Widgets can be named, which allows you to refer to them from a gtkrc file. You can apply a style to widgets with a particular name in the gtkrc file. See the documentation for gtkrc files (on the same page as the docs for Gtk::RcStyle).
  • name: name for the widget
  • Returns: name
set_name(name)
Same as Gtk::Widget#name=.
  • name: name for the widget
  • Returns: self
state
Retrieves the state of a widget. See Gtk::Widget#state= for the significance of widget states.
state=(state)
This method is for use in widget implementations. Sets the state of a widget (insensitive, prelighted, etc.) Usually you should set the state using wrapper methods such as Gtk::Widget#sensitive=.
set_state(state)
Same as Gtk::Widget#state=.
  • state : new state for widget
  • Returns: state
sensitive?
Retrieves the senstivity of a widget. See Gtk::Widget#sensitive= for the significance of widget sensitives. This method is wrapper of "sensitive" property of Gtk::Widget.
  • Returns: true if the widget is sensitive.
sensitive=(sensitive)
Sets the sensitivity of a widget. A widget is sensitive if the user can interact with it. Insensitive widgets are "grayed out" and the user can't interact with them. Insensitive widgets are known as "inactive", "disabled", or "ghosted" in some other toolkits.
  • sensitive: true to make the widget sensitive
  • Returns: sensitive
set_sensitive(sensitive)
Same as Gtk::Widget#sensitive=.
  • sensitive: true to make the widget sensitive
  • Returns: self
parent_sensitive?
Gets the value whether the Gtk::Widget::PARENT_SENSITIVE flag has be set on the widget.
sensitive_with_parent?
Gets the value whether the widget and the parent are sensitive. This method is equivalent to Gtk::Widget#sensitive? and Gtk::Widget#parent_sensitive?. And this method is wrapper of GTK_WIDGET_IS_SENSITIVE.
  • Returns: true if the widget and the parent are sensitive.
parent
Retrieves the parent widget of this widget.
parent=(parent)
This method is useful only when implementing subclasses of Gtk::Container. Sets the container as the parent of widget, and takes care of some details such as updating the state and style of the child to reflect its new location. The opposite function is Gtk::Widget#unparent.
  • parent: parent container
  • Returns: parent
set_parent(parent)
Same as Gtk::Widget#parent=.
  • parent: parent container
  • Returns: self
parent_window
Gets widget's parent window.
parent_window=(parent_window)
Sets a non default parent window for widget.
  • parent_window: the new parent window(Gdk::Window)
  • Returns: parent_window
set_parent_window(parent_window)
Same as Gtk::Widget#parent_window=.
  • parent_window: the new parent window(Gdk::Window)
  • Returns: self
events
Returns the event mask for the widget (a bitfield containing flags from the GdkEventMask enumeration). These are the events that the widget will receive.
events=(events)
Sets the event mask (see GdkEventMask) for a widget. The event mask determines which events a widget will receive. Keep in mind that different widgets have different default event masks, and by changing the event mask you may disrupt a widget's functionality, so be careful. This function must be called while a widget is unrealized. Consider Gtk::Widget#add_events for widgets that are already realized, or if you want to preserve the existing event mask. This method can't be used with Gtk::Widget::NO_WINDOW widgets; to get events on those widgets, place them inside a Gtk::EventBox and receive events on the event box.
set_events(events)
Same as Gtk::Widget#events=.
add_events(events)
Adds the events in the bitfield events to the event mask for widget. See Gtk::Widget#set_events for details.
extension_events

存在しない?

Retrieves the extension events the widget will receive; see Gdk::Input.set_extension_events.

  • Returns: extension events for widget
extension_events=(mode)

存在しない?

Sets the extension events mask to mode. See GdkExtensionMode and Gdk::Input.set_extension_events.

  • mode: bitfield of extension events to receive (GdkExtensionMode)
  • Returns: mode
set_extension_events(mode)

存在しない?

Same as Gtk::Widget#extension_events=.

  • mode: bitfield of extension events to receive (GdkExtensionMode)
  • Returns: self
toplevel

This method returns the topmost widget in the container hierarchy widget is a part of. If widget has no parent widgets, it will be returned as the topmost widget. No reference will be added to the returned widget; it should not be unreferenced. Note the difference in behavior vs. Gtk::Widget#get_ancestor(Gtk::Window) would return nil if widget wasn't inside a toplevel window, and if the window was inside a Gtk::Window-derived widget which was in turn inside the toplevel Gtk::Window. While the second case may seem unlikely, it actually happens when a Gtk::Plug is embedded inside a Gtk::Socket within the same application. To reliably find the toplevel Gtk::Window, use Gtk::Widget#toplevel and check Gtk::Widget#toplevel?

topwidget = button.toplevel
  if topwidget.toplevel?
  [ Perform action on toplevel. ]
end 
  • Returns: the topmost ancestor of widget, or widget itself if there's no ancestor.
toplevel?
Evaluates to true if the widget is a toplevel widget.
  • Returns: true if the widget is a toplevel widget.
ancestor?(ancestor)
Determines whether widget is somewhere inside ancestor, possibly with intermediate containers.
  • ancestor: another GtkWidget
  • Returns: true if ancestor contains widget as a child, grandchild, great grandchild, etc.
get_ancestor(widget_class)
Gets the first ancestor of widget with class widget_class. For example, Gtk::Widget#get_ancestor(Gtk::Box) gets the first Gtk::Box that's an ancestor of widget. No reference will be added to the returned widget; it should not be unreferenced. See note about checking for a toplevel Gtk::Window in the docs for Gtk::Widget#toplevel.
  • widget_class: ancestor class
  • Returns: the ancestor widget, or nil if not found
colormap
Gets the colormap that will be used to render widget. No reference will be added to the returned colormap; it should not be unreferenced.
colormap=(colormap)
Sets the colormap for the widget to the given value. Widget must not have been previously realized.
set_colormap(colormap)
Same as Gtk::Widget#colormap=.
visual
Gets the visual that will be used to render widget.
pointer
Obtains the location of the mouse pointer in widget coordinates. Widget coordinates are a bit odd; for historical reasons, they are defined as widget.window coordinates for widgets that are not Gtk::Widget::NO_WINDOW widgets, and are relative to widget.allocation.x, widget.allocation.y for widgets that are Gtk::Widget::NO_WINDOW widgets.
  • Returns: [x, y]
    • x: the X coordinate
    • y: the Y coordinate
translate_coordinates(dest_widget, src_x, src_y)
Translate coordinates relative to self's allocation to coordinates relative to dest_widget's allocations. In order to perform this operation, both widgets must be realized, and must share a common toplevel.
  • dest_widget: a Gtk::Widget
  • src_x : X position relative to self
  • src_y : Y position relative to self
  • Returns : Qnil if either widget was not realized, or there was no common ancestor. Otherwise [dest_x, dest_y]
    • dest_x : location to store X position relative to dest_widget
    • dest_y : location to store Y position relative to dest_widget
hide_on_delete
Utility method; intended to be connected to the "delete_event" signal on a Gtk::Window. The function calls Gtk::Widget#hide on its argument, then returns true. If connected to "delete_event", the result is that clicking the close button for a window (on the window frame, top right corner usually) will hide but not destroy the window. By default, GTK+ destroys windows when "delete_event" is received.
  • Returns: true
style
Retrieves the style; see Gtk::Widget#style=.
style=(style)
Sets the Gtk::Style for a widget. You probably don't want to use this method; it interacts badly with themes, because themes work by replacing the Gtk::Style. Instead, use Gtk::Widget#modify_style.
set_style(style)
Same as Gtk::Widget#style=.
reset_rc_styles
Reset the styles of widget and all descendents, so when they are looked up again, they get the correct values for the currently loaded RC file settings. This method is not useful for applications.
direction
Gets the reading direction for a particular widget. See Gtk::Widget#direction=.
  • Returns: the reading direction for the widget.
direction=(dir)
Sets the reading direction on a particular widget. This direction controls the primary direction for widgets containing text, and also the direction in which the children of a container are packed. The ability to set the direction is present in order so that correct localization into languages with right-to-left reading directions can be done. Generally, applications will let the default reading direction present, except for containers where the containers are arranged in an order that is explicitely visual rather than logical (such as buttons for text justification). If the direction is set to Gtk::Widget::TEXT_DIR_NONE, then the value set by Gtk::Widget.set_default_direction will be used.
set_direction(dir)
Same as Gtk::Widget#direction=.
shape_combine_mask(shape_mask, offset_x, offset_y)
Sets a shape for this widget's GDK window. This allows for transparent windows etc., see Gdk::Window#shape_combine_mask for more information.
  • shape_mask: Gdk::Pixmap(depth=1) to be added, or nil to remove an existing shape.
  • offset_x: X position of shape mask with respect to window.
  • offset_y: Y position of shape mask with respect to window.
  • Returns: self
path
Obtains the full path to widget. The path is simply the name of a widget and all its parents in the container hierarchy, separated by periods. The name of a widget comes from Gtk::Widget#name. Paths are used to apply styles to a widget in gtkrc configuration files. Widget names are the type of the widget by default (e.g. "Gtk::Button") or can be set to an application-specific value with Gtk::Widget#name=. By setting the name of a widget, you allow users or theme authors to apply styles to that specific widget in their gtkrc file. path_reversed fills in the path in reverse order, i.e. starting with widget's name instead of starting with the name of widget's outermost ancestor.
  • Returns: [path, path_reversed]
    • path: path string, or nil
    • path_reversed: reverse path string, or nil
class_path
Same as Gtk::Widget#path, but always uses the name of a widget's type, never uses a custom name set with Gtk::Widget#name=.
  • path: the class path, or nil
  • path_reversed: the reverse class path, or nil
composite_name
Obtains the composite name of a widget.
  • Returns: the composite name of widget, or nil if widget is not a composite child. The string should not be freed when it is no longer needed.
composite_name=(name)
Sets a widgets composite name. The widget must be a composite child of its parent; see Gtk::Widget#push_composite_child.
  • name: the name to set.
  • Returns: name
set_composite_name(name)
Same as Gtk::Widget#composite_name=
  • name: the name to set.
  • Returns: self
modify_style(style)
Modifies style values on the widget. Modifications made using this technique take precedence over style values set via an RC file, however, they will be overriden if a style is explicitely set on the widget using Gtk::Widget#set_style. The Gtk::RcStyle structure is designed so each field can either be set or unset, so it is possible, using this function, to modify some style values and leave the others unchanged. Note that modifications made with this function are not cumulative with previous calls to Gtk::Widget#modify_style or with such functions as Gtk::Widget#modify_fg. If you wish to retain previous values, you must first call Gtk::Widget#modifier_style(), make your modifications to the returned style, then call Gtk::Widget#modify_style with that style. On the other hand, if you first call Gtk::Widget#modify_style, subsequent calls to such functions Gtk::Widget#modify_fg will have a cumulative effect with the initial modifications.
  • style: the Gtk::RcStyle holding the style modifications
  • Returns: self
modifier_style
Returns the current modifier style for the widget. (As set by Gtk::Widget#modify_style.) If no style has previously set, a new Gtk::RcStyle will be created with all values unset, and set as the modifier style for the widget. If you make changes to this rc style, you must call Gtk::Widget#modify_style, passing in the returned rc style, to make sure that your changes take effect. Caution: passing the style back to Gtk::Widget#modify_style will normally end up destroying it, because Gtk::Widget#modify_style copies the passed-in style and sets the copy as the new modifier style, thus dropping any reference to the old modifier style. Add a reference to the modifier style if you want to keep it alive.
  • Returns: the modifier style(Gtk::RcStyle) for the widget. This rc style is owned by the widget.
modify_fg(state, color)
Sets the foreground color for a widget in a particular state. All other style values are left untouched. See also Gtk::Widget#modify_style.
  • state: the state(GtkStateType) for which to set the foreground color.
  • color: the Gdk::Color to assign (does not need to be allocated).
  • Returns: self
modify_bg(state, color)
Sets the background color for a widget in a particular state. All other style values are left untouched. See also Gtk::Widget#modify_style.
  • state: the state(GtkStateType) for which to set the background color.
  • color: the Gdk::Color to assign (does not need to be allocated).
  • Returns: self
modify_text(state, color)
Sets the text color for a widget in a particular state. All other style values are left untouched. The text color is the foreground color used along with the base color (see Gtk::Widget#modify_base) for widgets such as Gtk::Entry and Gtk::TextView. See also Gtk::Widget#modify_style.
  • state: the state(GtkStateType) for which to set the text color.
  • color: the Gdk::Color to assign (does not need to be allocated).
  • Returns: self
modify_base(state, color)
Sets the base color for a widget in a particular state. All other style values are left untouched. The base color is the background color used along with the text color (see Gtk::Widget#modify_text) for widgets such as Gtk::Entry and Gtk::TextView. See also Gtk::Widget#modify_style.
  • state: the state(GtkStateType) for which to set the base color.
  • color: the Gdk::Color to assign (does not need to be allocated).
  • Returns: self
modify_font(font_desc)
Sets the font to use for a widget. All other style values are left untouched. See also Gtk::Widget#modify_style.
create_pango_context
Creates a new Pango::Context with the appropriate colormap, font description, and base direction for drawing text for this widget. See also Gtk::Widget#pango_context.
pango_context
Gets a Pango::Context with the appropriate colormap, font description and base direction for this widget. Unlike the context returned by Gtk::Widget#create_pango_context, this context is owned by the widget (it can be used as long as widget exists), and will be updated to match any changes to the widget's attributes. If you create and keep a Pango::Layout using this context, you must deal with changes to the context by calling Pango::Layout#context_changed on the layout in response to the ::style_set and ::direction_set signals for the widget.
create_pango_layout
Creates a new Pango::Layout with the appropriate colormap, font description, and base direction for drawing text for this widget. If you keep a Pango::Layout created in this way around, in order notify the layout of changes to the base direction or font of this widget, you must call Pango::Layout#context_changed in response to the ::style_set and ::direction_set signals for the widget.
  • text: text to set on the layout (can be nil)
  • Returns: the new Pango::Layout
render_icon(stock_id, size, detail=nil)
convenience method that uses the theme engine and RC file settings for widget to look up stock_id and render it to a Gdk::Pixbuf. stock_id should be a stock icon ID such as Gtk::Stock::OPEN or Gtk::Stock::OK. Size should be a size such as Gtk::IconSize::MENU. detail should be a string that identifies the widget or code doing the rendering, so that theme engines can special-case rendering for that widget or code.
  • stock_id : a stock ID(Gtk::Stock)
  • size : a stock size(Gtk::IconSize
  • detail : render detail to pass to theme engine(String or nil)
  • Returns : a new Gdk::Pixbuf, or nil if the stock ID wasn't known
queue_draw_area(x, y, width, height)
Invalidates the rectangular area of widget defined by x, y, width and height by calling Gdk::Window#invalidate on the widget's window and all its child windows. Once the main loop becomes idle (after the current batch of events has been processed, roughly), the window will receive expose events for the union of all regions that have been invalidated. Normally you would only use this method in widget implementations. You might also use it, or Gdk::Window#invalidate directly, to schedule a redraw of a Gtk::DrawingArea or some portion thereof. Frequently you can just call Gdk::Window#invalidate or Gdk::Window#invalidate instead of this method. Those methods will invalidate only a single window, instead of the widget and all its children. The advantage of adding to the invalidated region compared to simply drawing immediately is efficiency; using an invalid region ensures that you only have to redraw one time.
  • x: x coordinate of upper-left corner of rectangle to redraw
  • y: y coordinate of upper-left corner of rectangle to redraw
  • width: width of region to draw
  • height: height of region to draw
  • Returns: self
reset_shapes
Recursively resets the shape on this widget and its descendants.
  • Returns: self
app_paintable?
Returns whether the application will paint directly on the widget. Returns: true if the application will paint directly on the widget.
app_paintable=(paintable)
Sets whether the application will paint directly on the widget.
  • paintable: true to the paintable a widget.
  • Returns: paintable
set_app_paintable(paintable)
Same as Gtk::Widget#app_paintable=.
  • paintable: true if the application will paint directly on the widget.
  • Returns: self
double_buffered?
Returns whether the widget is double-buffered Returns: true if double-buffered
double_buffered=(double_buffered)
Widgets are double buffered by default; you can use this method to turn off the buffering. "Double buffered" simply means that Gdk::Window#begin_paint_region and Gdk::Window#end_paint are called automatically around expose events sent to the widget. Gdk::Window#begin_paint diverts all drawing to a widget's window to an offscreen buffer, and Gdk::Window#end_paint draws the buffer to the screen. The result is that users see the window update in one smooth step, and don't see individual graphics primitives being rendered. In very simple terms, double buffered widgets don't flicker, so you would only use this method to turn off double buffering if you had special needs and really knew what you were doing.
  • double_buffered : true to double-buffer a widget
  • Returns: double_buffered
set_double_buffered(double_buffered)
Same as Gtk::Widget#double_buffered=.
  • double_buffered : true to double-buffer a widget
  • Returns: self
redraw_on_allocate=(redraw_on_allocate)
Sets whether a when a widgets size allocation changes, the entire widget is queued for drawing. By default, this setting is true and the entire widget is redrawn on every size change. If your widget leaves the upper left are unchanged when made bigger, turning this setting on will improve performance. Note that for Gtk::Widget::NO_WINDOW widgets setting this flag to false turns off all allocation on resizing: the widget will not even redraw if its position changes; this is to allow containers that don't draw anything to avoid excess invalidations. If you set this flag on a Gtk::Widget::NO_WINDOW widget that does draw on Gtk::Widget.window, you are responsible for invalidating both the old and new allocation of the widget when the widget is moved and responsible for invalidating regions newly when the widget increases size.
  • redraw_on_allocate : if true, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
  • Returns: redraw_on_allocate
set_redraw_on_allocate(redraw_on_allocate)
Same as Gtk::Widget#redraw_on_allocate=.
  • redraw_on_allocate : if true, the entire widget will be redrawn when it is allocated to a new size. Otherwise, only the new portion of the widget will be redrawn.
  • Returns: self
set_scroll_adjustment
For widgets that support scrolling, sets the scroll adjustments and returns true. For widgets that don't support scrolling, does nothing and returns false. Widgets that don't support scrolling can be scrolled by placing them in a Gtk::Viewport, which does support scrolling.
  • hadjustment: an adjustment for horizontal scrolling, or nil
  • vadjustment: an adjustment for vertical scrolling, or nil
  • Returns: true if the widget supports scrolling
mnemonic_activate
For widgets that can be "mnemonic_activated" (buttons, menu items, etc.) this method activates them. Activation is what happens when you press a mnemonic key on a widget during key navigation; clicking a button, selecting a menu item, etc. If widget isn't activatable, the method returns false.
  • Returns: true if the widget was activatable
region_intersect(region)
Computes the intersection of a widget's area and region, returning the intersection. The result may be empty, use Gdk:Region#empty? to check.
send_expose(event)
Very rarely-used method. This method is used to emit an expose event signals on a widget. This method is not normally used directly. The only time it is used is when propagating an expose event to a child Gtk::Widget::NO_WINDOW widget, and that is normally done using Gtk::Container#propagate_expose. If you want to force an area of a window to be redrawn, use Gdk::Window#invalidate or Gdk::Window#invalidate. To cause the redraw to be done immediately, follow that call with a call to Gdk::Window#process_updates.
  • event: a expose Gdk::Event
  • Returns: return from the event signal emission
style_get_property(property_name)
Gets the value of a style property of the widget.
  • property_name: the name of a style property
  • Returns: the property value
accessible
Gets the Atk::Object.
  • Returns: the Atk::Object
child_focus
This method is used by custom widget implementations; if you're writing an app, you'd use Gtk::Widget#grab_focus to move the focus to a particular widget, and Gtk::Container#focus_chain= to change the focus tab order. So you may want to investigate those methods instead. Gtk::Widget#child_focus is called by containers as the user moves around the window using keyboard shortcuts. direction indicates what kind of motion is taking place (up, down, left, right, tab forward, tab backward). Gtk::Widget#child_focus invokes the "focus" signal on Gtk::Widget; widgets override the default handler for this signal in order to implement appropriate focus behavior. The "focus" default handler for a widget should return true if moving in direction left the focus on a focusable location inside that widget, and false if moving in direction moved the focus outside the widget. If returning true, widgets normally call Gtk::Widget#grab_focus to place the focus accordingly; if returning false, they don't modify the current focus location.
  • direction: direction of focus movement (GtkDirectionType)
  • Returns: true if focus ended up inside widget
child_notify(child_property)
Emits a "child-notify" signal for the child property child_property on widget. This is the analogue of GLib::Object#notify for child properties.
  • child_property: the name of a child property installed on the class of widget's parent
  • Returns: self
freeze_child_notify
Stops emission of "child-notify" signals on widget. The signals are queued until Gtk::Widget#thaw_child_notify is called on widget. This is the analogue of GLib:Object#freeze_notify for child properties.
  • Returns: self
thaw_child_notify
Reverts the effect of a previous call to Gtk::Widget#freeze_child_notify.
  • Returns: self
no_show_all=(no_show_all)
Sets the "no_show_all" property, which determines whether calls to Gtk::Widget#show_all and Gtk::Widget#hide_all will affect this widget. This is mostly for use in constructing widget hierarchies with externally controlled visibility, see Gtk::UIManager. Since 2.4
  • no_show_all: the new value for the "no_show_all" property (true or false)
  • Returns: no_show_all
set_no_show_all(no_show_all)
Same as . Since 2.4
  • no_show_all: the new value for the "no_show_all" property (true or false)
  • Returns: self
no_show_all?
Returns the current value of the "no_show_all" property, which determines whether calls to Gtk::Widget#show_all and Gtk::Widget#hide_all will affect this widget. Since 2.4
  • Returns: the current value of the "no_show_all" property. (true or false)
mnemonic_labels
Returns an Array of the widgets, normally labels, for which self is the target of a mnemonic (see for example, Gtk::Label#set_mnemonic_widget). Since 2.4
  • Returns: the Array of mnemonic labels
add_mnemonic_label(label)
Adds a widget to the list of mnemonic labels for self. (See Gtk::Widget#mnemonic_labels). Since 2.4
  • label: a Gtk::Widget that acts as a mnemonic label for widget
  • Returns: self
remove_mnemonic_label(label)
Removes a widget from the list of mnemonic labels for this widget. (See Gtk::Widget#mnemonic_labels). The widget must have previously been added to the list with Gtk::Widget#add_mnemonic_label. Since 2.4
child_visible?
Gets the value set with Gtk::Widget#child_visible=. If you feel a need to use this method, your code probably needs reorganization. This method is only useful for container implementations and never should be called by an application.
  • Returns: true if the widget is mapped with the parent.
child_visible=(is_visible)
Sets whether widget should be mapped along with its when its parent is mapped and widget has been shown with Gtk::Widget#show. The child visibility can be set for widget before it is added to a container with Gtk::Widget#parent=, to avoid mapping children unnecessary before immediately unmapping them. However it will be reset to its default state of true when the widget is removed from a container. Note that changing the child visibility of a widget does not queue a resize on the widget. Most of the time, the size of a widget is computed from all visible children, whether or not they are mapped. If this is not the case, the container can queue a resize itself. This method is only useful for container implementations and never should be called by an application.
  • is_visible: if true, widget should be mapped along with its parent.
  • Returns: is_visible
set_child_visible(is_visible)
Same as Gtk::Widget#child_visible=.
  • is_visible: if true, widget should be mapped along with its parent.
  • Returns: self
settings
Gets the settings object holding the settings (global property settings, RC file information, etc) used for this widget.
allocation
Gets the allocation value of this widget.
set_allocation(x, y, width, height)
Sets the allocation value of this widget.
composite_child?
Gets the value whether the widget is part of a composite widget.
  • Returns: true if the widget is part of a composite widget.
can_focus?
Gets the value whether the widget is able to handle focus grabs.
  • Returns: true if the widget is able to handle focus grabs.
can_focus=(setting)
Sets the value whether the widget is able to handle focus grabs.
  • setting: true if the widget is able to handle focus grabs
  • Returns: setting
set_can_focus(setting)
Same as Gtk::Widget#can_focus=.
  • setting: true if the widget is able to handle focus grabs
  • Returns: self
has_focus?
Gets the value whether the widget has the input focus.
  • Returns: true if the widget has the input focus
has_focus=(setting)
Sets the value whether the widget has the input focus.
  • setting: true if the widget has the input focus
  • Returns: setting
set_has_focus
Same as Gtk::Widget#has_focus=.
  • setting: true if the widget has the input focus
  • Returns: setting
can_default?
Gets the value whether the widget can be the default widget.
  • Returns: true if the widget can be the default widget.
can_default=(setting)
Sets the value whether the widget can be the default widget.
  • setting: true if the widget can be the default widget
  • Returns: setting
set_can_default(setting)
Same as Gtk::Widget#can_default=.
  • setting: true if the widget can be the default widget
  • Returns: self
has_default?
Gets the value whether the widget is the default widget.
  • Returns: true if the widget is the default widget
has_default=(setting)
Sets the value whether the widget can be the default widget.
  • setting: true if the widget is the default widget
  • Returns: setting
set_has_default(setting)
Same as Gtk::Widget#has_default=.
  • setting: true if the widget is the default widget
  • Returns: self
drawable?
Gets the value whether the widget is mapped and visible. See Gtk::Widget#mapped? and Gtk::Widget#visible?
  • Returns: true if the widget is mapped and visible
mapped?
Gets the value whether the widget is mapped.
  • Returns: true if the widget is mapped
realized?
Gets the value whether the widget is realized.
  • Returns: true if the widget is realized
visible?
Gets the value whether the widget is visible.
  • Returns: true if the widget is visible
visible=(setting)
Sets the value whether the widget is visible.
  • setting: true if the widget is visible
  • Returns: setting
set_visible(setting)
Same as Gtk::Widget#visible=.
  • setting: true if the widget is visible
  • Returns: setting
has_grab?
Gets the value whether the widget is in the grab_widgets stack, and will be the preferred one for receiving events other than ones of cosmetic value.
  • Returns: true if the widget is in the grab_widgets stack, and will be the preferred one for receiving events other than ones of cosmetic value.
no_window?
Gets the value whether the widget doesn't have an own Gdk::Window.
  • Returns: true if the widget doesn't have an own Gdk::Window.
rc_style?
Gets the value whether the widgets style has been looked up through the rc mechanism.
  • Returns: true if the widgets style has been looked up through the rc mechanism
receives_default?
Gets the value whether the widget will receive the default action when it is focused.
  • Returns: true if the widget will receive the default action when it is focused
receives_default=(setting)
Sets the value whether the widget will receive the default action when it is focused.
  • setting: true if the widget will receive the default action when it is focused
  • Returns: setting
set_receives_default(setting)
Same as Gtk::Widget#receives_default=.
  • setting: true if the widget will receive the default action when it is focused
  • Returns: setting
requisition
Gets the requisition value of the widget.
  • Returns: [width, height]
ensure_style
Ensures that widget has a style. Not a very useful method; most of the time, if you want the style, the widget is realized, and realized widgets are guaranteed to have a style already.
  • Returns: self
window
Gets the Gdk::Window of the widget.
create_gl_context(share_list = nil, direct = true, render_type = Gdk::GL::RGBA_TYPE)

存在しない?

Ruby/GtkGlExt Creates a new Gdk::GLContext with the appropriate Gdk::GLDrawable for this widget. The GL context must be freed when you're finished with it. See also Gtk::Widget#gl_context.

set_gl_capability(glconfig, share_list = nil, direct = true, render_type = Gdk::GL::RGBA_TYPE)

存在しない?

Ruby/GtkGlExt Set the OpenGL-capability to the widget. This function prepares the widget for its use with OpenGL.

  • glconfig: a Gdk::GLConfig.
  • share_list: the Gdk::GLContext with which to share display lists and texture objects. nil indicates that no sharing is to take place.
  • direct: whether rendering is to be done with a direct connection to the graphics system.
  • render_type: Gdk::GL::RGBA_TYPE or Gdk::GL::COLOR_INDEX_TYPE (currently not used).
  • Returns: true if it is successful, false otherwise.
gl_capable?

存在しない?

Ruby/GtkGlExt Returns whether the widget is OpenGL-capable.

  • Returns: true if the widget is OpenGL-capable, false otherwise.
gl_config

存在しない?

Ruby/GtkGlExt Returns the Gdk::GLConfig referred by the widget.

gl_context

存在しない?

Ruby/GtkGlExt Returns the Gdk::GLContext with the appropriate Gdk::GLDrawable for this widget. Unlike the GL context returned by Gtk::Widget#create_gl_context, this context is owned by the widget. Gdk::GLContext is needed for the function Gdk::GLDrawable.begin, or for sharing display lists (see Gtk::Widget#set_gl_capability).

gl_window

存在しない?

Ruby/GtkGlExt Returns the Gdk::GLWindow owned by the widget.

gl_drawable

存在しない?

Ruby/GtkGlExt Returns the Gdk::GLDrawable owned by the widget. In fact, this is a macro that casts the result of Gtk::Widget#gl_window to Gdk::GLDrawable.

window=()
要編集
tooltip_window=()
要編集
saved_state()
要編集
set_requisition()
要編集
set_window()
要編集
composited?()
要編集
action()
要編集
trigger_tooltip_query()
要編集
tooltip_window()
要編集
set_tooltip_window()
要編集
has_screen?()
要編集
screen()
要編集
root_window()
要編集
display()
要編集
get_clipboard()
要編集
keynav_failed()
要編集
error_bell()
要編集
set_scroll_adjustments()
要編集
modify_cursor()
要編集
input_shape_combine_mask()
要編集
tooltip_text=()
要編集
set_tooltip_text()
要編集
tooltip_text()
要編集
tooltip_markup=()
要編集
set_tooltip_markup()
要編集
tooltip_markup()
要編集
has_tooltip=()
要編集
set_has_tooltip()
要編集
has_tooltip?()
要編集
focus=()
要編集
set_focus()
要編集
show_help()
要編集
popup_menu()
要編集
move_focus()
要編集
composited_changed()
要編集
has_rc_style?()

Ruby/GTK3 only

要編集

drag_source_add_uri_targets()

Ruby/GTK3 only

要編集

drag_source_add_image_targets()

Ruby/GTK3 only

要編集

drag_source_add_text_targets()

Ruby/GTK3 only

要編集

drag_source_get_target_list()

Ruby/GTK3 only

要編集

drag_source_set_target_list()

Ruby/GTK3 only

要編集

drag_source_unset()

Ruby/GTK3 only

要編集

drag_source_set_icon()

Ruby/GTK3 only

要編集

drag_source_set()

Ruby/GTK3 only

要編集

drag_threshold?()

Ruby/GTK3 only

要編集

drag_begin()

Ruby/GTK3 only

要編集

drag_unhighlight()

Ruby/GTK3 only

要編集

drag_highlight()

Ruby/GTK3 only

要編集

drag_get_data()

Ruby/GTK3 only

要編集

drag_dest_get_track_motion()

Ruby/GTK3 only

要編集

drag_dest_set_track_motion()

Ruby/GTK3 only

要編集

drag_dest_add_uri_targets()

Ruby/GTK3 only

要編集

drag_dest_add_image_targets()

Ruby/GTK3 only

要編集

drag_dest_add_text_targets()

Ruby/GTK3 only

要編集

drag_dest_set_target_list()

Ruby/GTK3 only

要編集

drag_dest_get_target_list()

Ruby/GTK3 only

要編集

drag_dest_find_target()

Ruby/GTK3 only

要編集

drag_dest_unset()

Ruby/GTK3 only

要編集

drag_dest_set_proxy()

Ruby/GTK3 only

要編集

drag_dest_set()

Ruby/GTK3 only

要編集

unset_state_flags()

Ruby/GTK3 only

要編集

shape_combine_region()

Ruby/GTK3 only

要編集

visual=()

Ruby/GTK3 only

要編集

set_visual()

Ruby/GTK3 only

要編集

support_multidevice=()

Ruby/GTK3 only

要編集

set_support_multidevice()

Ruby/GTK3 only

要編集

set_state_flags()

Ruby/GTK3 only

要編集

realized=()

Ruby/GTK3 only

要編集

set_realized()

Ruby/GTK3 only

要編集

mapped=()

Ruby/GTK3 only

要編集

set_mapped()

Ruby/GTK3 only

要編集

set_device_events()

Ruby/GTK3 only

要編集

set_device_enabled()

Ruby/GTK3 only

要編集

send_focus_change()

Ruby/GTK3 only

要編集

reset_style()

Ruby/GTK3 only

要編集

render_icon_pixbuf()

Ruby/GTK3 only

要編集

queue_draw_region()

Ruby/GTK3 only

要編集

queue_compute_expand()

Ruby/GTK3 only

要編集

override_symbolic_color()

Ruby/GTK3 only

要編集

override_font()

Ruby/GTK3 only

要編集

override_cursor()

Ruby/GTK3 only

要編集

override_color()

Ruby/GTK3 only

要編集

override_background_color()

Ruby/GTK3 only

要編集

input_shape_combine_region()

Ruby/GTK3 only

要編集

in_destruction?()

Ruby/GTK3 only

要編集

has_visible_focus?()

Ruby/GTK3 only

要編集

support_multidevice?()

Ruby/GTK3 only

要編集

style_context()

Ruby/GTK3 only

要編集

state_flags()

Ruby/GTK3 only

要編集

request_mode()

Ruby/GTK3 only

要編集

get_preferred_width_for_height()

Ruby/GTK3 only

要編集

preferred_width()

Ruby/GTK3 only

要編集

preferred_size()

Ruby/GTK3 only

要編集

get_preferred_height_for_width()

Ruby/GTK3 only

要編集

preferred_height()

Ruby/GTK3 only

要編集

get_device_events()

Ruby/GTK3 only

要編集

get_device_enabled?()

Ruby/GTK3 only

要編集

allocated_width()

Ruby/GTK3 only

要編集

allocated_height()

Ruby/GTK3 only

要編集

draw()

Ruby/GTK3 only

要編集

device_is_shadowed?()

Ruby/GTK3 only

要編集

compute_expand()

Ruby/GTK3 only

要編集

add_device_events()

Ruby/GTK3 only

要編集

has_window=()

Ruby/GTK3 only

要編集

set_has_window()

Ruby/GTK3 only

要編集

has_window?()

Ruby/GTK3 only

要編集

bindings_activate()

Ruby/GTK3 only

要編集

destroy()

Ruby/GTK3 only

要編集

allocation=()

Ruby/GTK3 only

要編集

scale_factor()

Ruby/GTK3 only

要編集

expand=()

Ruby/GTK3 only

要編集

set_expand()

Ruby/GTK3 only

要編集

expand?()

Ruby/GTK3 only

要編集

vexpand_set=()

Ruby/GTK3 only

要編集

set_vexpand_set()

Ruby/GTK3 only

要編集

vexpand_set?()

Ruby/GTK3 only

要編集

hexpand_set=()

Ruby/GTK3 only

要編集

set_hexpand_set()

Ruby/GTK3 only

要編集

hexpand_set?()

Ruby/GTK3 only

要編集

vexpand=()

Ruby/GTK3 only

要編集

set_vexpand()

Ruby/GTK3 only

要編集

vexpand?()

Ruby/GTK3 only

要編集

hexpand=()

Ruby/GTK3 only

要編集

set_hexpand()

Ruby/GTK3 only

要編集

hexpand?()

Ruby/GTK3 only

要編集

margin=()

Ruby/GTK3 only

要編集

set_margin()

Ruby/GTK3 only

要編集

margin()

Ruby/GTK3 only

要編集

margin_bottom=()

Ruby/GTK3 only

要編集

set_margin_bottom()

Ruby/GTK3 only

要編集

margin_bottom()

Ruby/GTK3 only

要編集

margin_top=()

Ruby/GTK3 only

要編集

set_margin_top()

Ruby/GTK3 only

要編集

margin_top()

Ruby/GTK3 only

要編集

margin_right=()

Ruby/GTK3 only

要編集

set_margin_right()

Ruby/GTK3 only

要編集

margin_right()

Ruby/GTK3 only

要編集

margin_left=()

Ruby/GTK3 only

要編集

set_margin_left()

Ruby/GTK3 only

要編集

margin_left()

Ruby/GTK3 only

要編集

valign=()

Ruby/GTK3 only

要編集

set_valign()

Ruby/GTK3 only

要編集

valign()

Ruby/GTK3 only

要編集

halign=()

Ruby/GTK3 only

要編集

set_halign()

Ruby/GTK3 only

要編集

halign()

Ruby/GTK3 only

要編集

opacity=()

Ruby/GTK3 only

要編集

set_opacity()

Ruby/GTK3 only

要編集

opacity()

Ruby/GTK3 only

要編集

定数

GtkTextDirection

TEXT_DIR_NONE
Ruby/GTK3 では非推奨
TEXT_DIR_LTR
Ruby/GTK3 では非推奨
TEXT_DIR_RTL
Ruby/GTK3 では非推奨

GtkWidgetFlags

Tells about certain properties of the widget.

TOPLEVEL

Ruby/GTK2 only

widgets without a real parent, as there are windows(Gtk::Window) and menus(Gtk::Menu) have this flag set throughout their lifetime. Toplevel widgets always contain their own Gdk::Window.

NO_WINDOW

Ruby/GTK2 only

Indicative for a widget that does not provide its own Gdk::Window. Visible action (e.g. drawing) is performed on the parent's Gdk::Window.

REALIZED

Ruby/GTK2 only

Set by Gtk::Widget#realize, unset by Gtk::Widget#unrealize. A realized widget has an associated GdkWindow.

MAPPED

Ruby/GTK2 only

Set by Gtk::Widget#map, unset by Gtk::Widget#unmap. Only realized widgets can be mapped. It means that Gdk::Window#show has been called on the widgets window(s).

VISIBLE

Ruby/GTK2 only

Set by Gtk::Widget#show, unset by Gtk::Widget#hide. Implies that a widget will be mapped as soon as its parent is mapped.

SENSITIVE

Ruby/GTK2 only

Set and unset by Gtk::Widget#sensitive=. The sensitivity of a widget determines whether it will receive certain events (e.g. button or key presses). One premise for the widgets sensitivity is to have this flag set.

PARENT_SENSITIVE

Ruby/GTK2 only

Set and unset by Gtk::Widget#sensitive= operations on the parents of the widget. This is the second premise for the widgets sensitivity. Once it has Gtk::Widget::SENSITIVE and Gtk::Widget::PARENT_SENSITIVE set, its state is effectively sensitive. This is expressed (and can be examined) by the Gtk::Widget#sensitive_with_parent.

CAN_FOCUS

Ruby/GTK2 only

Determines whether a widget is able to handle focus grabs.

HAS_FOCUS

Ruby/GTK2 only

Set by Gtk::Widget#grab_focus for widgets that also have Gtk::Widget::CAN_FOCUS set. The flag will be unset once another widget grabs the focus.

CAN_DEFAULT

Ruby/GTK2 only

The widget is allowed to receive the default action via Gtk::Widget#grab_default.

HAS_DEFAULT

Ruby/GTK2 only

Set by Gtk::Widget#grab_focus for widgets that also have Gtk::Widget::CAN_FOCUS set. The flag will be unset once another widget grabs the focus.

HAS_GRAB

Ruby/GTK2 only

Set by Gtk.grab_add, unset by Gtk.grab_remove. It means that the widget is in the grab_widgets stack, and will be the preferred one for receiving events other than ones of cosmetic value.

RC_STYLE

Ruby/GTK2 only

Indicates that the widgets style has been looked up through the rc mechanism. It does not imply that the widget actually had a style defined through the rc mechanism.

COMPOSITE_CHILD

Ruby/GTK2 only

Indicates that the widget is a composite child of its parent; see Gtk::Widget#push_composite_child, Gtk::Widget.pop_composite_child.

APP_PAINTABLE

Ruby/GTK2 only

Set and unset by Gtk::Widget#app_paintable=. Must be set on widgets whose window the application directly draws on, in order to keep GTK+ from overwriting the drawn stuff.

RECEIVES_DEFAULT

Ruby/GTK2 only

The widget when focused will receive the default action and have Gtk::Widget::HAS_DEFAULT set even if there is a different widget set as default.

DOUBLE_BUFFERED

Ruby/GTK2 only

Set and unset by Gtk::Widget#double_buffered=. Indicates that exposes done on the widget should be double-buffered.

NO_SHOW_ALL (Gtk::Widget::Flags)

Ruby/GTK2 only

要編集

NO_REPARENT (Gtk::Widget::Flags)

Ruby/GTK2 only

要編集

GtkWidgetHelpType

HELP_TOOLTIP
Ruby/GTK3では非推奨
HELP_WHATS_THIS
Ruby/GTK3では非推奨

プロパティ

app-paintable: true or false (Read/Write)
Whether the application will paint directly on the widget
can-default: true or false (Read/Write)
Whether the widget can be the default widget
can-focus: true or false (Read/Write)
Whether the widget can accept the input focus
composite-child: true or false (Read)
Whether the widget is part of a composite widget
events: Integer (Read/Write)
The event mask that decides what kind of Gdk::Events? this widget gets
extension-events: Integer (Read/Write)

Ruby/GTK2 only

The mask that decides what kind of extension events this widget gets

has-default: true or false (Read/Write)
Whether the widget is the default widget
has-focus: true or false (Read/Write)
Whether the widget has the input focus
height-request: Integer (Read/Write)
Override for height request of the widget, or -1 if natural request should be used
is-focus: true or false (Read/Write)
Whether the widget is the focus widget within the toplevel
name: String (Read/Write)
The name of the widget
no-show-all: true or false (Read/Write)
Whether Gtk::Widget#show_all should not affect this widget. Default: false. Since 2.4
parent: Gtk::Container (Read/Write)
The parent widget of this widget. Must be a Container widget
receives-default: true or false (Read/Write)
If true, the widget will receive the default action when it is focused
sensitive: true or false (Read/Write)
Whether the widget responds to input
style: Gtk::Style (Read/Write)
The style of the widget, which contains information about how it will look (colors etc)
visible: true or false (Read/Write)
Whether the widget is visible
width-request: Integer (Read/Write)
Override for width request of the widget, or -1 if natural request should be used
double-buffered:
要編集
window:
要編集
tooltip-text:
要編集
tooltip-markup:
要編集
has-tooltip:
要編集
scale-factor:

Ruby/GTK3 only

要編集

expand:

Ruby/GTK3 only

要編集

vexpand-set:

Ruby/GTK3 only

要編集

hexpand-set:

Ruby/GTK3 only

要編集

vexpand:

Ruby/GTK3 only

要編集

hexpand:

Ruby/GTK3 only

要編集

margin:

Ruby/GTK3 only

要編集

margin-bottom:

Ruby/GTK3 only

要編集

margin-top:

Ruby/GTK3 only

要編集

margin-right:

Ruby/GTK3 only

要編集

margin-left:

Ruby/GTK3 only

要編集

valign:

Ruby/GTK3 only

要編集

halign:

Ruby/GTK3 only

要編集

opacity:

Ruby/GTK3 only

要編集

シグナル

accel-closures-changed: self
button-press-event: self, event
button-release-event: self, event
child-notify: self, arg1
client-event: self, event
Ruby/GTK2 only
configure-event: self, event
delete-event: self, event
destroy-event: self, event
direction-changed: self, dir_type
drag-begin: self, drag_context
drag-data-delete: self, drag_context
drag-data-get: self, drag_context, data, info, time
drag-data-received: self, drag_context, x, y, data, info, time
drag-drop: self, drag_context, x, y, time
drag-end: self, drag_context
drag-leave: self, drag_context, time
drag-motion: self, drag_context, x, y, time
enter-notify-event: self, event
event: self, event
event-after: self, event
expose-event: self, event
Ruby/GTK2 only
focus: self, dir_type
focus-in-event: self, event
focus-out-event: self, event
grab-broken-event: self, event
Since 2.8
grab-focus: self
grab-notify: self, arg1
hide: self
hierarchy-changed: self, widget
Emitted when there is a chance in the hierarchy to which a widget belong. More precisely, a widget is anchored when its toplevel ancestor is a Gtk::Window. This signal is emitted when a widget changes from un-anchored to anchored or vice-versa.
key-press-event: self, event
key-release-event: self, event
leave-notify-event: self, event
map: self
map-event: self, event
mnemonic-activate: self, arg1
motion-notify-event: self, event
no-expose-event: self, event
Ruby/GTK2 only
parent-set: self, old_parent
popup-menu: self
property-notify-event: self, event
proximity-in-event: self, event
proximity-out-event: self, event
realize: self
scroll-event: self, event
selection-clear-event: self, event
selection-get: self, data, info, time
selection-notify-event: self, event
selection-received: self, data, time
selection-request-event: self, event
show: self
show-help: self, help_type
size-allocate: self, allocation
size-request: self, requisition
Ruby/GTK2 only
state-changed: self, state
style-set: self, previous_style
unmap: self
unmap-event: self, event
unrealize: self
visibility-notify-event: self, event
window-state-event: self, event
can-activate-accel:
要編集
screen-changed:
要編集
query-tooltip:
要編集
damage-event:
要編集
drag-failed:
要編集
keynav-failed:
要編集
move-focus:
要編集
composited-changed:
要編集
touch-event:

Ruby/GTK3 only

要編集

draw:

Ruby/GTK3 only

要編集

style-updated:

Ruby/GTK3 only

要編集

state-flags-changed:

Ruby/GTK3 only

要編集

destroy:

Ruby/GTK3 only

要編集

更新履歴

  • 2014-09-11 更新時点でのRuby/GTK3関連の情報を追加。 - きたがわ
  • 2014-06-16 クラスのメンバ項目の存在チェック("存在しない?"or"上位クラスのページに要移動?"とマーク)。リストから漏れているものを追加。 - きたがわ
  • - Masao?
更新日時:2014/09/11 15:18:55
キーワード:
参照:[Gtk::HScrollbar] [Gtk::Range] [gtk2-tut-dialog] [Gtk::ComboBox] [Gtk::InputDialog] [Gtk::TargetList] [GtkSource::View] [Gtk::FontButton] [gtk2-tut-manualmenu] [Gtk::ScrolledWindow] [Gtk::SpinButton] [Pango::Context] [Gtk::TearoffMenuItem] [Vte::Terminal] [Gtk::Separator] [Gtk::Button] [Gtk::MozEmbed] [Gtk::ColorSelection] [Gtk::FileChooserButton] [アイテムファクトリ] [libglade2-tut-tips] [Gtk::TreeViewColumn] [Gtk::TreeView] [Gtk::Notebook] [Gtk::MessageDialog] [Gtk::SelectionData] [Gtk::Selection] [Gtk::FileChooserWidget] [Gtk::TrayIcon] [Gtk::RC] [Gtk::HScale] [Gtk::VBox] [Gtk::Alignment] [Gtk::HPaned] [Gtk::Viewport] [Gtk::Container] [Gtk::RadioMenuItem] [Gtk::ComboBoxEntry] [Gtk::AboutDialog] [Gtk::AspectFrame] [Gtk::VSeparator] [Ruby/GtkGLExt] [Gtk::Dialog] [Gtk::ToolItem] [Gtk::VScrollbar] [Gtk::BindingSet] [Gtk::Window] [Gtk::IconFactory] [Gtk::Entry] [Gtk::Item] [Gtk::HBox] [Gtk::CellView] [Gdk::Window] [Gtk::Expander] [Ruby/GTK] [Gtk::UIManager] [Ruby/GTK Object Hierarchy] [Gtk::CheckMenuItem] [マウスカーソル] [Gtk::ActionGroup] [Gtk::FileChooserDialog] [GladeXML] [Gtk::Table] [Gtk::FileChooser] [Gtk::DrawingArea] [Gtk::Action] [Gtk::ToolButton] [Gtk::MenuItem] [Gtk::Invisible] [Gtk::HSeparator] [Gtk::RadioButton] [Gtk::Toolbar] [Gtk::Curve] [gtk2-tut-button] [Gtk::Style] [Gtk::Fixed] [gtk2-tut-widget-overview] [Gtk::IconSize] [Gtk::ProgressBar] [Gtk::SeparatorToolItem] [Gtk::ColorSelectionDialog] [ウインドウ] [Gtk::Layout] [Gtk::IconSource] [Gtk::Ruler] [Gtk::SeparatorMenuItem] [Gtk] [Gtk::MenuShell] [Gtk::Box] [Gtk::SizeGroup] [Hello Worldの詳細] [Gtk::Calendar] [Gtk::HandleBox] [Gtk::Combo] [Gtk::OptionMenu] [Gtk::ColorButton] [Gtk::Misc] [Gtk::IconView] [Gtk::MenuToolButton] [Gtk::HRuler] [Gtk::ImageMenuItem] [Gtk::Widget] [Gtk::Scrollbar] [Gtk::CheckButton] [Gtk::VScale] [Gtk::VPaned] [Gtk::AccelLabel] [Gtk::Drag] [Gtk::Tooltips] [Gtk::Plug] [Gtk::Assistant] [Gtk::TextView] [gtk2-tut-label] [Gtk::FontSelection] [Gtk::IconSet] [Gtk::Label] [Gtk::TextTag] [Gtk::ButtonBox] [Gtk::Socket] [Gtk::Arrow] [Gdk::Pango] [Gtk::EventBox] [Gtk::SourceView] [Gtk::ToggleButton] [Gtk::Paned] [Gtk::ToggleToolButton] [Gtk::Image] [Gtk::FontSelectionDialog] [Gtk::Frame] [Gtk::MenuBar] [Gtk::Menu] [セパレータ] [Gtk::ItemFactory] [Gtk::VButtonBox] [Gtk::Scale] [Gtk::FileSelection] [Gtk::VRuler] [Gtk::Progress] [Gtk::HButtonBox] [Gtk::Statusbar] [Gtk::CellRenderer] [Gtk::RadioToolButton] [Gtk::Bin]