MxFocusable

## MxFocusable MxFocusable |

## Synopsis

    enum                MxFocusDirection;
    enum                MxFocusHint;
                        MxFocusable;
    struct              MxFocusableIface;
    MxFocusable *       mx_focusable_move_focus             (MxFocusable *focusable,
                                                             MxFocusDirection direction,
                                                             MxFocusable *from);
    MxFocusable *       mx_focusable_accept_focus           (MxFocusable *focusable,
                                                             MxFocusHint hint);
    MxFocusHint         mx_focus_hint_from_direction        (MxFocusDirection direction);

## Object Hierarchy

      GInterface
       +----MxFocusable

## Known Implementations

MxFocusable is implemented by MxBin, MxBoxLayout, MxButton, MxComboBox, MxDialog, MxEntry, MxExpander, MxFrame, MxItemView, MxKineticScrollView, MxListView, MxMenu, MxNotebook, MxOffscreen, MxPathBar, MxScrollBar, MxScrollView, MxSlider, MxStack, MxTable, MxToolbar and MxViewport.

## Description

## Details

### enum MxFocusDirection

    typedef enum {
      MX_FOCUS_DIRECTION_OUT,
      MX_FOCUS_DIRECTION_UP,
      MX_FOCUS_DIRECTION_DOWN,
      MX_FOCUS_DIRECTION_LEFT,
      MX_FOCUS_DIRECTION_RIGHT,
      MX_FOCUS_DIRECTION_NEXT,
      MX_FOCUS_DIRECTION_PREVIOUS
    } MxFocusDirection;

### enum MxFocusHint

    typedef enum {
      MX_FOCUS_HINT_FIRST,
      MX_FOCUS_HINT_LAST,
      MX_FOCUS_HINT_PRIOR,
      MX_FOCUS_HINT_FROM_ABOVE,
      MX_FOCUS_HINT_FROM_BELOW,
      MX_FOCUS_HINT_FROM_LEFT,
      MX_FOCUS_HINT_FROM_RIGHT
    } MxFocusHint;

### MxFocusable

    typedef struct _MxFocusable MxFocusable;

This is an opaque structure whose members cannot be directly accessed.

### struct MxFocusableIface

    struct MxFocusableIface {
      GObjectClass parent_class;

      MxFocusable* (*accept_focus) (MxFocusable *focusable,
                                    MxFocusHint  hint);
      MxFocusable* (*move_focus)   (MxFocusable      *focusable,
                                    MxFocusDirection  direction,
                                    MxFocusable      *from);
    };

### mx_focusable_move_focus ()

    MxFocusable *       mx_focusable_move_focus             (MxFocusable *focusable,
                                                             MxFocusDirection direction,
                                                             MxFocusable *from);

Move the focus

`focusable` : | A MxFocusable
`direction` : | A MxFocusDirection
`from` : | focusable to move the focus from
Returns : | the newly focused focusable. [transfer none]

### mx_focusable_accept_focus ()

    MxFocusable *       mx_focusable_accept_focus           (MxFocusable *focusable,
                                                             MxFocusHint hint);

Accept the focus

`focusable` : | A MxFocusable
`hint` : | A MxFocusHint
Returns : | the focusable. [transfer none]

### mx_focus_hint_from_direction ()

    MxFocusHint         mx_focus_hint_from_direction        (MxFocusDirection direction);

Transforms a focus direction to a focus hint. This is a convenience function for actors that implement the MxFocusable interface, to pass the correct MxFocusHint to their children when calling `mx_focusable_accept_focus()`.

`MX_FOCUS_DIRECTION_UP` maps to `MX_FOCUS_HINT_FROM_BELOW`, `MX_FOCUS_DIRECTION_DOWN` maps to `MX_FOCUS_HINT_FROM_ABOVE`, `MX_FOCUS_DIRECTION_LEFT` maps to `MX_FOCUS_HINT_FROM_RIGHT`, `MX_FOCUS_DIRECTION_RIGHT` maps to `MX_FOCUS_HINT_FROM_LEFT`, `MX_FOCUS_DIRECTION_NEXT` maps to `MX_FOCUS_HINT_FIRST`, `MX_FOCUS_DIRECTION_PREVIOUS` maps to `MX_FOCUS_HINT_LAST` and anything else maps to `MX_FOCUS_HINT_PRIOR`.

`direction` : | A MxFocusDirection
Returns : | A MxFocusHint

Since 1.2