Skip to content

Commit 01081fc

Browse files
committed
[GTK] Support background image on GTK 4 in Table
Without the patch it crashes with no more handles as GtkCellRendererPixbuf if final struct on Gtk4 and thus SWT can't create it's own.
1 parent 8eb7937 commit 01081fc

File tree

1 file changed

+6
-1
lines changed
  • bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets

1 file changed

+6
-1
lines changed

bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Table.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,12 @@ void createRenderers (long columnHandle, int modelIndex, boolean check, int colu
839839
GTK.gtk_tree_view_column_add_attribute (columnHandle, checkRenderer, OS.cell_background_rgba, BACKGROUND_COLUMN);
840840
}
841841
}
842-
long pixbufRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), 0) : GTK.gtk_cell_renderer_pixbuf_new ();
842+
long pixbufRenderer ;
843+
if (GTK.GTK4) {
844+
pixbufRenderer = GTK.gtk_cell_renderer_pixbuf_new ();
845+
} else {
846+
pixbufRenderer = ownerDraw ? OS.g_object_new (display.gtk_cell_renderer_pixbuf_get_type (), 0) : GTK.gtk_cell_renderer_pixbuf_new ();
847+
}
843848
if (pixbufRenderer == 0) {
844849
error (SWT.ERROR_NO_HANDLES);
845850
} else {

0 commit comments

Comments
 (0)