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

Back to archive index

ruby-****@lists***** ruby-****@lists*****
2003年 4月 23日 (水) 16:34:10 JST


-------------------------
REMOTE_ADDR = 61.204.181.66
REMOTE_HOST = 
-------------------------
= class Gtk::Paned
Gtk::Paned is the base class for widgets with two panes, arranged either horizontally (Gtk::HPaned) or vertically (Gtk::VPaned). Child widgets are added to the panes of the widget with Gtk::Paned#pack1 and Gtk::Paned#pack2. The division beween the two children is set by default from the size requests of the children, but it can be adjusted by the user.

A paned widget draws a separator between the two child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator. (The space in which the separator is called the gutter.) Often, it is useful to put each child inside a Gtk::Frame with the shadow type set to Gtk::SHADOW_IN so that the gutter appears as a ridge.

Each child has two options that can be set, resize and shrink. If resize is true, then when the Gtk::Paned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then when that child can be made smaller than it's requisition by the user. Setting shrink to false allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children.

The application can set the position of the slider as if it were set by the user, by calling Gtk::Paned#position=.

=== Example 1. Creating a paned widget with minimum sizes.

  require 'gtk2'
  
  Gtk.init
  
  hpaned = Gtk::HPaned.new
  frame1 = Gtk::Frame.new
  frame2 = Gtk::Frame.new
  frame1.shadow_type = Gtk::SHADOW_IN
  frame2.shadow_type = Gtk::SHADOW_IN
  
  hpaned.set_size_request(200, -1)
  hpaned.pack1(frame1, true, false)
  hpaned.pack2(frame2, false, false)
  frame1.set_size_request(50, -1)
  
  Gtk::Window.new.add(hpaned).set_default_size(300, 100).show_all
  
  Gtk.main 

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

== public instance methods
--- add1(child)
    Adds a child to the top or left pane with default parameters. This is equivalent to Gtk::Paned#pack1 (child, false, true).
    * child: the child to add
    * Returns: self

--- add2(child)
    Adds a child to the bottom or right pane with default parameters. This is equivalent to Gtk::Paned#pack2 (child, false, true).
    * child: the child to add
    * Returns: self

--- pack1(child, resize, shrink)
    Adds a child to the top or left pane.
    * child: the child to add.
    * resize: true if this child should expand when the paned widget is resized. 
    * shrink: true if this child can be made smaller than its requsition.  

--- pack2(child, resize, shrink)
    Adds a child to the bottom or right pane.
    * child: the child to add.
    * resize: true if this child should expand when the paned widget is resized. 
    * shrink: true if this child can be made smaller than its requsition.  

--- position
    Obtains the position of the divider between the two panes.
    * Returns: position of the divider 

--- position=(position)
    Sets the position of the divider between the two panes.
    * position: pixel position of divider, a negative value means that the position is unset. 
    * Returns: position

--- set_position(position)
    Same as position=.
    * position: pixel position of divider, a negative value means that the position is unset. 
    * Returns: self

--- position_set?
    Gets the value whether the position property should be used.
    * Returns: true if the position property should be used.
--- position_set=(val)
    Sets the value whether the position property should be used.
    * val: true if the position property should be used.
    * Returns: val
--- set_position_set(val)
    Same as position_set=.
    * val: true if the position property should be used.
    * Returns: val

--- child1
    Gets the child1 widget.
    * Returns: child1
--- child1_resize?
    Gets the value whether the child1 is resizable.
    * Returns: true if the child1 is resizable.
--- child1_shrink?
    Gets the value whether the child1 is shrinkable.
    * Returns: true if the child1 is shrinkable.

--- child2
    Gets the child2 widget.
    * Returns: child2
--- child2_resize?
    Gets the value whether the child2 is resizable.
    * Returns: true if the child2 is resizable.
--- child2_shrink?
    Gets the value whether the child2 is shrinkable.
    * Returns: true if the child2 is shrinkable.

== signals
--- accept-position: paned
     * paned: Gtk::Paned
--- cancel-position: paned
     * paned: Gtk::Paned
--- cycle-child-focus: paned, arg1
     * paned: Gtk::Paned
     * arg1:
--- cycle-handle-focus: paned, arg1
     * paned: Gtk::Paned
     * arg1:
--- move-handle: paned, arg1
     * paned: Gtk::Paned
     * arg1:
--- toggle-handle-focus: paned
     * paned: Gtk::Paned

((<Masao>))

