eclipse.platform.swt icon indicating copy to clipboard operation
eclipse.platform.swt copied to clipboard

MenuItem.setImage() GTK4 fix.

Open Theo-Dann-Muirhead-Renesas opened this issue 3 months ago • 8 comments

ImageSet() fix for GTK4. #2299 Previously ImageSet() returned null on GTK4, This is an implementation of ImageSet() for GTK4.

To test:

  • Ensure GTK4 is forced with "SWT_GTK4 = 1" environment variable in ControlExample.
  • Start ControlExample -> Click "Menu" -> Check "Images" -> Click "Create Shell"

If Cascade dropdown has icons then the change is working.

image

Test Results

  118 files  ±0    118 suites  ±0   11m 41s ⏱️ +53s 4 583 tests ±0  4 547 ✅ ±0  36 💤 ±0  0 ❌ ±0    330 runs  ±0    307 ✅ ±0  23 💤 ±0  0 ❌ ±0 

Results for commit d3ad875b. ± Comparison against base commit 12ac449f.

:recycle: This comment has been updated with latest results.

github-actions[bot] avatar Sep 26 '25 13:09 github-actions[bot]

@Theo-Dann-Muirhead-Renesas It looks like some part of your commit may be missing as build fails with:

Error: The method gtk_reorder_child_after(long, long, int) is undefined for the type GTK4

Did you have a change to GTK4.java that should be included here?

jonahgraham avatar Sep 26 '25 13:09 jonahgraham

The full error is here, quoted below:

Error:  Failed to execute goal org.eclipse.tycho:tycho-compiler-plugin:5.0.0:compile (default-compile) on project org.eclipse.swt.gtk.linux.ppc64le: Compilation failure: Compilation failure: 
Error:  /home/runner/work/eclipse.platform.swt/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java:[1065] 
Error:  	GTK4.gtk_reorder_child_after(boxHandle, imageHandle, 0);
Error:  	     ^^^^^^^^^^^^^^^^^^^^^^^
Error:  The method gtk_reorder_child_after(long, long, int) is undefined for the type GTK4
Error:  /home/runner/work/eclipse.platform.swt/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java:[1095] 
Error:  	GTK4.gtk_box_remove(boxHandle, imageHandle);
Error:  	     ^^^^^^^^^^^^^^
Error:  The method gtk_box_remove(long, long) is undefined for the type GTK4
Error:  /home/runner/work/eclipse.platform.swt/eclipse.platform.swt/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/MenuItem.java:[1103] 
Error:  	GTK4.gtk_box_remove(boxHandle, imageHandle);
Error:  	     ^^^^^^^^^^^^^^
Error:  The method gtk_box_remove(long, long) is undefined for the type GTK4
Error: [ERROR] 5 problems (3 errors, 2 warnings)
Error:  -> [Help 1]

jonahgraham avatar Sep 26 '25 13:09 jonahgraham

Yes, I missed that two methods were not originally included

Please resolve the conflicts with master.

akurtakov avatar Sep 26 '25 14:09 akurtakov

As you can see by the failing check - merge commits are not welcome, so please rebase on master without merge commits.

akurtakov avatar Sep 26 '25 14:09 akurtakov

I guess all the ImageSet() in the commit message should really be setImage(), right ?

akurtakov avatar Sep 26 '25 15:09 akurtakov

There are conflicts with master, please always rebase on master before pushing new version.

akurtakov avatar Oct 01 '25 10:10 akurtakov