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

アーカイブの一覧に戻る

ruby-****@lists***** ruby-****@lists*****
2003年 3月 24日 (月) 15:50:03 JST


-------------------------
REMOTE_ADDR = 61.204.181.66
REMOTE_HOST = 
-------------------------
= class Gtk::Button
The Gtk::Button widget is generally used to attach a function to that is called when the button is pressed. The various signals and how to use them are outlined below. 

The Gtk::Button widget can hold any valid child widget. That is it can hold most any other standard Gtk::Widget. The most commonly used child is the Gtk::Label. 


== super class
* Gtk::Bin

== class methods
--- Gtk::Button.new
    Creates a Gtk::Button widget.
    * Returns: The newly created Gtk::Button widget.  

--- Gtk::Button.new(text, use_underline = true)
    Creates a Gtk::Button widget with a Gtk::Label child containing the given text.
    * text: The text you want the Gtk::Label to hold.  
    * use_underline: If true and characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.
    * Returns: The newly created Gtk::Button widget.  

--- Gtk::Button.new(stock_id)
    Creates a new Gtk::Button containing the image and text from a stock item(constants of Gtk::Stock). For example, Gtk::Stock::OK, Gtk::Stock::APPLY. 
    * Returns: The newly created Gtk::Button widget.  

== public instance methods
--- pressed
    Emits a 'pressed' signal to itself. 
    * Returns: self
--- released
    Emits a 'released' signal to itself. 
--- clicked
    Emits a 'clicked' signal to itself. 
--- enter
    Emits a 'enter' signal to itself. 
--- leave
    Emits a 'leave' signal to itself. 

--- relief
    Returns the current relief style of the given Gtk::Button. 
    * Returns: The current GtkReliefStyle  
--- relief=(newstyle)
    Sets the relief style of the edges of the given Gtk::Button widget. Three styles exist, Gtk::RELIEF_NORMAL, Gtk::RELIEF_HALF, Gtk::RELIEF_NONE. The default style is, as one can guess, Gtk::RELIEF_NORMAL.     
    * newstyle: The ((<GtkReliefStyle|Gtk.GtkReliefStyle>)) as described above.  
    * Returns: newstyle

--- set_relief(newstyle)
    Same as relief=.
    * newstyle: The GtkReliefStyle.
    * Returns: self

--- label
    Fetches the text from the label of the button, as set by Gtk::Button#label=. If the label text has not been set the return value will be nil. This will be the case if you create an empty button with Gtk::Button.new to use as a container.
    * Returns: The text of the label widget.
--- label=(text)
    Sets the text of the label of the button to str. This text is also used to select the stock item if Gtk::Button#use_stock= is used. 
    This will also clear any previously set labels.
    * text: a string for the label text, a constant of Gtk::Stock for the stock item.
    * Returns: text
--- set_label(text)
    Same as label=.
    * text: a string for the label text, a constant of Gtk::Stock for the stock item.
    * Returns: self

--- use_stock?
    Returns whether the button label is a stock item.
--- use_stock=(use_stock)
    If true, the label set on the button is used as a stock id to select the stock item for the button.
    * use_stock: true if the button should use a stock item  
    * Returns: use_stock

--- set_use_stock(use_stock)
    Same as use_stock=.
    * use_stock: true if the button should use a stock item  
    * Returns: self

--- use_underline?
    Returns whether an embedded underline in the button label indicates a mnemonic. See Gtk::Button#use_underline=.
    * Returns: true if an embedded underline in the button label indicates the mnemonic accelerator keys.  
--- use_underline=(use_underline)
    If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
    * use_underline: true if underlines in the text indicate mnemonics  
    * Returns: use_underline

--- set_use_underline(use_underline)
    Same as use_underline=.
    * use_underline: true if underlines in the text indicate mnemonics  
    * Returns: self

== signals
--- activate: self
     * self: Gtk::Button

--- clicked: self
     * self: Gtk::Button

--- enter: self
     * self: Gtk::Button

--- leave: self
     * self: Gtk::Button

--- pressed: self
     * self: Gtk::Button

--- released: self
     * self: Gtk::Button

