[ruby-gnome2-doc-cvs] [Hiki] update - Gtk::Widget

アーカイブの一覧に戻る

ruby-****@lists***** ruby-****@lists*****
2003年 5月 7日 (水) 19:03:04 JST


-------------------------
REMOTE_ADDR = 61.204.181.66
REMOTE_HOST = 
-------------------------

-------------------------
= class Gtk::Widget

== super class
* ((<Gtk::Object>))

== included modules
* ((<Atk::ImplementorIface>))

== class methods
--- Gtk::Widget.default_colormap
    Obtains the default colormap used to create widgets.
    * Returns: default widget colormap 
--- Gtk::Widget.set_default_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.
    * colormap : a Gdk::Colormap 

--- 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.
    * dir: the new default direction(((<GtkTextDirection|URL:#GtkTextDirection>)). This cannot be Gtk::Widget::TEXT_DIR_NONE. 
    * Returns: dir

--- 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.
    * cmap: a Gdk::Colormap
    * Returns: cmap
--- 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

== public instance methods
--- 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.
--- unmap
    This method is only for use in widget implementations. Causes a widget to be unmapped if it's currently mapped.

--- 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.
--- 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).

--- queue_draw
    Equivalent to calling Gtk::Widget#queue_draw_area for the entire area of a widget.
--- 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.

--- 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.
    * Returns: a [width, height]

    ((*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.

--- 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.
    * Returns: [width, height]

    ((*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.

--- 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

--- 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->, 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.

--- 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.
    * accel_signal: widget signal to emit on accelerator activation (String) 
    * accel_group: a Gtk::AccelGroup for this widget, added to its toplevel 
    * accel_key: GDK keyval of the accelerator(Gdk::Keyval)
    * accel_mods: modifier key combination of the accelerator(((<GdkModifierType|Gdk::Window#GdkModifierType>)))
    * accel_flags: flag accelerators(((<GtkAccelFlags|Gtk#GtkAccelFlags>))), e.g. Gtk::ACCEL_VISIBLE
    * Returns: self

--- 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|Gdk::Window#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

--- list_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)

--- queue_draw_area

--- activate?
--- add_events
--- allocation
--- ancestor
--- ancestor?
--- app_paintable=
--- app_paintable?
--- button_press_event
--- button_release_event
--- can_default=
--- can_default?
--- can_focus=
--- can_focus?
--- child_visible=
--- class_path
--- client_event
--- colormap
--- colormap=
--- composite_child?
--- composite_name
--- composite_name=
--- configure_event
--- create_pango_context
--- create_pango_layout
--- delete_event
--- destroy_event
--- direction
--- direction=
--- double_buffered=
--- double_buffered?
--- drawable?
--- ensure_style
--- enter_notify_event
--- event
--- events
--- events=
--- expose_event
--- extension_events
--- extension_events=
--- focus_in_event
--- focus_out_event
--- grab_default
--- grab_focus
--- has_default=
--- has_default?
--- has_focus=
--- has_focus?
--- has_grab?
--- height_request
--- height_request=
--- hide_on_delete
--- intersect
--- key_press_event
--- key_release_event
--- leave_notify_event
--- map_event
--- mapped?
--- mnemonic_activate?
--- modifier_style
--- modify_base
--- modify_bg
--- modify_fg
--- modify_font
--- modify_style
--- modify_text
--- motion_notify_event
--- name
--- name=
--- no_expose_event
--- no_window?
--- pango_context
--- parent
--- parent=
--- parent_sensitive?
--- parent_window
--- parent_window=
--- path
--- pointer
--- property_notify_event
--- proximity_in_event
--- proximity_out_event
--- rc_style?
--- realized?
--- receives_default=
--- receives_default?
--- redraw_on_allocate=
--- render_icon
--- reparent
--- requisition
--- reset_rc_styles
--- reset_shapes
--- scroll_event
--- selection_clear_event
--- selection_notify_event
--- selection_request_event
--- sensitive=
--- sensitive?
--- sensitive_with_parent?
--- set_allocation
--- set_app_paintable
--- set_can_default
--- set_can_focus
--- set_child_visible
--- set_colormap
--- set_composite_name
--- set_direction
--- set_double_buffered
--- set_events
--- set_extension_events
--- set_has_default
--- set_has_focus
--- set_height_request
--- set_name
--- set_parent
--- set_parent_window
--- set_receives_default
--- set_redraw_on_allocate
--- set_requisition
--- set_scroll_adjustment
--- set_sensitive
--- set_state
--- set_style
--- set_visible
--- set_width_request
--- shape_combine_mask
--- state
--- state=
--- style
--- style=
--- thaw_child_notify
--- toplevel
--- toplevel?
--- translate_coordinates
--- unmap_event
--- visibility_notify_event
--- visible=
--- visible?
--- visual
--- width_request
--- width_request=
--- window
--- window_state_event

== constants
--- APP_PAINTABLE
--- CAN_DEFAULT
--- CAN_FOCUS
--- COMPOSITE_CHILD
--- DOUBLE_BUFFERED
--- HAS_DEFAULT
--- HAS_FOCUS
--- HAS_GRAB
--- HELP_TOOLTIP
--- HELP_WHATS_THIS
--- MAPPED
--- NO_REPARENT
--- NO_WINDOW
--- PARENT_SENSITIVE
--- RC_STYLE
--- REALIZED
--- RECEIVES_DEFAULT
--- SENSITIVE
--- TEXT_DIR_LTR
--- TEXT_DIR_NONE
--- TEXT_DIR_RTL
--- TOPLEVEL
--- VISIBLE

== See Also



ruby-gnome2-cvs メーリングリストの案内
アーカイブの一覧に戻る