diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/lua_interface.c | 8 | ||||
-rw-r--r-- | src/textadept.c | 5 |
2 files changed, 11 insertions, 2 deletions
diff --git a/src/lua_interface.c b/src/lua_interface.c index 71c1f07e..745ce368 100644 --- a/src/lua_interface.c +++ b/src/lua_interface.c @@ -67,6 +67,7 @@ static int l_cf_ta_buffer_new(lua_State *lua), l_cf_pm_focus(lua_State *lua), l_cf_pm_clear(lua_State *lua), l_cf_pm_activate(lua_State *lua), + l_cf_pm_add_browser(lua_State *lua), l_cf_find_focus(lua_State *lua), l_cf_call_find_next(lua_State *lua), l_cf_call_find_prev(lua_State *lua), @@ -117,6 +118,7 @@ bool l_init(int argc, char **argv, bool reinit) { l_cfunc(lua, l_cf_pm_focus, "focus"); l_cfunc(lua, l_cf_pm_clear, "clear"); l_cfunc(lua, l_cf_pm_activate, "activate"); + l_cfunc(lua, l_cf_pm_add_browser, "add_browser"); l_mt(lua, "_pm_mt", l_pm_mt_index, l_pm_mt_newindex); lua_setfield(lua, -2, "pm"); lua_newtable(lua); @@ -1557,6 +1559,12 @@ static int l_cf_pm_activate(lua_State *) { return 0; } +static int l_cf_pm_add_browser(lua_State *lua) { + GtkWidget *pm_combo = gtk_widget_get_parent(pm_entry); + gtk_combo_box_append_text(GTK_COMBO_BOX(pm_combo), lua_tostring(lua, -1)); + return 0; +} + static int l_cf_find_focus(lua_State *) { find_toggle_focus(); return 0; diff --git a/src/textadept.c b/src/textadept.c index 1cf899e0..6d9c98e7 100644 --- a/src/textadept.c +++ b/src/textadept.c @@ -588,9 +588,10 @@ void cfurlref_to_char(CFURLRef url, char *path, int len) { GtkWidget *pm_create_ui() { pm_container = gtk_vbox_new(FALSE, 1); - pm_entry = gtk_entry_new(); + GtkWidget *pm_combo = gtk_combo_box_entry_new_text(); + pm_entry = gtk_bin_get_child(GTK_BIN(pm_combo)); gtk_widget_set_name(pm_entry, "textadept-pm-entry"); - gtk_box_pack_start(GTK_BOX(pm_container), pm_entry, FALSE, FALSE, 0); + gtk_box_pack_start(GTK_BOX(pm_container), pm_combo, FALSE, FALSE, 0); pm_store = gtk_tree_store_new(3, G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING); GtkTreeSortable *sortable = GTK_TREE_SORTABLE(pm_store); |