FindToolbar

A Hildon::FindToolbar is a special toolbar that offers a search feature. Maemo applications may have several toolbars, which are then attached above each other. The find toolbar is generally placed on the top of the main toolbar, as in the example below.

Reference

The Hildon::FindToolbar has two interesting signals:

To integrate the Hildon::FindToolbar in your application, you must add a button to your main toolbar which is used to show the toolbar, like this:

// ...
Gtk::ToolButton* tool_find = Gtk::manage(new Gtk::ToolButton(Gtk::Stock::FIND));
main_toolbar.append(tool_find);
tool_find->show();
tool_find->signal_clicked().connect( sigc::mem_fun(*this, &ExampleWindow::on_find_close) );
// ...

void ExampleWindow::on_find_close()
{
  // Show or hide find toolbar
  if (m_find_visible) {
    m_find_toolbar.hide();
    m_find_visible = false;
  } 
  else {
    m_find_toolbar.show_all();
    m_find_visible = true;
  }
}

Then you must connect a signal handler for the search signal to actually perform the search:

find_toolbar.signal_search().connect( sigc::mem_fun(*this, &ExampleWindow::on_search) );

// ...

void ExampleWindow::on_search()
{
  Glib::ustring prefix;
  find_toolbar.get_property("prefix", prefix);
  // Search for prefix now...
}

Example

Here is the full example code for the FindToolbar:

Figure 5.4. FindToolbar

FindToolbar

Source Code