GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Tue Sep 23, 2014 8:20 am

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Default response of GtkDialog
PostPosted: Thu Sep 15, 2011 10:17 am 
Offline
Familiar Face

Joined: Wed Aug 17, 2011 12:20 pm
Posts: 20
Hi,

I've tried to use
Code:
gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_ACCEPT);

but the dialog does not close when I hit ENTER. I suspect this is due to a GtkEntry inside the dialog, which apparently grabs the focus and handles (almost) all key events. I tried to catch the ENTER event inside a "insert-text" handler for the entry, but only non-control characters show up in that handler.

I guess there is a way to divert the ENTER event to the dialog?

Cheers Peter


Top
 Profile  
 
 Post subject: Re: Default response of GtkDialog
PostPosted: Thu Sep 15, 2011 4:22 pm 
Offline
Never Seen the Sunlight

Joined: Wed Jul 23, 2008 10:31 am
Posts: 2406
Location: Slovenia
Hi.

It really seems that GtkEntry "eats" your enter and uses it to emit GtkEntry::activate signal. Maybe you can connect to this signal on your entry and call gtk_dialog_response() from there?

Tadej


Top
 Profile  
 
 Post subject: Re: Default response of GtkDialog
PostPosted: Mon Sep 26, 2011 11:52 am 
Offline
Familiar Face

Joined: Wed Aug 17, 2011 12:20 pm
Posts: 20
This trick does the job. Thank you very much.

Cheers Peter


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 4 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