Development Team/Almanac: Difference between revisions
m moved Walter is a wanker 12/Almanac to Development Team/Almanac over redirect: revert |
|||
| (2 intermediate revisions by 2 users not shown) | |||
| Line 377: | Line 377: | ||
</pre> | </pre> | ||
== How do I know if the screen has been rotated? == | |||
When the screen is rotated, GTK issues a CONFIGURE event. Test for this event and grab the screen dimensions in the event handler. | |||
self.window.add_events(gtk.gdk.CONFIGURE) | |||
self.window.connect('configure-event', self._configure_cb) | |||
def _configure_cb(self, win, event): | |||
width = gtk.gdk.screen_width() | |||
height = gtk.gdk.screen_height() | |||
This does not tell you the orientation, however. Allegedly on the XO hardware, you can use olpc-kbdshim (currently undocumented). | |||
=== How do I detect if one of the joystick buttons has been pressed? === | === How do I detect if one of the joystick buttons has been pressed? === | ||
| Line 410: | Line 422: | ||
</pre> | </pre> | ||
=== How do | === How do I remove a specific button from the toolbar? === | ||
This is an example of the share button is removed: | This is an example of the share button is removed: | ||