Shortcut "Alt" to set MenuBar Visible
I've added the code below to detect "alt" keyboard event > set the menuBar visible
mousepad-window.h
Because i was unable to compile without this few lines
#ifndef G_SOURCE_FUNC
#define G_SOURCE_FUNC(f) ((GSourceFunc) (void (*)(void)) (f))
#endif
static gboolean
set_menubar_visible_keyboard_shortcut (MousepadWindow *window, GdkEventKey *event, gpointer data) {
if (event->keyval == GDK_KEY_Alt_L ||
event->keyval == GDK_KEY_Alt_R){
gtk_widget_set_visible (window->menubar, TRUE);
return TRUE;
}
return FALSE;
}
And inside the mousepad_window_create_menubar's function
// Detect keyboard "Alt" Shortcut
gtk_widget_add_events(window, GDK_KEY_PRESS_MASK);
g_signal_connect (G_OBJECT (window), "key_press_event", G_CALLBACK (set_menubar_visible_keyboard_shortcut), NULL);