#!/usr/bin/env python # Tichy # copyright 2008 Guillaume Chereau (charlie@openmoko.org) # # This file is part of Tichy. # # Tichy is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Tichy is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Tichy. If not, see . """ This is standalone program that starts the learn plugin of tichy """ import sys sys.path.insert(0, '../') # Import all the stuffs we need... import tichy import tichy.gui as gui import tichy.item as item import tichy.item.style from tichy.tasklet import Tasklet, Wait from tichy.application import Application import tichy.plugins as plugins from tichy.gui import Vect, Rect from tichy.service import ActionsViewService import logging logging.basicConfig( level=logging.INFO, format='%(name)-8s %(levelname)-8s %(message)s' ) class MyActionsViewService(Service): service = 'ActionsView' def set_actor(self2, actor, view): from tichy.gui import ApplicationFrame action_bar = view.parent_as(ApplicationFrame).action_bar action_bar.set_actor(actor, view) if __name__ == '__main__': # First we import all the needed plugins plugins.import_single('plugins/styles/style2') plugins.import_single('plugins/apps/learn') plugins.import_single('plugins/apps/file_browser') plugins.import_single('plugins/apps/keyboard') learn = Application.find_by_name('Learn') style = item.style.Style.find_by_name("black style").create() # The backend SDL painter painter = gui.SdlPainter((480, 640)) loop = gui.SdlEventsLoop() # Create the screen screen = gui.Screen(loop, painter, style = style) loop.window = screen def on_quit(v): print 'quit' loop.quit() # Start the application, and attach a callback on it learn(screen).start(on_quit) loop.start()