Handy.ViewSwitcherBar
Description: Reference for Handy.ViewSwitcherBar

### Class

# HandyViewSwitcherBar

#### Description [src]

    final class Handy.ViewSwitcherBar : Gtk.Bin {
      /* No available fields */
    }

A view switcher action bar.

An action bar letting you switch between multiple views offered by a `GtkStack`, via an `HdyViewSwitcher`. It is designed to be put at the bottom of a window and to be revealed only on really narrow windows e.g. on mobile phones. It can’t be revealed if there are less than two pages.

`HdyViewSwitcherBar` is intended to be used together with `HdyViewSwitcherTitle`.

A common use case is to bind the `HdyViewSwitcherBar:reveal` property to `HdyViewSwitcherTitle:title-visible` to automatically reveal the view switcher bar when the title label is displayed in place of the view switcher, as follows:

    <object class="GtkWindow"/>
      <child type="titlebar">
        <object class="HdyHeaderBar">
          <property name="centering-policy">strict</property>
          <child type="title">
            <object class="HdyViewSwitcherTitle"
                    id="view_switcher_title">
              <property name="stack">stack</property>
            </object>
          </child>
        </object>
      </child>
      <child>
        <object class="GtkBox">
          <child>
            <object class="GtkStack" id="stack"/>
          </child>
          <child>
            <object class="HdyViewSwitcherBar">
              <property name="stack">stack</property>
              <property name="reveal"
                        bind-source="view_switcher_title"
                        bind-property="title-visible"
                        bind-flags="sync-create"/>
            </object>
          </child>
        </object>
      </child>
    </object>

## CSS nodes

`HdyViewSwitcherBar` has a single CSS node with name `viewswitcherbar`.

Available since: | 1.0

#### Ancestors

- GtkBin
- GtkContainer
- GtkWidget
- GInitiallyUnowned
- GObject

#### Implements

- AtkImplementorIface
- GtkBuildable

#### Constructors

###### hdy_view_switcher_bar_new

Creates a new `HdyViewSwitcherBar`.

Available since: 1.0

#### Instance methods

###### hdy_view_switcher_bar_get_policy

Gets the policy of `self`.

Available since: 1.0

###### hdy_view_switcher_bar_get_reveal

Gets whether `self` should be revealed or hidden.

Available since: 1.0

###### hdy_view_switcher_bar_get_stack

Get the `GtkStack` being controlled by the `HdyViewSwitcher`.

Available since: 1.0

###### hdy_view_switcher_bar_set_policy

Sets the policy of `self`.

Available since: 1.0

###### hdy_view_switcher_bar_set_reveal

Sets whether `self` should be revealed or not.

Available since: 1.0

###### hdy_view_switcher_bar_set_stack

Sets the `GtkStack` to control.

Available since: 1.0

#### Properties

###### Handy.ViewSwitcherBar:policy

The policy used to determine which mode to use.

Available since: 1.0

###### Handy.ViewSwitcherBar:reveal

Whether the bar should be revealed or hidden.

Available since: 1.0

###### Handy.ViewSwitcherBar:stack

The `GtkStack` the `HdyViewSwitcher` controls.

Available since: 1.0

#### Class structure

    struct HandyViewSwitcherBarClass {
      GtkBinClass parent_class;

    }

###### Class members

`parent_class` |
    GtkBinClass
| No description available.