Exemple #1
0
int
key_action_insert (GtkWidget * wid, GdkEventKey * evt, char *d1, char *d2,
						 struct session *sess)
{
	int tmp_pos;

	if (!d1)
		return 1;

	tmp_pos = SPELL_ENTRY_GET_POS (wid);
	SPELL_ENTRY_INSERT (wid, d1, strlen (d1), &tmp_pos);
	SPELL_ENTRY_SET_POS (wid, tmp_pos);
	return 2;
}
Exemple #2
0
static void
ascii_click (GtkWidget * wid, gpointer userdata)
{
	int tmp_pos;
	const char *text;

	if (current_sess)
	{
		text = gtk_button_get_label (GTK_BUTTON (wid));
		wid = current_sess->gui->input_box;
		tmp_pos = SPELL_ENTRY_GET_POS (wid);
		SPELL_ENTRY_INSERT (wid, text, -1, &tmp_pos);
		SPELL_ENTRY_SET_POS (wid, tmp_pos);
	}
}