Re: Entry widget



Hello,
If I understand correctly (you want to get an entry content on button
click) you have to do the following in your callback_card() function:
1. Remove gtk_widget_destroy callback on "clicked" signal.
2. Connect your own callback.

Like this:
static void
my_callback (GtkWidget *button, GtkWidget *entry)
{
  g_print ("Entry content: %s\n", gtk_entry_get_text (GTK_ENTRY (entry)));
  enter_callback (NULL, entry);
  gtk_main_quit ();
}

/* put this line instead of g_signal_connect_swapped */
g_signal_connect (button, "clicked", G_CALLBACK (my_callback), entry);

PS: please read all tutorials you can find on GTK+ and look at every
code sample in GTK+ tarball.

 Olexiy



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