PhatKeyboard

Name

PhatKeyboard -- a base class for PhatHKeyboard and PhatVKeyboard

Synopsis



            PhatKeyboard;
void        phat_keyboard_set_adjustment    (PhatKeyboard *keyboard,
                                             GtkAdjustment *adjustment);
GtkAdjustment* phat_keyboard_get_adjustment (PhatKeyboard *keyboard);


Object Hierarchy


  GObject
   +----GtkObject
         +----GtkWidget
               +----GtkContainer
                     +----GtkBin
                           +----GtkViewport
                                 +----PhatKeyboard
                                       +----PhatVKeyboard
                                       +----PhatHKeyboard

Implemented Interfaces

PhatKeyboard implements AtkImplementorIface.

Properties


  "numkeys"              gint                  : Read / Write / Construct Only
  "orientation"          GtkOrientation        : Read / Write / Construct Only
  "show-labels"          gboolean              : Read / Write / Construct Only

Signal Prototypes


"key-pressed"
            void        user_function      (PhatKeyboard *keyboard,
                                            gint key,
                                            gpointer user_data);
"key-released"
            void        user_function      (PhatKeyboard *keyboard,
                                            gint key,
                                            gpointer user_data);

Description

The PhatKeyboard widget family provides a simple piano-like keyboard. Since it is derived from GtkViewport, it comes with the ability to scroll. You don't have to worry about the values of the GtkAdjustment it uses, just share said adjustment with a scrollbar and you'll be in business.

PhatKeyboard is an abstract base class, from which PhatHKeyboard and PhatVKeyboard are derived. To create a new keyboard, call either phat_hkeyboard_new() or phat_vkeyboard_new().

Details

PhatKeyboard

typedef struct _PhatKeyboard PhatKeyboard;

The PhatKeyboard-struct struct contains private data only, and should be accessed using the functions below.


phat_keyboard_set_adjustment ()

void        phat_keyboard_set_adjustment    (PhatKeyboard *keyboard,
                                             GtkAdjustment *adjustment);

Sets the adjustment used by keyboard.

keyboard :

a PhatKeyboard

adjustment :

a GtkAdjustment


phat_keyboard_get_adjustment ()

GtkAdjustment* phat_keyboard_get_adjustment (PhatKeyboard *keyboard);

Retrives the current adjustment in use by keyboard.

keyboard :

a PhatKeyboard

Returns :

keyboard's current GtkAdjustment

Properties

The "numkeys" property

  "numkeys"              gint                  : Read / Write / Construct Only

How many keys this keyboard should have.

Allowed values: [1,1000]

Default value: 128


The "orientation" property

  "orientation"          GtkOrientation        : Read / Write / Construct Only

How the keyboard should be arranged on the screen.

Default value: GTK_ORIENTATION_VERTICAL


The "show-labels" property

  "show-labels"          gboolean              : Read / Write / Construct Only

Whether C keys should be labeled or not.

Default value: TRUE

Signals

The "key-pressed" signal

void        user_function                  (PhatKeyboard *keyboard,
                                            gint key,
                                            gpointer user_data);

The "key-pressed" signal is emitted whenever a key is pressed.

keyboard :

the object on which the signal was emitted

key :

the index of the key that was pressed

user_data :

user data set when the signal handler was connected.


The "key-released" signal

void        user_function                  (PhatKeyboard *keyboard,
                                            gint key,
                                            gpointer user_data);

The "key-released" signal is emitted whenever a key is released.

keyboard :

the object on which the signal was emitted

key :

the index of the key that was pressed

user_data :

user data set when the signal handler was connected.

See Also

PhatHKeyboard and PhatVKeyboard, to create new instances of PhatKeyboard.