[ruby-gnome2-doc-cvs] [Ruby-GNOME2 Project Website] update - tut-gtk2-agtkw-draww

Back to archive index

ruby-****@sourc***** ruby-****@sourc*****
2013年 3月 20日 (水) 03:05:39 JST


-------------------------
REMOTE_ADDR = 184.145.81.215
REMOTE_HOST = 
        URL = http://ruby-gnome2.sourceforge.jp/hiki.cgi?tut-gtk2-agtkw-draww
-------------------------
@@ -62,7 +62,7 @@
 
 The following example program (drawingareas.rb) implements a simple drawing program using the Gtk::DrawingArea widget. Points will be drawn on the screen when the user clicks a mouse button and when the pointer is dragged while the button is clicked. 
 
-The current content of the drawing area's Gdk::Window is cleared when the user presses the Delete key. {{image_right("dialog-warning.png")}} But if the "+" key is pressed, the program demonstrates how Gdk::Drawable drawing methods can be used to generate images of geometric shapes. However, there is a problem with this last feature, namely the generated geometric shapes are lost as soon as window is moved or resized, i.e. when the((*expose_event*))is emitted causing it to be refreshed (redrawn or repainted). While this is very simple program, it  nonetheless shows how to interact with the Gtk::DrawingArea widget and use events with it.
+The current content of the drawing area's Gdk::Window is cleared when the user presses the Delete key. But if the "+" key is pressed, the program demonstrates how Gdk::Drawable drawing methods can be used to generate images of geometric shapes. However, there is a problem with this last feature, namely the generated geometric shapes are lost as soon as window is moved or resized, i.e. when the((*expose_event*))is emitted causing it to be refreshed (redrawn or repainted). While this is very simple program, it  nonetheless shows how to interact with the Gtk::DrawingArea widget and use events with it.
 
 Creating a drawing area is a no brainier, however, preparing the new drawing area to catch events needs to be mentioned. You accomplish this with the Gtk::Widget#add_events instance methods, and you assemble the signals to be monitored for by or(ing) together Gdk::Event mask values (((<GdkEventMask|Gdk::Event#GdkEventMask>))). Another interesting thing is how to monitor for different key strokes. You are comparing Gdk::EventKey's keyval property to Gdk::Keyval constants (see: ((<GdkKeyvals|Gdk::Keyval#GdkKeyvals>))).
 




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