gbc.api.sidebar

The gbc.api.sidebar module shows, hides, and reports the visibility of the SideBarDrawer, the panel holding the application list and the start menu.

The same functions are available in 4GL as the sidebar front call module, with identical function names. For details, go to Sidebar front calls in the Genero Business Development Language User Guide.

Two of these functions change the drawer's visibility: setDrawerVisible() sets it directly, and toggleDrawerVisibility() switches it to the opposite state. The third, isDrawerVisible(), only reports the current state. It takes no argument and changes nothing.

Table 1. gbc.api.sidebar functions
Function Description
gbc.api.sidebar.setDrawerVisible(visible) Pass true to show the drawer, or false to hide it.
gbc.api.sidebar.isDrawerVisible() Reports whether the drawer is currently shown, without changing anything.
gbc.api.sidebar.toggleDrawerVisibility() Switches the drawer to the opposite of its current state. Shown becomes hidden, hidden becomes shown.

All three functions return a boolean: true if the drawer ends up shown, false if hidden. For setDrawerVisible() and toggleDrawerVisibility(), this returned value can differ from what was requested, because showing and hiding can each be refused, for different reasons:

  • Showing the drawer is refused when the drawer is empty, or when there is no drawer at all, for instance in direct mode where the host provides its own launcher.
  • Hiding the drawer is refused only when there is no drawer at all. Hiding a docked drawer collapses it. It disappears but stays docked. Showing it again expands it.