re: Gtk cookbook



  Hello,

  thanks for the cookbook. 

From: Paolo Molaro <lupus ximian com>
# Comments and contributions are welcome as usual.

  A few typos, in the patch below. Also, I put in some C<>'s around
code in paragraphs (maybe not a good idea, after seeing the effect on
pod2latex) and replaced >'s by C<gt>. At the end, put a long line of
code in two lines.

  Question : in the "Idle events" section, the handler will be called
once only, because it returns FALSE. Right?

  Cheers,

  Etienne

======================================================================
--- cookbook.pod.orig   Wed Jan 24 08:33:31 2001
+++ cookbook.pod        Wed Jan 24 08:35:38 2001
@@ -73,7 +73,7 @@
 One fundamental concept in Gtk programming is I<signals>: objects
 emit a signal whenever something interesting happens to them, for
 example when a button is clicked or when a window is closed, or when
-an item in a list is selected and so on (note that this signals have nothing
+an item in a list is selected and so on (note that these signals have nothing
 to do with POSIX signals). Every kind of widgets has a set of
 signals and you can connect to a signal emission to run your code or
 even to stop the signal. In the same way methods are inherited by derived
@@ -85,9 +85,9 @@
 To take advantage of the Gtk module you also need to understand event-driven programming:
 this means that you tell the toolkit to wake your program up whenever
 something interesting happens and then let it wait for the events to happen
-in the so-called main loop (with a call to Gtk->main()).
+in the so-called main loop (with a call to C<Gtk-E<gt>main()>).
 
-When you tell the library you are intersted in an event, you hand it a
+When you tell the library you are interested in an event, you hand it a
 subroutine to be called whenever that event happens. The subroutine
 (often called handler) will receive as arguments the data specific to
 the event (if any) and any additional data you passed in when installing the
@@ -120,9 +120,9 @@
 
        Gtk->timeout_remove($id);
 
-where $id is the value returned by the Gtk->timeout_add() call.
+where C<$id> is the value returned by the C<Gtk-E<gt>timeout_add()> call.
 
-Note that the first value to the Gtk->timeout_add() call is the timeout in
+Note that the first value to the Gtk-E<gt>timeout_add() call is the timeout in
 milliseconds.
 
 =item * Idle events 
@@ -145,7 +145,7 @@
 
        Gtk->idle_remove($id);
 
-where $id is the value returned by the Gtk->idle_add() call.
+where C<$id> is the value returned by the C<Gtk-E<gt>idle_add()> call.
 
 =item * I/O events
 
@@ -171,7 +171,7 @@
 
        Gtk::Gdk->input_remove($id);
 
-where $id is the value returned by the Gtk::Gdk->input_add() call.
+where C<$id> is the value returned by the C<Gtk::Gdk->input_add()> call.
 
 Note that the I/O handler subroutine gets the additional data as first arguments
 and then the handler-specific data, unlike the other more common signal handlers
@@ -180,7 +180,7 @@
 The first argument to input_add() is an integer file descriptor (see the fileno()
 function description in the perlfunc manpage). The second argument is an
 array reference that may contain the 'read', 'write' and/or 'exception' strings
-if you want your handler to be called when you can read or write or you when you get
+if you want your handler to be called when you can read or write or when you get
 an exception on the file descriptor, respectively.
 
 =item * Perl scalar changes
@@ -227,7 +227,7 @@
        # set the title
        $window->set_title("My app - version 1-foo");
 
-       # set the deafult size
+       # set the deafault size
        $window->set_default_size($width, $height);
 
        # the window should be managed by the window manager as
@@ -294,7 +294,7 @@
 =head2 Gtk::Combo
 
 A text entry with a drop down list. This is a compound widget that contains
-a Gtk::Entry ($combo->entry) and a Gtk::List ($combo->list).
+a Gtk::Entry (C<$combo->entry>) and a Gtk::List (C<$combo->list>).
 
        # create a combo box
        $combo = new Gtk::Combo;
@@ -305,7 +305,7 @@
        # get a notification when the value changes
        $combo->entry->signal_conenct('changed', sub {
                my $entry = shift;
-               warn "The text is: ", $entry-<get_text, "\n";
+               warn "The text is: ", $entry->get_text, "\n";
        });
 
 =head2 Gtk::Button
@@ -316,7 +316,7 @@
 own widget (maybe a Gtk::Pixmap) and add that to the button later.
 
        # create a button with a label
-       $button = new Gtk;;Button("Ok");
+       $button = new Gtk::Button("Ok");
        
        # create a button and later add a Gtk::Pixmap widget to it
        $button = new Gtk::Button;
@@ -328,7 +328,7 @@
        });
 
        # do something with the child widget
-       $widge = $button->child;
+       $widget = $button->child;
 
 =head2 Gtk::Frame
 
@@ -345,7 +345,8 @@
        # create a table
        $table = new Gtk::Table($rows, $columns, $homogeneous);
        #
-       $table->attach_defaults($child, $left_attach, $right_attach, $top_attach, $bottom_attach);
+       $table->attach_defaults($child, $left_attach, $right_attach, 
+                                $top_attach, $bottom_attach);
 
 =head1 AUTHOR
 




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]