Re: working popup windows



Looks like, while it stole the pointer and focus grab, the combo box
somehow didn't steal the keyboard grab.  The combo box code does grab
the keyboard, though, so I'm rather lost now as to why this happens.

In general, it seems to be a bad idea to have popups that potentially
spawn other popups.

  I  ended up  using  a  toplevel, undecorated,  window.  As for  normal
comboboxes/other  widgets  stealing  my  grabs,  I  made  the  following
assumptions:
  - in such  cases, I  receive  a ``leave_notify_event''  with  mode  eq
    'grab'
  - if the main purpose for a widget to grab the pointer/keyboard  is to
    open a  ``modal'' window and be  able to close it  whenever the user
    clicks outside  of it, the widget that has the focus  when this grab
    takes place will soon lose it
  - so,  when  I  receive  the ``leave_notify_event'',  I  hook to  this
    widget's ``focus_in_event'', re-grabbing everything when this signal
    is triggered
  - this last grab causes  an ``enter_notify_event'' with mode eq 'grab'
    that  I  intercept in  order  to  disconnect the  ``focus_in_event''
    handler.

The above seems to do the trick.

thanks,
ciao,
-- 
Giuliano

#!/usr/bin/perl
$i=$j=$r=$b=-16.0;while((print"\n"),$b++<15){foreach$a(0..78){print
+(split //,' .:-;!/>)|&IH%*#')[$k&15];for($i=$k=$r=0;$j=$r*$r-$i*$i
-2+$a/25,$i=2*$r*$i+$b/10,$j*$j+$i*$i<11&&$k++<111;$r=$j){}}}

Attachment: popcombo.pl.gz
Description: application/gunzip



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]