Re: Signal when the content of a GtkEntry is changed



Thanks for all this answers :]

I choosed the focus-out-event solution :

I connect the signal to my entry :
g_signal_connect_swapped(pMyApp->pEntryMenuName, "focus-out-event", 
G_CALLBACK(entryMenuName_changed), (gpointer)pMyApp);

pMyApp is a structure contain some pointer like pEntryMenuName or also a 
string contain the value of the entry before any changes.

gboolean entryMenuName_changed(GtkWidget *pWidget, gpointer pdata) {

MainWindow *pMyApp;

pMyApp = (MainWindow *)pWidget;

if ( strcmp(pMyApp->szMenuName, 
gtk_entry_get_text(GTK_ENTRY(pMyApp->pEntryMenuName))) ) {
menu_edited(TRUE, pMyApp);
}

return FALSE;
}

Thank you

On 8/16/05, John Coppens <john jcoppens com> wrote:

On Tue, 16 Aug 2005 13:13:08 -0500
Douglas Vechinski <douglas vechinski dynetics com> wrote:

What may be desired is when the changes are done. Suppose the
entry contained a value like 9.8 and someone wants to change the value
to 12.2. This might be done my backspacing, deleting all the characters
and then entering 12.2.

Then you have two choices: One is the "activate" signal, which gets sent
when you press <enter> and such. The other is the "focus-out-event" which
happens when you go elsewhere.

John
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]