GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Nov 27, 2014 11:50 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Help signal handling
PostPosted: Wed Jun 18, 2008 2:10 pm 
Offline

Joined: Wed Jun 18, 2008 2:02 pm
Posts: 2
Hi all,
i'm a new user of the forum, i decided to register to this forum 'cause I've a little problem with signal handling in gtk+.
I'm creating a login gui that use a message queue to communicate with a server process and when i click on a button i've to get a text entry (login name) to the main function.
is there a method to get the signal handler return? in the signal handler i get entry text and terurn his value but i don't know how to catch it in the main function.
SORRY FOR MY ENGLISH
but i'm italian.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 18, 2008 6:36 pm 
Offline
Never Seen the Sunlight

Joined: Thu Jun 14, 2007 11:02 pm
Posts: 923
Location: Falun, WI USA
I didn't quite get what you wanted to accomplish, but these should help:
This is the signal that is sent when "Enter" or "Return" is pressed in a GtkEntry
http://library.gnome.org/devel/gtk/stab ... y-activate
This is the signal that is sent when a GtkButton is clicked
http://library.gnome.org/devel/gtk/stab ... on-clicked

So if you want to have the entry sent to the button's clicked callback,
you could use:
Code:
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(button_clicked_cb), (gpointer)entry);

And if you wanted to use the same callback for both the button's clicked and the entry's activate signals, you could do:
Code:
g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(get_login_info), (gpointer)entry);
g_signal_connect(G_OBJECT(entry), "activate", G_CALLBACK(get_login_info), (gpointer)entry);


Top
 Profile  
 
 Post subject: Re
PostPosted: Wed Jun 18, 2008 11:28 pm 
Offline

Joined: Wed Jun 18, 2008 2:02 pm
Posts: 2
thanks for the reply, i know how to connect signals, my problem is different but i think isn't a way to solve it.
I would like return a string by the handler and use the value returned in the main.
Dave.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 3 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group