working popup windows
- From: Giuliano Cioffi <g cioffi tiscali it>
- To: gtk-perl-list gnome org
- Subject: working popup windows
- Date: Tue, 3 Feb 2004 15:00:46 +0100
Hi Everyone,
I needed a special Gtk2::Combo-like widget which instead of showing a
list would display a window with various, user defined, widgets in it.
So, after too much time spent on ``gtkcombo.c'' and google, I finally
came up with the code here attached. It works (besides some cosmetic
issues) as I'd expect, grabbing the pointer/keyboard, etc.
There's still an issue left:
- When I use a true popup window, if one of the widgets it holds try to
grab_focus another one (within the popup), the focus instead goes back
on the application toplevel window, exactly where it left when I popped
up the combo one (see ``focus the entry'' button or try to select
something in the ``subcombo'').
- When I use a toplevel undecorated window (FAKE_POPUP => 1), everything
works fine. The point is that some X servers still put borders around
the window (namely cygwin's X port) and anyway the popup solution seems
best to me.
Any ideas? (maybe I'm just missing something)
I intended this thing to continue from where Muppet left off with his
``cellrenderer_date.pl'' example (I didn't find much docs/examples on
this particular subject), but I'd really like to sort out this focus
problem.
keywords: popup, focus, grab, ungrab, pointer_grab, keyboard_grab
thanks,
--
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){}}}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]