aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/lua_interface.c12
-rw-r--r--src/textadept.c5
2 files changed, 7 insertions, 10 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c
index 023bd7c0..dc54488a 100644
--- a/src/lua_interface.c
+++ b/src/lua_interface.c
@@ -1491,14 +1491,12 @@ static int l_cf_view_goto_buffer(lua_State *lua) {
return 0;
}
-static void t_menu_activate(GtkWidget *menu_item, gpointer menu_id) {
- GtkWidget *label = gtk_bin_get_child(GTK_BIN(menu_item));
- const char *text = gtk_label_get_text(GTK_LABEL(label));
+static void t_menu_activate(GtkWidget *, gpointer menu_id) {
int id = reinterpret_cast<int>(menu_id);
- char *param = static_cast<char*>(malloc(sizeof(char) * (strlen(text) + 12)));
- sprintf(param, "%s|%i\0", text, id);
- l_handle_event("menu_clicked", param);
- g_free(param);
+ char *menu_id_str = static_cast<char*>(malloc(sizeof(char) * 12));
+ sprintf(menu_id_str, "%i", id);
+ l_handle_event("menu_clicked", menu_id_str);
+ g_free(menu_id_str);
}
static int l_cf_ta_gtkmenu(lua_State *lua) {
diff --git a/src/textadept.c b/src/textadept.c
index de24626e..ebc0d6d2 100644
--- a/src/textadept.c
+++ b/src/textadept.c
@@ -56,7 +56,7 @@ static void pm_row_activated(GtkTreeView *, GtkTreePath *, GtkTreeViewColumn *,
gpointer);
static gbool pm_button_press(GtkTreeView *, GdkEventButton *event, gpointer);
static gbool pm_popup_menu(GtkWidget *, gpointer);
-static void pm_menu_activate(GtkWidget *menu_item, gpointer menu_id);
+static void pm_menu_activate(GtkWidget *, gpointer menu_id);
// Find/Replace
GtkWidget *findbox, *find_entry, *replace_entry, *fnext_button, *fprev_button,
@@ -770,11 +770,10 @@ void pm_popup_context_menu(GdkEventButton *event) {
/**
* Performs a Lua action for a selected Project Manager menu item.
- * @param menu_item The menu item.
* @param menu_id The numeric ID for the menu item.
* @see l_pm_perform_menu_action
*/
-void pm_process_selected_menu_item(GtkWidget *menu_item, int menu_id) {
+void pm_process_selected_menu_item(GtkWidget *, int menu_id) {
GtkTreePath *path;
GtkTreeViewColumn *column;
gtk_tree_view_get_cursor(GTK_TREE_VIEW(pm_view), &path, &column);