[Gd-chatter] r11467 - branches/opendylan-melange/gtk-duim trunk/fundev/sources/duim/sheets
hannes at gwydiondylan.org
hannes at gwydiondylan.org
Wed Oct 3 01:32:14 CEST 2007
Author: hannes
Date: Wed Oct 3 01:32:13 2007
New Revision: 11467
Modified:
branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan
branches/opendylan-melange/gtk-duim/gtk-menus.dylan
branches/opendylan-melange/gtk-duim/library.dylan
branches/opendylan-melange/gtk-duim/module.dylan
trunk/fundev/sources/duim/sheets/sheets.dylan
Log:
Job: fd
fix right click popup menus in DUIM with GTK2 backend
I suspect the fix in duim/sheets/sheets.dylan to be a hack; the
behaviour of duim/gadgets/menus.dylan:sheet-mapped?-setter is
win32 specific (and should be moved out of DUIM?!)
But the workaround to open the GF and specify it on <gtk-menu-popup>
to do nothing when the first argument is #f works finde (apart from
losing possible sealing)
Modified: branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan (original)
+++ branches/opendylan-melange/gtk-duim/gtk-gadgets.dylan Wed Oct 3 01:32:13 2007
@@ -1231,7 +1231,16 @@
gtk-debug("right clicked on list control!");
when (gadget-popup-menu-callback(gadget))
gtk-set-button-time(event);
- distribute-popup-menu-callback(gadget, 0, x: round(event.GdkEventButton-x), y: round(event.GdkEventButton-y));
+ handle-event(gadget,
+ make(<popup-menu-gadget-event>,
+ gadget: gadget,
+ target: 0,
+ x: round(event.GdkEventButton-x),
+ y: round(event.GdkEventButton-y)));
+ //XXX: fix this when there is some spare time
+ //distribute-popup-menu-callback(gadget, 0,
+ // x: round(event.GdkEventButton-x),
+ // y: round(event.GdkEventButton-y));
end;
#t
end
Modified: branches/opendylan-melange/gtk-duim/gtk-menus.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/gtk-menus.dylan (original)
+++ branches/opendylan-melange/gtk-duim/gtk-menus.dylan Wed Oct 3 01:32:13 2007
@@ -439,6 +439,7 @@
sheet: gadget,
selection-owner: selection-owner)
end;
+
define sealed method make-gtk-mirror
(gadget :: <gtk-menu>)
=> (mirror :: <menu-mirror>)
@@ -456,24 +457,20 @@
define sealed method map-mirror
(_port :: <gtk-port>, menu :: <gtk-popup-menu>,
mirror :: <popup-menu-mirror>) => ()
- next-method();
- with-gdk-lock
- //with-disabled-event-handler (mirror.mirror-sheet.menu-owner.top-level-sheet.sheet-direct-mirror, #"expose-event")
- popup-gtk-menu(mirror.mirror-widget, 3);
- //end
-// gtk-menu-popup(mirror.mirror-widget, null-pointer(<GtkWidget>),
-// null-pointer(<GtkWidget>), null-pointer(<GtkMenuPositionFunc>),
-// null-pointer(<GPointer>), 3, 0);
- //gtk-menu-shell-set-ignore-enter(mirror.mirror-widget, 0);
-
- end
+ with-gdk-lock popup-gtk-menu(mirror.mirror-widget, 3); end
end method map-mirror;
-define sealed method set-mirror-parent (menu :: <popup-menu-mirror>, widget :: <gtk-mirror>) => ()
- with-gdk-lock
- //gtk-menu-attach-to-widget(menu.mirror-widget, menu.mirror-sheet.menu-owner.top-level-sheet.sheet-direct-mirror.mirror-widget, null-pointer(<GtkMenuDetachFunc>));
- //gtk-menu-set-screen(menu.mirror-widget, null-pointer(<GdkScreen>));
- end
+define method sheet-mapped?-setter
+ (mapped? == #f, menu :: <gtk-popup-menu>,
+ #key do-repaint? = #t, clear? = do-repaint?)
+ => (mapped? :: <boolean>)
+ #f;
+end;
+
+define sealed method set-mirror-parent
+ (menu :: <popup-menu-mirror>, widget :: <gtk-mirror>) => ()
+ //what are we supposed to do here?
+ //nothing works just great!
end;
/*---*** Should be called just before a menu pops up
Modified: branches/opendylan-melange/gtk-duim/library.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/library.dylan (original)
+++ branches/opendylan-melange/gtk-duim/library.dylan Wed Oct 3 01:32:13 2007
@@ -19,6 +19,7 @@
use gtk;
+ use stack-walker;
export gtk-duim;
end library gtk-duim;
Modified: branches/opendylan-melange/gtk-duim/module.dylan
==============================================================================
--- branches/opendylan-melange/gtk-duim/module.dylan (original)
+++ branches/opendylan-melange/gtk-duim/module.dylan Wed Oct 3 01:32:13 2007
@@ -20,6 +20,8 @@
use gtk;
+ use stack-walker;
+
// Basic classes
export <gtk-port>,
<gtk-medium>,
Modified: trunk/fundev/sources/duim/sheets/sheets.dylan
==============================================================================
--- trunk/fundev/sources/duim/sheets/sheets.dylan (original)
+++ trunk/fundev/sources/duim/sheets/sheets.dylan Wed Oct 3 01:32:13 2007
@@ -464,6 +464,10 @@
logand(sheet-flags(sheet), %sheet_mapped_mask) = %sheet_mapped
end method sheet-mapped?;
+define open generic sheet-mapped?-setter
+ (mapped? :: <boolean>, sheet :: <basic-sheet>,
+ #key do-repaint?, clear?)
+ => (mapped? :: <boolean>);
// Map sheets from the bottom up
// This can only move a sheet tree from the "managed" to the "mapped" state
More information about the chatter
mailing list