I was looking at the upgrade to GTK3 done for View Slides and it seems that it no longer responds to the keyboard. What I had done previously to get it to do that was to put the image I was displaying in an event box. I then made the event box accept the focus like this:<br>
<br><span class="diff-content"><span class="diff-content">self.eventbox.set_events(gtk.gdk.KEY_PRESS_MASK | gtk.gdk.BUTTON_PRESS_MASK)<br></span>self.eventbox.set_<span class="idiff">flags(gtk.CAN_FOCUS</span>)<br><br>The Gtk3 port changed the code to this:<br>
<br></span><span class="diff-content"> self.eventbox.set_<span class="idiff">events(Gdk.EventMask.KEY_PRESS_MASK | Gdk.EventMask.BUTTON_PRESS_MASK</span>)</span><br><br>There was no code to make it accept the focus. I tried adding this:<br>
<br>self.eventbox.set_can_focus(True)<br><br>This does not prevent the Activity from running, but it doesn't make the Event Box focusable either.<br><br>The idea of making the event box focusable is that the user can page through a bunch of images using the keyboard arrow keys, which is much more convenient than clicking buttons with the mouse.<br>
<br>The code for the application is here:<br><br><a href="https://git.sugarlabs.org/viewslides">https://git.sugarlabs.org/viewslides</a><br><br>The relevant file is this:<br><br><a href="https://git.sugarlabs.org/viewslides/mainline/blobs/master/viewslides.py">https://git.sugarlabs.org/viewslides/mainline/blobs/master/viewslides.py</a><br>
<br>I did look through what PyGtk docs I could find and there doesn't seem to be anything for version 3.<br><br>If anyone can point me in the right direction I'd be greatly obliged.<br><br>James Simmons<br>