3

Look at the example in the bottom of this page: http://www.pygtk.org/pygtk2tutorial/sec-EventHandling.html it says:

   57   def button_press_event(widget, event):
   58       if event.button == 1 and pixmap != None:
   59           draw_brush(widget, event.x, event.y)
   60       return True

So, for what there are "return True"?

scythargon
  • 3,363
  • 3
  • 32
  • 62
  • Unfortunately those links redirect to different resources now, good thing you added the relevant information! (Even better if we could update the link.) – dreua Jan 20 '23 at 08:47

1 Answers1

10

You should read the introductory chapters of the same tutorial you linked to. For example, chapter 2.3 describes events and says what the return value is.

The value returned from this function indicates whether the event should be propagated further by the GTK+ event handling mechanism. Returning True indicates that the event has been handled, and that it should not propagate further. Returning False continues the normal event handling. See Chapter 20, Advanced Event and Signal Handling for more details on this propagation process.

tinman
  • 6,348
  • 1
  • 30
  • 43