enum {
INSERT_SYNTAX,
+ ERASE,
n_SIGNALS
};
g_cclosure_marshal_VOID__STRING,
G_TYPE_NONE, 1,
G_TYPE_STRING);
+
+ keypad_signals[ERASE] = g_signal_new ("erase",
+ G_TYPE_FROM_CLASS (klass),
+ G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION,
+ G_STRUCT_OFFSET (PsppireKeypadClass,
+ keypad),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
static const char *keypad_insert_text[] = {
"0", "1", "2", "3", "4", "5", "6", "7", "8", "9",
".", "+", "-", "*", "**", "/", "=", "<>", "<", "<=",
- ">", ">=", "&", "|", "~", "(", ")"
+ ">", ">=", "&", "|", "~", "()", NULL
};
{
const gchar *s = g_hash_table_lookup (kp->frag_table, b);
- g_signal_emit (kp, keypad_signals [INSERT_SYNTAX], 0, s);
+
+ if ( s )
+ g_signal_emit (kp, keypad_signals [INSERT_SYNTAX], 0, s);
+ else
+ g_signal_emit (kp, keypad_signals [ERASE], 0);
}
static const gint cols = 6;
g_markup_printf_escaped ("<span style=\"italic\">x<sup>y</sup></span>");
label = gtk_label_new ("**");
+
gtk_label_set_markup (GTK_LABEL (label), markup);
g_free (markup);
kp->star_star = gtk_button_new ();
gtk_container_add (GTK_CONTAINER (kp->star_star), label);
+ gtk_widget_show (label);
+
add_button (kp, &kp->star_star,
0, 1,
4, 5);