PyMaemo/Python-osso examples

(tidy)
(add link)
 
(One intermediate revision not shown)
Line 1: Line 1:
-
This document shows some examples of the functionalities available in the python-osso package.
+
This document shows some examples of the functionalities available in the [http://maemo.org/packages/view/python-osso/ python-osso package]. See also the [[Documentation/Maemo 5 Developer Guide/Application Development/LibOSSO library|documentation for the libosso]] library.
== List of examples ==
== List of examples ==
Line 17: Line 17:
These examples show how to use the auto-saving and state saving features from python-osso. Each file is a separate example.
These examples show how to use the auto-saving and state saving features from python-osso. Each file is a separate example.
-
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/autosave/osso_test_autosave.py osso_test_autosave.py] - The same objects from the example below, but instead of calling the save function directly, any changes call user_data_changed, and when exiting force_autosave is called.
+
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/autosave/osso_test_autosave.py osso_test_autosave.py] - The same objects from the example below, but instead of calling the save function directly, any changes call <code>user_data_changed</code>, and when exiting <code>force_autosave</code> is called.
-
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/autosave/osso_test_statesaving.py osso_test_statesaving.py] - Creates a gtk.Entry and a gtk.HScale. It saves the state when the application goes to background or exits, restoring the state on the next startup, unless the device resets or is turned off.
+
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/autosave/osso_test_statesaving.py osso_test_statesaving.py] - Creates a <code>gtk.Entry</code> and a <code>gtk.HScale</code>. It saves the state when the application goes to background or exits, restoring the state on the next startup, unless the device resets or is turned off.
=== Device State ===
=== Device State ===
Line 56: Line 56:
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/rpc/osso_test_sender.py osso_test_sender.py] - GUI app that requests a service from the target app.
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/rpc/osso_test_sender.py osso_test_sender.py] - GUI app that requests a service from the target app.
-
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/rpc/osso_test_receiver.py osso_test_receiver.py] - Sample service that will be called by osso_test_sender.py
+
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/rpc/osso_test_receiver.py osso_test_receiver.py] - Sample service that will be called by <code>osso_test_sender.py</code>
=== Status Bar ===
=== Status Bar ===
Line 66: Line 66:
=== System Note ===
=== System Note ===
-
These examples show how to use notification dialogs with applications that run without gui.
+
These examples show how to use notification dialogs with applications that run without GUI.
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/systemnote/osso_test_note_dialog.py osso_test_note_dialog.py] - Shows a dialog note.
* [https://garage.maemo.org/svn/pymaemo/wwwold/documentation/python_osso_examples/code/systemnote/osso_test_note_dialog.py osso_test_note_dialog.py] - Shows a dialog note.

Latest revision as of 09:50, 25 October 2010

This document shows some examples of the functionalities available in the python-osso package. See also the documentation for the libosso library.

Contents

[edit] List of examples

Download all examples

[edit] Application

This example shows how to bring an application to foreground using osso.Application.application_top().

[edit] Auto-saving / State Saving

These examples show how to use the auto-saving and state saving features from python-osso. Each file is a separate example.

  • osso_test_autosave.py - The same objects from the example below, but instead of calling the save function directly, any changes call user_data_changed, and when exiting force_autosave is called.
  • osso_test_statesaving.py - Creates a gtk.Entry and a gtk.HScale. It saves the state when the application goes to background or exits, restoring the state on the next startup, unless the device resets or is turned off.

[edit] Device State

These examples show how to interact with the display and the device.

[edit] Help

These examples show how to use HELP and enable the "?" button in dialogs

  • osso_test_help.py - Shows two buttons: one to load a help topic and another to open a dialog with an "?" button in titlebar.

[edit] MIME

These examples show how use the MIME functions.

[edit] Plugin

This example shows how to load plugins.

[edit] RPC

These examples show how to make remote procedure calls using python-osso.

[edit] Status Bar

This example shows how to send events to status bar applets.

[edit] System Note

These examples show how to use notification dialogs with applications that run without GUI.

[edit] Time Notification

This example registers a callback and tries to set the system time. Notice: Currently this won't change the time. (Even in C).