Re: Verifying input data before gtk_dialog_run returns
- From: G Hasse <gh raditex se>
- To: Jaap Haitsma <jaap haitsma org>
- Cc: gtk-app-devel-list gnome org
- Subject: Re: Verifying input data before gtk_dialog_run returns
- Date: Thu, 22 Mar 2007 01:27:29 +0100
Hello,
What you should do is
void enter_callback(GtkWidget *widget, GtkWidget *entry)
{
gchar *entry_text = NULL;
entry_text = gtk_entry_get_text(GTK_ENTRY(entry));
// Check to se what the entry contains...
printf("the entry: %s\n", entry_text);
}
main()
{
....
entry = gtk_entry_new();
g_signal_connect(GTK_OBJECT(entry), "key-press-event",
GTK_SIGNAL_FUNC(enter_callback),
entry);
}
BUT! I get a segmentation fault at gtk_entry_get_text(GTK_ENTRY(entry))
that I dont understand...
I seams as the entry don't gets its content until you press enter.
The funny thing is that the signal "backspace" works as expected.
There should realy be a signal "key-insert" to validate characters
in progress into the entry widget. But I can't find sutch.
--
Göran Hasse
----------------------------------------------------------------
Göran Hasse email: gh raditex se Tel: 08-6949270
Raditex AB http://www.raditex.se
Planiavägen 15, 1tr Mob: 070-5530148
131 34 NACKA, SWEDEN OrgNr: 556240-0589
VAT: SE556240058901
------------------------------------------------------------------
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]