Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

geanydoc: Current word as initial text in interactive mode #457

Merged
merged 1 commit into from
Jan 3, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions geanydoc/src/geanydoc.c
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ enum
KB_COUNT
};

GtkWidget *create_Interactive(void);
GtkWidget *create_Interactive(const gchar * default_word);

static gboolean word_check_left(gchar c)
{
Expand Down Expand Up @@ -221,11 +221,12 @@ kb_doc(G_GNUC_UNUSED guint key_id)
static void
kb_doc_ask(G_GNUC_UNUSED guint key_id)
{
gchar *word = NULL;
gchar *word = NULL, *default_word = current_word();
GtkWidget *dialog, *entry;

/* example configuration dialog */
dialog = create_Interactive();
dialog = create_Interactive(default_word);
g_free(default_word);

/* run the dialog and check for the response code */
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT)
Expand Down Expand Up @@ -290,7 +291,7 @@ on_comboboxType_changed(GtkComboBox * combobox, G_GNUC_UNUSED gpointer user_data
g_object_set_data (G_OBJECT (component), name, widget)

GtkWidget *
create_Interactive(void)
create_Interactive(const gchar * default_word)
{
GtkWidget *dialog_vbox1;
GtkWidget *entry_word;
Expand All @@ -306,6 +307,8 @@ create_Interactive(void)
dialog_vbox1 = GTK_DIALOG(dialog)->vbox;

entry_word = gtk_entry_new();
if (default_word)
gtk_entry_set_text(GTK_ENTRY(entry_word), default_word);
gtk_widget_show(entry_word);
gtk_box_pack_start(GTK_BOX(dialog_vbox1), entry_word, TRUE, TRUE, 0);

Expand Down