Can you define an event when an FXMDIChild gets focus? 
Author Message
 Can you define an event when an FXMDIChild gets focus?

I've been reading over the FOX API and the FXRuby documentation
and I can't seem to find this anywhere.

In an MDI app, how can you define an event that gets kicked off
when a MDI child window gets focus?

I want to change the app's window title to reflect the MDI
child's name, kind of like:

"App Title: MDI Child Title"

I'm figuring I can make this change every time a MDI child
gets focus, it can set the main window's title.  I just
can't figure out how to do this and the mditest.rbw example
that came with FXRuby doesn't really cover a lot of the
MDI functionality.

Can anyone help point me in the right direction?

-- Dossy

--

Panoptic Computer Network             web: http://www.*-*-*.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)



Mon, 01 Nov 2004 12:57:19 GMT  
 Can you define an event when an FXMDIChild gets focus?

Quote:

> In an MDI app, how can you define an event that gets kicked off
> when a MDI child window gets focus?

Try (in the mditest.rbw) adding the line
    mdichild = createTestWindow(10, 10, 400, 300)
    mdichild.connect(SEL_FOCUSIN){|send, sel, ev| setTitle(send.getTitle)}

David Naseby



Mon, 01 Nov 2004 13:33:45 GMT  
 Can you define an event when an FXMDIChild gets focus?

Quote:

> > In an MDI app, how can you define an event that gets kicked off
> > when a MDI child window gets focus?

> Try (in the mditest.rbw) adding the line
>     mdichild = createTestWindow(10, 10, 400, 300)
>     mdichild.connect(SEL_FOCUSIN){|send, sel, ev| setTitle(send.getTitle)}

Thanks!  To define event handlers you use #connect ... duh.

-- Dossy

--

Panoptic Computer Network             web: http://www.panoptic.com/
  "He realized the fastest way to change is to laugh at your own
    folly -- then you can let go and quickly move on." (p. 70)



Mon, 01 Nov 2004 14:15:45 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting X focus when getting Tk focus

2. Extend TK event loop to handle user defined event

3. User-defined functions in micro-focus cobol 3.4?

4. How can ST know when it gets focus???

5. RTFobject not getting focus

6. Getting focus for a list

7. Problem getting MDI Window focus

8. Where is the LOSE FOCUS event?

9. CosmoPlayer, Key events, Focus, JavaScript?

10. gtkwave: warping to events & defining mnemonics

11. How to define event handler in win32com?

12. TKinter and focus events

 

 
Powered by phpBB® Forum Software