MenuItem.setImage() GTK4 fix.#2552
MenuItem.setImage() GTK4 fix.#2552Theo-Dann-Muirhead-Renesas wants to merge 1 commit intoeclipse-platform:masterfrom
Conversation
|
@Theo-Dann-Muirhead-Renesas It looks like some part of your commit may be missing as build fails with:
Did you have a change to GTK4.java that should be included here? |
|
The full error is here, quoted below: |
|
Yes, I missed that two methods were not originally included |
|
Please resolve the conflicts with master. |
|
As you can see by the failing check - merge commits are not welcome, so please rebase on master without merge commits. |
bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java
Outdated
Show resolved
Hide resolved
| } else { | ||
| if (imageHandle == 0) { | ||
| GTK4.gtk_image_set_from_paintable(imageHandle, surface); | ||
| if (imageHandle == 0) error(SWT.ERROR_NO_HANDLES); |
There was a problem hiding this comment.
I get a crash here:
(SWT:623314): Gtk-CRITICAL **: 18:01:06.474: gtk_image_set_from_paintable: assertion 'GTK_IS_IMAGE (image)' failed
Exception in thread "main" org.eclipse.swt.SWTError: No more handles
at org.eclipse.swt.SWT.error(SWT.java:4980)
at org.eclipse.swt.SWT.error(SWT.java:4865)
at org.eclipse.swt.SWT.error(SWT.java:4836)
at org.eclipse.swt.widgets.Widget.error(Widget.java:598)
at org.eclipse.swt.widgets.MenuItem._setImage(MenuItem.java:1062)
at org.eclipse.swt.widgets.MenuItem._setEnabledOrDisabledImage(MenuItem.java:990)
at org.eclipse.swt.widgets.MenuItem.setImage(MenuItem.java:1037)
at org.eclipse.swt.examples.controlexample.MenuTab.createButtonSelected(MenuTab.java:97)
at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:83)
at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:286)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5884)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1656)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5099)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4540)
at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:240)
As imageHandle is 0 (checked on line 1060) you clearly can't set it but have to create it first.
There was a problem hiding this comment.
I get a crash here: (SWT:623314): Gtk-CRITICAL **: 18:01:06.474: gtk_image_set_from_paintable: assertion 'GTK_IS_IMAGE (image)' failed Exception in thread "main" org.eclipse.swt.SWTError: No more handles at org.eclipse.swt.SWT.error(SWT.java:4980) at org.eclipse.swt.SWT.error(SWT.java:4865) at org.eclipse.swt.SWT.error(SWT.java:4836) at org.eclipse.swt.widgets.Widget.error(Widget.java:598) at org.eclipse.swt.widgets.MenuItem._setImage(MenuItem.java:1062) at org.eclipse.swt.widgets.MenuItem._setEnabledOrDisabledImage(MenuItem.java:990) at org.eclipse.swt.widgets.MenuItem.setImage(MenuItem.java:1037) at org.eclipse.swt.examples.controlexample.MenuTab.createButtonSelected(MenuTab.java:97) at org.eclipse.swt.events.SelectionListener$1.widgetSelected(SelectionListener.java:83) at org.eclipse.swt.widgets.TypedListener.handleEvent(TypedListener.java:286) at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:91) at org.eclipse.swt.widgets.Display.sendEvent(Display.java:5884) at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1656) at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:5099) at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:4540) at org.eclipse.swt.examples.controlexample.ControlExample.main(ControlExample.java:240)
As imageHandle is 0 (checked on line 1060) you clearly can't set it but have to create it first.
I am still seeing this error..
I took the latest commit of this PR..
There was a problem hiding this comment.
My latest push should fix this particular issue but there is another I have found, currently reviewing #2511 to catch up on progress made recently.
|
I guess all the ImageSet() in the commit message should really be setImage(), right ? |
56e6a0f to
83bece3
Compare
|
There are conflicts with master, please always rebase on master before pushing new version. |
803a4bb to
a3128dd
Compare
a3128dd to
d3ad875
Compare
ImageSet() fix for GTK4. #2299
Previously ImageSet() returned null on GTK4, This is an implementation of ImageSet() for GTK4.
To test:
If Cascade dropdown has icons then the change is working.