summaryrefslogtreecommitdiffstats
path: root/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
diff options
context:
space:
mode:
authorFelipe Heidrich <fheidric>2003-07-17 22:01:32 +0000
committerFelipe Heidrich <fheidric>2003-07-17 22:01:32 +0000
commit32fdd8863c72a019574ecc00d9d9db565cc0a0b1 (patch)
tree28f3b3583d4d3b9b523803e4c9accaefd02350db /bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
parent2626aa46d4d62c5ff2703814fc4a96fc226ffa06 (diff)
downloadeclipse.platform.swt-32fdd8863c72a019574ecc00d9d9db565cc0a0b1.tar.gz
eclipse.platform.swt-32fdd8863c72a019574ecc00d9d9db565cc0a0b1.tar.xz
eclipse.platform.swt-32fdd8863c72a019574ecc00d9d9db565cc0a0b1.zip
*** empty log message ***
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java23
1 files changed, 13 insertions, 10 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
index ddd331e799..8f93be90b5 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/ToolItem.java
@@ -475,16 +475,19 @@ int gtk_enter_notify_event (int widget, int event) {
return 0;
}
-int gtk_event_after (int widget, int event) {
- GdkEvent gdkEvent = new GdkEvent ();
- OS.memmove (gdkEvent, event, GdkEvent.sizeof);
- Menu menu = parent.menu;
- if (menu != null && gdkEvent.type == OS.GDK_BUTTON_PRESS) {
- GdkEventButton gdkEventButton = new GdkEventButton ();
- OS.memmove (gdkEventButton, event, GdkEventButton.sizeof);
- int button = gdkEventButton.button;
- if (button == 3) menu.setVisible (true);
- }
+int gtk_event_after (int widget, int gdkEvent) {
+ GdkEvent event = new GdkEvent ();
+ OS.memmove (event, gdkEvent, GdkEvent.sizeof);
+ switch (event.type) {
+ case OS.GDK_BUTTON_PRESS: {
+ GdkEventButton gdkEventButton = new GdkEventButton ();
+ OS.memmove (gdkEventButton, gdkEvent, GdkEventButton.sizeof);
+ if (gdkEventButton.button == 3) {
+ parent.showMenu ((int) gdkEventButton.x_root, (int) gdkEventButton.y_root);
+ }
+ break;
+ }
+ }
return 0;
}