Application menus not only help us navigate easily but also give a native look and feel to the application. For platforms that support menus Rhodes framework provides the ability to change the native application menu options through the simple API. So, in this section, we will create a default menu, which will appear on each page of our application. And in the next section, we will create a Controller Action Menu.
We can set the default menu for all the pages in our application.
To change the default menu (in application.rb
):
class AppApplication < Rho::RhoApplication def initialize super @default_menu = { "Go Home" => :home, "View Employee" => "/app/Employee", "Do Refresh" => :refresh, "Perform Sync" => :sync, "App Options" => :options, "View Log" => :log } end end
@default_menu
is hash with key as label and value as action. So, this code will create a menu on Blackberry as shown...