DhSidebar: Devhelp Reference Manual

## DhSidebar DhSidebar — The sidebar |

## Functions

GtkWidget * | dh_sidebar_new ()
DhLink * | dh_sidebar_get_selected_book ()
void | dh_sidebar_select_uri ()
void | dh_sidebar_set_search_string ()
void | dh_sidebar_set_search_focus ()

## Signals

void | link-selected | Run Last

## Types and Values

struct | DhSidebar

## Object Hierarchy

        GObject
        ╰── GInitiallyUnowned
            ╰── GtkWidget
                ╰── GtkContainer
                    ╰── GtkBox
                        ╰── DhSidebar

## Implemented Interfaces

DhSidebar implements AtkImplementorIface, GtkBuildable and GtkOrientable.

## Includes

    #include <devhelp/devhelp.h>

## Description

In the Devhelp application, there is one DhSidebar per main window, displayed in the left side panel.

A DhSidebar contains:

- a GtkSearchEntry at the top;

- a DhBookTree (a subclass of GtkTreeView);

- another GtkTreeView (displaying a list, not a tree) with a DhKeywordModel as its model.

When the GtkSearchEntry is empty, the DhBookTree is shown. When the GtkSearchEntry is not empty, it shows the search results in the other GtkTreeView. The two GtkTreeView's cannot be both visible at the same time, it's either one or the other.

The “link-selected” signal is emitted when one element in one of the GtkTreeView's is selected. When that happens, the Devhelp application opens the link in a WebKitWebView shown at the right side of the main window.

## Functions

### dh_sidebar_new ()

    GtkWidget *
    dh_sidebar_new (DhBookManager *book_manager);

#### Parameters

book_manager | a DhBookManager. This parameter is deprecated, you should just pass `NULL`. | [nullable]

#### Returns

a new DhSidebar widget.

[transfer floating]

### dh_sidebar_get_selected_book ()

    DhLink *
    dh_sidebar_get_selected_book (DhSidebar *sidebar);

#### Parameters

sidebar | a DhSidebar. |

#### Returns

the DhLink of the selected book, or `NULL` if there is no selection.

[nullable][transfer none]

### dh_sidebar_select_uri ()

    void
    dh_sidebar_select_uri (DhSidebar *sidebar,
                           const gchar *uri);

#### Parameters

sidebar | a DhSidebar. |
uri | the URI to select. |

### dh_sidebar_set_search_string ()

    void
    dh_sidebar_set_search_string (DhSidebar *sidebar,
                                  const gchar *str);

#### Parameters

sidebar | a DhSidebar. |
str | the string to search. |

### dh_sidebar_set_search_focus ()

    void
    dh_sidebar_set_search_focus (DhSidebar *sidebar);

Gives the focus to the search entry.

#### Parameters

sidebar | a DhSidebar. |

## Types and Values

### struct DhSidebar

    struct DhSidebar;

## Signal Details

### The `“link-selected”` signal

    void
    user_function (DhSidebar *sidebar,
                   DhLink    *link,
                   gpointer   user_data)

#### Parameters

sidebar | a DhSidebar. |
link | the selected DhLink. |
user_data | user data set when the signal handler was connected. |

Flags: Run Last