-------------------------
= class Gtk::Paned
Gtk::Paned is the base class for widgets with two panes, arranged either horizontally (Gtk::HPaned) or vertically (Gtk::VPaned). Child widgets are added to the panes of the widget with Gtk::Paned#pack1 and Gtk::Paned#pack2. The division beween the two children is set by default from the size requests of the children, but it can be adjusted by the user.

A paned widget draws a separator between the two child widgets and a small handle that the user can drag to adjust the division. It does not draw any relief around the children or around the separator. (The space in which the separator is called the gutter.) Often, it is useful to put each child inside a Gtk::Frame with the shadow type set to Gtk::SHADOW_IN so that the gutter appears as a ridge.

Each child has two options that can be set, resize and shrink. If resize is true, then when the Gtk::Paned is resized, that child will expand or shrink along with the paned widget. If shrink is true, then when that child can be made smaller than it's requisition by the user. Setting shrink to false allows the application to set a minimum size. If resize is false for both children, then this is treated as if resize is true for both children.

The application can set the position of the slider as if it were set by the user, by calling Gtk::Paned#position=.

=== Example 1. Creating a paned widget with minimum sizes.

  require 'gtk2'
  
  Gtk.init
  
  hpaned = Gtk::HPaned.new
  frame1 = Gtk::Frame.new
  frame2 = Gtk::Frame.new
  frame1.shadow_type = Gtk::SHADOW_IN
  frame2.shadow_type = Gtk::SHADOW_IN
  
  hpaned.set_size_request(200, -1)
  hpaned.pack1(frame1, true, false)
  hpaned.pack2(frame2, false, false)
  frame1.set_size_request(50, -1)
  
  Gtk::Window.new.add(hpaned).set_default_size(300, 100).show_all
  
  Gtk.main 

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

== public instance methods
--- add1(child)
    Adds a child to the top or left pane with default parameters. This is equivalent to Gtk::Paned#pack1 (child, false, true).
    * child: the child to add
    * Returns: self

--- add2(child)
    Adds a child to the bottom or right pane with default parameters. This is equivalent to Gtk::Paned#pack2 (child, false, true).
    * child: the child to add
    * Returns: self

--- pack1(child, resize, shrink)
    Adds a child to the top or left pane.
    * child: the child to add.
    * resize: true if this child should expand when the paned widget is resized. 
    * shrink: true if this child can be made smaller than its requsition.  

--- pack2(child, resize, shrink)
    Adds a child to the bottom or right pane.
    * child: the child to add.
    * resize: true if this child should expand when the paned widget is resized. 
    * shrink: true if this child can be made smaller than its requsition.  

--- position
    Obtains the position of the divider between the two panes.
    * Returns: position of the divider 

--- position=(position)
    Sets the position of the divider between the two panes.
    * position: pixel position of divider, a negative value means that the position is unset. 
    * Returns: position

--- set_position(position)
    Same as position=.
    * position: pixel position of divider, a negative value means that the position is unset. 
    * Returns: self

--- position_set?
    Gets the value whether the position property should be used.
    * Returns: true if the position property should be used.
--- position_set=(val)
    Sets the value whether the position property should be used.
    * val: true if the position property should be used.
    * Returns: val
--- set_position_set(val)
    Same as position_set=.
    * val: true if the position property should be used.
    * Returns: val

--- child1
    Gets the child1 widget.
    * Returns: child1
--- child1_resize?
    Gets the value whether the child1 is resizable.
    * Returns: true if the child1 is resizable.
--- child1_shrink?
    Gets the value whether the child1 is shrinkable.
    * Returns: true if the child1 is shrinkable.

--- child2
    Gets the child2 widget.
    * Returns: child2
--- child2_resize?
    Gets the value whether the child2 is resizable.
    * Returns: true if the child2 is resizable.
--- child2_shrink?
    Gets the value whether the child2 is shrinkable.
    * Returns: true if the child2 is shrinkable.

== signals
--- accept-position: paned
     * paned: Gtk::Paned
--- cancel-position: paned
     * paned: Gtk::Paned
--- cycle-child-focus: paned, arg1
     * paned: Gtk::Paned
     * arg1: true or false
--- cycle-handle-focus: paned, arg1
     * paned: Gtk::Paned
     * arg1: true or false
--- move-handle: paned, arg1
     * paned: Gtk::Paned
     * arg1: ((<GtkScrollType|Gtk#GtkScrollType>))
--- toggle-handle-focus: paned
     * paned: Gtk::Paned

((<Masao>))




ruby-gnome2-cvs メーリングリストの案内
Back to archive index