Editing PyMaemo/UI tutorial/Menus
Warning: You are not logged in.
Your IP address will be recorded in this page's edit history.
The edit can be undone.
Please check the comparison below to verify that this is what you want to do, and then save the changes below to finish undoing the edit.
Latest revision | Your text | ||
Line 132: | Line 132: | ||
The previous example had only one view. In applications with several views, you can attach a different menu to each view and add only the options that are relevant to the displayed view. | The previous example had only one view. In applications with several views, you can attach a different menu to each view and add only the options that are relevant to the displayed view. | ||
- | The function <code>hildon_window_set_app_menu()</code>allows to set a menu to a <code>HildonWindow</code> and its descendant | + | The function <code>hildon_window_set_app_menu()</code>allows to set a menu to a <code>HildonWindow</code> and its descendant HildonStackableWindow widget. |
<source lang="python"> | <source lang="python"> | ||
window.set_app_menu(menu) | window.set_app_menu(menu) | ||
Line 146: | Line 146: | ||
Avoid using context menus, because they are a hidden and inconvenient way of interacting with the UI. Use <code>HildonAppMenu</code>s instead. | Avoid using context menus, because they are a hidden and inconvenient way of interacting with the UI. Use <code>HildonAppMenu</code>s instead. | ||
- | To create a | + | To create a GtkMenu in a Hildon application, use the following function instead of <code>gtk_menu_new()</code>: |
<source lang="python"> | <source lang="python"> | ||
gtk.Menu() | gtk.Menu() | ||
</source> | </source> | ||
- | This function creates a <code>GtkMenu</code> that allows Hildon | + | This function creates a <code>GtkMenu</code> that allows Hildon specific styling. |
When you use a <code>GtkMenu</code> in your Hildon application, consider how many menu items you are going to use, because screen space is limited. Also consider the fact that in the interests of keeping the UI clear, submenus are not allowed. | When you use a <code>GtkMenu</code> in your Hildon application, consider how many menu items you are going to use, because screen space is limited. Also consider the fact that in the interests of keeping the UI clear, submenus are not allowed. | ||
[[Category:Python]] | [[Category:Python]] |
Learn more about Contributing to the wiki.