- Masao
-------------------------
= class Gtk::Button
The Gtk::Button widget is generally used to attach a function to that is called when the button is pressed. The various signals and how to use them are outlined below. 

The Gtk::Button widget can hold any valid child widget. That is it can hold most any other standard Gtk::Widget. The most commonly used child is the Gtk::Label. 


== super class
* Gtk::Bin

== class methods
--- Gtk::Button.new
    Creates a Gtk::Button widget.
    * Returns: The newly created Gtk::Button widget.  

--- Gtk::Button.new(text, use_underline = true)
    Creates a Gtk::Button widget with a Gtk::Label child containing the given text.
    * text: The text you want the Gtk::Label to hold.  
    * use_underline: If true and characters in label are preceded by an underscore, they are underlined. If you need a literal underscore character in a label, use '__' (two underscores). The first underlined character represents a keyboard accelerator called a mnemonic. Pressing Alt and that key activates the button.
    * Returns: The newly created Gtk::Button widget.  

--- Gtk::Button.new(stock_id)
    Creates a new Gtk::Button containing the image and text from a stock item(constants of Gtk::Stock). For example, Gtk::Stock::OK, Gtk::Stock::APPLY. 
    * Returns: The newly created Gtk::Button widget.  

== public instance methods
--- pressed
    Emits a 'pressed' signal to itself. 
    * Returns: self
--- released
    Emits a 'released' signal to itself. 
--- clicked
    Emits a 'clicked' signal to itself. 
--- enter
    Emits a 'enter' signal to itself. 
--- leave
    Emits a 'leave' signal to itself. 

--- relief
    Returns the current relief style of the given Gtk::Button. 
    * Returns: The current GtkReliefStyle  
--- relief=(newstyle)
    Sets the relief style of the edges of the given Gtk::Button widget. Three styles exist, Gtk::RELIEF_NORMAL, Gtk::RELIEF_HALF, Gtk::RELIEF_NONE. The default style is, as one can guess, Gtk::RELIEF_NORMAL.     
    * newstyle: The ((<GtkReliefStyle|Gtk::GtkReliefStyle>)) as described above.  
    * Returns: newstyle

--- set_relief(newstyle)
    Same as relief=.
    * newstyle: The GtkReliefStyle.
    * Returns: self

--- label
    Fetches the text from the label of the button, as set by Gtk::Button#label=. If the label text has not been set the return value will be nil. This will be the case if you create an empty button with Gtk::Button.new to use as a container.
    * Returns: The text of the label widget.
--- label=(text)
    Sets the text of the label of the button to str. This text is also used to select the stock item if Gtk::Button#use_stock= is used. 
    This will also clear any previously set labels.
    * text: a string for the label text, a constant of Gtk::Stock for the stock item.
    * Returns: text
--- set_label(text)
    Same as label=.
    * text: a string for the label text, a constant of Gtk::Stock for the stock item.
    * Returns: self

--- use_stock?
    Returns whether the button label is a stock item.
--- use_stock=(use_stock)
    If true, the label set on the button is used as a stock id to select the stock item for the button.
    * use_stock: true if the button should use a stock item  
    * Returns: use_stock

--- set_use_stock(use_stock)
    Same as use_stock=.
    * use_stock: true if the button should use a stock item  
    * Returns: self

--- use_underline?
    Returns whether an embedded underline in the button label indicates a mnemonic. See Gtk::Button#use_underline=.
    * Returns: true if an embedded underline in the button label indicates the mnemonic accelerator keys.  
--- use_underline=(use_underline)
    If true, an underline in the text of the button label indicates the next character should be used for the mnemonic accelerator key.
    * use_underline: true if underlines in the text indicate mnemonics  
    * Returns: use_underline

--- set_use_underline(use_underline)
    Same as use_underline=.
    * use_underline: true if underlines in the text indicate mnemonics  
    * Returns: self

== signals
--- activate: self
     * self: Gtk::Button

--- clicked: self
     * self: Gtk::Button

--- enter: self
     * self: Gtk::Button

--- leave: self
     * self: Gtk::Button

--- pressed: self
     * self: Gtk::Button

--- released: self
     * self: Gtk::Button

- Masao



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