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

Gdk::EventButton

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.

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 Gdk::EventButton#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 Gdk::EventButton#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 Gdk::EventButton#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.
state=(state)
Sets a bit-mask representing the state of modifier keys.
set_state(state)
Same as Gdk::EventButton#state=.
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 Gdk::EventButton#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 Gdk::EventButton#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 Gdk::EventButton#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 Gdk::EventButton#y_root=.
  • y_root: the y coordinate of the pointer relative to the root of the screen
  • Returns: self

- Masao?

更新日時:2005/11/17 02:43:41
キーワード:
参照:[Gtk] [Gtk::Widget] [Gdk::EventButton] [gtk2-tut-manualmenu]