[fxruby-users] mdiclient windows do not always activate on click

Joel VanderWerf vjoel at path.berkeley.edu
Fri Apr 27 17:52:03 EDT 2007

I just noticed that MDIClient windows do not automatically become 
current when they receive a mouse click, but only do so if the click 
happens inside of an enabled widget. This may very well be correct, but 
if so then what is the right way to handle it, if you want a more 
familiar window-manager behavior (click to focus)?

For example, if you change the mditest.rb example like so...

--- mditest.rb  2007-04-18 16:19:59.000000000 -0700
+++ mdi.rb      2007-04-27 14:44:54.000000000 -0700
@@ -134,7 +134,7 @@
      scrollwindow = FXScrollWindow.new(mdichild, 0)
      btn = FXButton.new(scrollwindow, TYGER,
-      :opts => LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 600, 
:height => 1000)
+      :opts => LAYOUT_FIX_WIDTH|LAYOUT_FIX_HEIGHT, :width => 100, 
:height => 100)
      btn.font = @font
      btn.backColor = FXColor::White

...and then click on the empty area within one of the windows behind the 
active child, then that window will not be made active.

However, adding the line

     scrollwindow.enabled = true

makes the behavior feel more normal (to me).

Is there any drawback to enabling things like scroll windows (probably 
also frames and matrixes, but I haven't tried them)?

Is there a better way to handle this?

       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

More information about the fxruby-users mailing list