[ruby-gnome2-doc-cvs] [Hiki] create - Gdk::EventButton

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2004年 3月 3日 (水) 17:55:56 JST


-------------------------
REMOTE_ADDR = 161.114.202.20
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/?Gdk%3A%3AEventButton
-------------------------
= class Gdk::EventButton
Used for button press and button release events. The Gdk::Event#event_type field will be one of Gdk::Event::BUTTON_PRESS, Gdk::Event::BUTTON2_PRESS, Gdk::Event::BUTTON3_PRESS, and Gdk::Event::BUTTON_RELEASE. 
Double and triple-clicks result in a sequence of events being received. For double-clicks the order of events will be: 

(1) Gdk::Event::BUTTON_PRESS
(2) Gdk::Event::BUTTON_RELEASE
(3) Gdk::Event::BUTTON_PRESS
(4) Gdk::Event::BUTTON2_PRESS
(5) Gdk::Event::BUTTON_RELEASE

Note that the first click is received just like a normal button press, while the second click results in a Gdk::Event::BUTTON2_PRESS being received just after the Gdk::Event::BUTTON_PRESS. 

Triple-clicks are very similar to double-clicks, except that Gdk::Event::BUTTON3_PRESS is inserted after the third click. The order of the events is: 

(1) Gdk::Event::BUTTON_PRESS
(2) Gdk::Event::BUTTON_RELEASE
(3) Gdk::Event::BUTTON_PRESS
(4) Gdk::Event::BUTTON2_PRESS
(5) Gdk::Event::BUTTON_RELEASE
(6) Gdk::Event::BUTTON_PRESS
(7) Gdk::Event::BUTTON3_PRESS
(8) Gdk::Event::BUTTON_RELEASE

For a double click to occur, the second button press must occur within 1/4 of a second of the first. For a triple click to occur, the third button press must also occur within 1/2 second of the first button press. 

== Object Hierarchy
* Object
  * GLib::Boxed
    * Gdk::Event
      * Gdk::EventAny
        * Gdk::EventButton

== Instance Methods
--- time
    Gets the time of the event in milliseconds. 
    * Returns: the time of the event in milliseconds
--- time=(time)
    Sets the time of the event in milliseconds.
    * time: the time of the event in milliseconds
    * Returns: time
--- set_time(time)
    Same as time=.
    * time: the time of the event in milliseconds
    * Returns: self

--- x
    Gets the x coordinate of the pointer relative to the window. 
    * Returns: the x coordinate of the pointer relative to the window
--- x=(x)
    Sets the x coordinate of the pointer relative to the window. 
    * x: the x coordinate of the pointer relative to the window
    * Returns: x
--- set_x(x)
    Same as x=.
    * x: the x coordinate of the pointer relative to the window
    * Returns: self

--- y
    Gets the y coordinate of the pointer relative to the window. 
    * Returns: the y coordinate of the pointer relative to the window
--- y=(y)
    Sets the y coordinate of the pointer relative to the window. 
    * y: the y coordinate of the pointer relative to the window
    * Returns: y
--- set_y(y)
    Same as y=.
    * y: the y coordinate of the pointer relative to the window
    * Returns: self


--- axes
    x, y translated to the axes of device, or nil if device is the mouse. 
    * Returns: [x, y] or nil
--- set_axes(x, y)
    Set the axes of device.
    * x: the x coordinate of the axes of device
    * y: the y coordinate of the axes of device
    * Returns: self

--- state
    Gets the bit-mask representing the state of the modifier keys (e.g. Control, Shift and Alt) and the pointer buttons. See ((<GdkModifierType|Gdk::Window#GdkModifierType>)). 
    * Returns: ((<GdkModifierType|Gdk::Window#GdkModifierType>))
--- state=(state)
    Sets a bit-mask representing the state of modifier keys.
    * state: a bit-mask of ((<GdkModifierType|Gdk::Window#GdkModifierType>)).
    * Returns: self
--- set_state(state)
    Same as state=.
    * state: a bit-mask of ((<GdkModifierType|Gdk::Window#GdkModifierType>)).
    * Returns: self

--- button
    Gets the button number which was pressed or released, numbered from 1 to 5. Normally button 1 is the left mouse button, 2 is the middle button, and 3 is the right button. On 2-button mice, the middle button can often be simulated by pressing both mouse buttons together. 
    * Returns: button number
--- button=(button)
    Set the button number which was pressed or released.
    * button: a button number(from 1 to 5)
    * Returns: button
--- set_button(button)
    Same as button=.
    * button: a button number(from 1 to 5)
    * Returns: self

--- device
    Gets the device where the event originated. 
    * Returns: device(Gdk::Device)
--- device=(device)
    Sets the device where the event originated.
    * device: device(Gdk::Device)
    * Returns: device
--- set_device(device)
    Same as device=.
    * device: device(Gdk::Device)
    * Returns: self

--- x_root
    Gets the x coordinate of the pointer relative to the root of the screen. 
    * Returns: the x coordinate of the pointer relative to the root of the screen
--- x_root=(x_root)
    Sets the x coordinate of the pointer relative to the root of the screen. 
    * x_root: the x coordinate of the pointer relative to the root of the screen
    * Returns: x_root
--- set_x_root(x_root)
    Same as x_root=.
    * x_root: the x coordinate of the pointer relative to the root of the screen
    * Returns: self

--- y_root
    Gets the y coordinate of the pointer relative to the root of the screen. 
    * Returns: the y coordinate of the pointer relative to the root of the screen
--- y_root=(y_root)
    Sets the y coordinate of the pointer relative to the root of the screen. 
    * y_root: the y coordinate of the pointer relative to the root of the screen
    * Returns: y_root
--- set_y_root(y_root)
    Same as y_root=.
    * y_root: the y coordinate of the pointer relative to the root of the screen
    * Returns: self


- ((<Masao>))






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