-
Notifications
You must be signed in to change notification settings - Fork 182
MenuItem.setImage() GTK4 fix. #2552
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
MenuItem.setImage() GTK4 fix. #2552
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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..
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. |
83bece3
to
803a4bb
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.