![]() | ![]() | ![]() | PHAT Reference Manual | ![]() |
---|
PhatKeyboard; void phat_keyboard_set_adjustment (PhatKeyboard *keyboard, GtkAdjustment *adjustment); GtkAdjustment* phat_keyboard_get_adjustment (PhatKeyboard *keyboard);
GObject +----GtkObject +----GtkWidget +----GtkContainer +----GtkBin +----GtkViewport +----PhatKeyboard +----PhatVKeyboard +----PhatHKeyboard
"numkeys" gint : Read / Write / Construct Only "orientation" GtkOrientation : Read / Write / Construct Only "show-labels" gboolean : Read / Write / Construct Only
"key-pressed" void user_function (PhatKeyboard *keyboard, gint key, gpointer user_data); "key-released" void user_function (PhatKeyboard *keyboard, gint key, gpointer user_data);
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()
.
typedef struct _PhatKeyboard PhatKeyboard;
The PhatKeyboard-struct struct contains private data only, and should be accessed using the functions below.
void phat_keyboard_set_adjustment (PhatKeyboard *keyboard, GtkAdjustment *adjustment);
Sets the adjustment used by keyboard
.
keyboard : | |
adjustment : | a GtkAdjustment |
GtkAdjustment* phat_keyboard_get_adjustment (PhatKeyboard *keyboard);
Retrives the current adjustment in use by keyboard
.
keyboard : | |
Returns : | |
"numkeys" gint : Read / Write / Construct Only
How many keys this keyboard should have.
Allowed values: [1,1000]
Default value: 128
"orientation" GtkOrientation : Read / Write / Construct Only
How the keyboard should be arranged on the screen.
Default value: GTK_ORIENTATION_VERTICAL
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. |
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. |
<<< PhatSliderButton | PhatHKeyboard >>> |