diff options
author | 2009-01-26 22:43:08 -0500 | |
---|---|---|
committer | 2009-01-26 22:43:08 -0500 | |
commit | 5644dd27197711b3a69d0dd05e6a1b82c404f027 (patch) | |
tree | 6aa561f7ac8edd7aeda19fecc913c7b9cbde08c9 /src/lua_interface.c | |
parent | 6cd7f0016da3b5c138fa797cc8aaa9f8671b1419 (diff) | |
download | textadept-5644dd27197711b3a69d0dd05e6a1b82c404f027.tar.gz textadept-5644dd27197711b3a69d0dd05e6a1b82c404f027.zip |
Menu label text is irrelevant for menu actions due to l10n; focus on menu_id.
Diffstat (limited to 'src/lua_interface.c')
-rw-r--r-- | src/lua_interface.c | 12 |
1 files changed, 5 insertions, 7 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) { |