+2007-06-07 Neil J. Patel <njp@o-hand.com>
+
+ * clutter/clutter-entry.c: (clutter_entry_class_init),
+ (clutter_entry_handle_key_event):
+ * clutter/clutter-entry.h:
+ Added an 'activated' signal, whihc is emitted when the 'Enter' key is
+ pressed.
+
+ * examples/test-entry.c: (on_entry_activated), (main):
+ Added a test handler for the activated signal.
+
2007-06-07 Emmanuele Bassi <ebassi@openedhand.com>
* clutter/*: Move documentation from the templates into the
{
TEXT_CHANGED,
CURSOR_EVENT,
+ ACTIVATE,
LAST_SIGNAL
};
clutter_marshal_VOID__BOXED,
G_TYPE_NONE, 1,
CLUTTER_TYPE_GEOMETRY | G_SIGNAL_TYPE_STATIC_SCOPE);
+
+ /**
+ * ClutterEntry::activate:
+ * @entry: the actor which received the event
+ *
+ * The ::cursor-event signal is emitted each time the netry is 'activated'
+ * by the user, normally by pressing the 'Enter' key. This will only be
+ * emitted when your are adding text to the entry via
+ * #clutter_entry_handle_key_event.
+ */
+ entry_signals[ACTIVATE] =
+ g_signal_new ("activate",
+ G_TYPE_FROM_CLASS (gobject_class),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (ClutterEntryClass, activate),
+ NULL, NULL,
+ clutter_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
g_type_class_add_private (gobject_class, sizeof (ClutterEntryPrivate));
}
case CLUTTER_Return:
case CLUTTER_KP_Enter:
case CLUTTER_ISO_Enter:
+ g_signal_emit (G_OBJECT (entry), entry_signals[ACTIVATE], 0);
+ break;
case CLUTTER_Escape:
case CLUTTER_Up:
case CLUTTER_KP_Up:
void (* text_changed) (ClutterEntry *entry);
void (* cursor_event) (ClutterEntry *entry,
ClutterGeometry *geometry);
+ void (* activate) (ClutterEntry *entry);
/* padding for future */
void (*_clutter_entry_1) (void);
}
}
+static void
+on_entry_activated (ClutterEntry *entry, gpointer null)
+{
+ g_print ("Activated: %s\n", clutter_entry_get_text (entry));
+}
+
int
main (int argc, char *argv[])
{
g_signal_connect (entry, "text-changed",
G_CALLBACK (on_entry_text_changed), NULL);
*/
+ g_signal_connect (entry, "activate",
+ G_CALLBACK (on_entry_activated), NULL);
clutter_main();
return 0;