added signal and handler for F12 key pressed in the main window

git-svn-id: https://geany.svn.sourceforge.net/svnroot/geany/trunk@28 ea778897-0a13-0410-b9d1-a72fbfd435f5
This commit is contained in:
Enrico Tröger 2005-11-30 23:33:35 +00:00
parent b3dabbb424
commit e9569abf85
3 changed files with 30 additions and 1 deletions

View File

@ -400,8 +400,14 @@ on_preferences1_activate (GtkMenuItem *menuitem,
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(2)); "font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(2));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "editor_font"), g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "editor_font"),
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(3)); "font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(3));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "font_term"),
"font-set", G_CALLBACK(on_prefs_font_choosed), GINT_TO_POINTER(4));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "long_line_color"), g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "long_line_color"),
"color-set", G_CALLBACK(on_prefs_color_choosed), NULL); "color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(1));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "color_fore"),
"color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(2));
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "color_back"),
"color-set", G_CALLBACK(on_prefs_color_choosed), GINT_TO_POINTER(3));
// file chooser buttons in the tools tab // file chooser buttons in the tools tab
g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_gcc"), g_signal_connect((gpointer) lookup_widget(app->prefs_dialog, "button_gcc"),
"clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_c")); "clicked", G_CALLBACK(on_pref_tools_button_clicked), lookup_widget(app->prefs_dialog, "entry_com_c"));
@ -968,6 +974,21 @@ on_window_configure_event (GtkWidget *widget,
} }
gboolean
on_window_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data)
{
if (event->keyval == GDK_F12)
{
gtk_notebook_set_current_page(GTK_NOTEBOOK(msgwindow.notebook), MSG_SCRATCH);
gtk_widget_grab_focus(lookup_widget(app->window, "textview_scribble"));
return TRUE;
}
return FALSE;
}
gboolean gboolean
on_editor_key_press_event (GtkWidget *widget, on_editor_key_press_event (GtkWidget *widget,
GdkEventKey *event, GdkEventKey *event,

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id$
*/ */
@ -610,3 +611,8 @@ on_tv_notebook_switch_page (GtkNotebook *notebook,
void void
on_openfiles_tree_popup_clicked (GtkMenuItem *menuitem, on_openfiles_tree_popup_clicked (GtkMenuItem *menuitem,
gpointer user_data); gpointer user_data);
gboolean
on_window_key_press_event (GtkWidget *widget,
GdkEventKey *event,
gpointer user_data);

View File

@ -17,6 +17,7 @@
* along with this program; if not, write to the Free Software * along with this program; if not, write to the Free Software
* Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
* *
* $Id$
*/ */
@ -339,6 +340,7 @@ gint main(gint argc, gchar **argv)
// registering some basic events // registering some basic events
g_signal_connect(G_OBJECT(app->window), "delete_event", G_CALLBACK(on_exit_clicked), NULL); g_signal_connect(G_OBJECT(app->window), "delete_event", G_CALLBACK(on_exit_clicked), NULL);
g_signal_connect(G_OBJECT(app->window), "configure-event", G_CALLBACK(on_window_configure_event), NULL); g_signal_connect(G_OBJECT(app->window), "configure-event", G_CALLBACK(on_window_configure_event), NULL);
g_signal_connect(G_OBJECT(app->window), "key-press-event", G_CALLBACK(on_window_key_press_event), NULL);
g_signal_connect(G_OBJECT(app->toolbar), "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL); g_signal_connect(G_OBJECT(app->toolbar), "button-press-event", G_CALLBACK(toolbar_popup_menu), NULL);
g_signal_connect(G_OBJECT(GTK_COMBO(app->tag_combo)->entry), "changed", G_CALLBACK(on_toolbar_tag_clicked), NULL); g_signal_connect(G_OBJECT(GTK_COMBO(app->tag_combo)->entry), "changed", G_CALLBACK(on_toolbar_tag_clicked), NULL);