GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Mon Sep 22, 2014 4:13 am

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: gtk_main_do_event and gdk_get_event
PostPosted: Thu Dec 27, 2007 3:59 pm 
Offline
Familiar Face

Joined: Thu Dec 27, 2007 3:49 pm
Posts: 38
Im porting my win32 application on Linux and im using GTK+.

In my application there are these lines
Code:
while(PeekMessage(&msg,NULL,0,0,PM_REMOVE))
DispatchMessage(&msg);


I have tried with these lines in GTK+

Code:
while((event = gdk_event_get()) != NULL){
gtk_main_do_event(event);
gdk_event_free(event);
}


but this code doesnt work. These lines don't intercept any messages, in particularly I should intercept the keyboard messages. How can I do?
Thanks to all for the answers.


Top
 Profile  
 
 Post subject:
PostPosted: Sat Dec 29, 2007 5:26 am 
Offline
Familiar Face

Joined: Thu Dec 27, 2007 3:49 pm
Posts: 38
anybody that helps me?


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 30, 2007 12:44 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
This is curious to me... I've never dealt with trying to capture events outside the scope of my own application. That is what you're trying to do right? This may depend on the platform and desktop manager...

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Sun Dec 30, 2007 5:38 pm 
Offline
Familiar Face

Joined: Thu Dec 27, 2007 3:49 pm
Posts: 38
I solved with this :

Code:
        gtk_main_iteration_do (false);   
   hwnd = gtk_grab_get_current();
   if(hwnd != NULL){
      if(GTK_IS_MENU_SHELL(hwnd))
         return TRUE;
   }


and i activate a snooper for key events. It works well but itsnt just.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 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:  
cron
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group