HdyKeypad

HdyKeypad — A keypad for dialing numbers

Functions

Properties

GtkWidget * entry Read / Write
GtkWidget * left-action Write
gboolean only-digits Read / Write
GtkWidget * right-action Write
gboolean show-symbols Read / Write

Types and Values

Object Hierarchy

    GObject
    ╰── GInitiallyUnowned
        ╰── GtkWidget
            ╰── GtkContainer
                ╰── GtkGrid
                    ╰── HdyKeypad

Implemented Interfaces

HdyKeypad implements AtkImplementorIface, GtkBuildable and GtkOrientable.

Description

The HdyKeypad widget is a keypad for entering numbers such as phone numbers or PIN codes.

This widget should not be altered using the GtkGrid and GtkContainer APIs, they are considered internal to this widget, using them externally will lead to unexpected results.

Functions

hdy_keypad_new ()

GtkWidget *
hdy_keypad_new (gboolean only_digits,
                gboolean show_symbols);

Create a new HdyKeypad widget.

Parameters

only_digits

whether the keypad should show only digits or also extra buttons for #, *

 

show_symbols

whether the keypad should show the second line or only the main digit

 

Returns

the newly created HdyKeypad widget


hdy_keypad_show_symbols ()

void
hdy_keypad_show_symbols (HdyKeypad *self,
                         gboolean visible);

Sets the visibility of symbols (excluding the main digit) on each button in the HdyKeypad

Parameters

self

a HdyKeypad

 

visible

whether the second line on buttons should be shown or not

 

hdy_keypad_set_entry ()

void
hdy_keypad_set_entry (HdyKeypad *self,
                      GtkEntry *entry);

Binds a GtkEntry to the keypad and it blocks every input which wouldn't be possible to type with with the keypad

Parameters

self

a HdyKeypad

 

entry

a GtkEntry

 

hdy_keypad_get_entry ()

GtkWidget *
hdy_keypad_get_entry (HdyKeypad *self);

Get the connected entry. See hdy_keypad_set_entry() for details

Parameters

self

a HdyKeypad

 

Returns

the set GtkEntry or NULL if no widget was set.

[transfer none]


hdy_keypad_set_left_action ()

void
hdy_keypad_set_left_action (HdyKeypad *self,
                            GtkWidget *widget);

Sets the widget for the left lower corner of HdyKeypad replacing the existing widget, if NULL it just removes whatever widget is there

Parameters

self

a HdyKeypad

 

widget

nullable: the widget which should be show in the left lower corner of HdyKeypad

 

hdy_keypad_set_right_action ()

void
hdy_keypad_set_right_action (HdyKeypad *self,
                             GtkWidget *widget);

Sets the widget for the right lower corner of HdyKeypad replacing the existing widget, if NULL it just removes whatever widget is there

Parameters

self

a HdyKeypad

 

widget

nullable: the widget which should be show in the right lower corner of HdyKeypad

 

Types and Values

HDY_TYPE_KEYPAD

#define HDY_TYPE_KEYPAD (hdy_keypad_get_type())

struct HdyKeypadClass

struct HdyKeypadClass {
  GtkGridClass parent_class;
};

Members


HdyKeypad

typedef struct _HdyKeypad HdyKeypad;

Property Details

The “entry” property

  “entry”                    GtkWidget *

The entry widget connected to the keypad.

Flags: Read / Write


The “left-action” property

  “left-action”              GtkWidget *

The left action widget.

Flags: Write


The “only-digits” property

  “only-digits”              gboolean

Whether the keypad should show only digits or also extra buttons for #, *.

Flags: Read / Write

Default value: FALSE


The “right-action” property

  “right-action”             GtkWidget *

The right action widget.

Flags: Write


The “show-symbols” property

  “show-symbols”             gboolean

Whether the second line of symbols should be shown or not.

Flags: Read / Write

Default value: TRUE