0

EDIT: Turns out that an EventBox was exactly what I needed. It dropped in and functioned exactly as expected!

I was working on an app whose single window is to blink under certain criteria until the user clicks on it. Once clicked, the window ceases blinking until the criteria is again met.

That all worked just lovely.

Now, the app has evolved to require what would've previously been several windows (several instances of the aforementioned single window) become Gtk.Boxes within a Gtk.Grid.

The previous approach called this attachment:

self.connect("button-press-event", self.__window_clicked)

Once the individual Gtk.Windows became Gtk.Boxes, however, this method stopped working. The callback is simply never fired.

According to this page, I'd expect that button-press-event would be among the 69 signals inherited from Gtk.Widget. Am I wrong about that? It seems I must be.

How should I be detecting a click received by a Gtk.Box?

pdm
  • 1,027
  • 1
  • 9
  • 24
  • What widget is inside the `GtkBox`? I think you need to detect the click in the child widget. – theGtknerd Feb 27 '18 at 23:13
  • A whole host of labels and whatnot. Nothing interactive. The single window setup from before is basically a server health status monitor that should blink when something should be paid attention to. It works well for the whole window to blink, at that point. But, of course, when you want to do multiple servers in the same window, they need to be able to be separately engaged. – pdm Feb 28 '18 at 00:11

0 Answers0