GIDForums  

Go Back   GIDForums > Computer Programming Forums > FLTK Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 06-Dec-2007, 20:45
ykhuang ykhuang is offline
New Member
 
Join Date: Jun 2007
Posts: 9
ykhuang is on a distinguished road

Can Fl_Window response to some event?


Hello there,

I have a window with some widgets on it. I want to catch mouse click events in the window but not on children. Although a callback has been set to the window but it was never triggered. I look into FLTK source and see that Fl_Window uses Fl_Group::handle() to handle events. In the section of FL_PUSH, it just passes events to each of its children and do no callback.

I don't want to change the FLTK source. Is there any way I can handle events outside of child widgets?

Thanks.
  #2  
Old 13-Jan-2008, 04:33
rbp rbp is offline
Junior Member
 
Join Date: Nov 2005
Location: Melbourne, Australia
Posts: 67
rbp will become famous soon enough

Re: Can Fl_Window response to some event?


an event will only go to its children if the handle event returns zero, indicating it was not handled. http://www.fltk.org/documentation.ph...ng.html#handle

So try overloading the Fl_Window handle() function like this:
CPP / C++ / C Code:
int YourClass::handle(int event) {
  // ... your code
  return 1;
}
 
 

Recent GIDBlogInstall Adobe Flash - Without Administrator Rights by LocalTech

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Read a file on a click event. eranga262154 MS Visual C++ / MFC Forum 0 16-Oct-2007 00:46
Event Management System Reny C++ Forum 2 10-Mar-2007 10:19
OnExit event of an edit box dedeco C++ Forum 4 27-Feb-2007 05:50
How to generate mouse event? high12398 C++ Forum 3 20-Apr-2006 18:24
Using an ActiveX event couderta MS Visual C++ / MFC Forum 0 17-Apr-2006 05:37

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 07:51.


vBulletin, Copyright © 2000 - 2010, Jelsoft Enterprises Ltd.