bailuk / java-gtk Goto Github PK
View Code? Open in Web Editor NEWGTK bindings for Java
License: MIT License
GTK bindings for Java
License: MIT License
I'm very interested in this library and I'd like to know if there's any interest in offering a Gradle plugin to ease the code generation aspect. Of course I'm also interested in helping with code if needed.
I've noticed that two methods I use in gtk.cairo.Context are not present and have added them. They are really needed to easily use showText. Was there a reason they were not included?
i'd like to make a cross-platform app using this and it would be very nice to know before i start if this can run on windows. as i dont have a windows installation right now, i have no way to verify
whenever i use various Adw related classes in my main method, such as running App.run() just like the example, when running on windows, the program immediately crashes, citing an "Invalid memory access" error. the same thing happens when i use Adw.init().
i am on 0.5.0
the libraries were downloaded from msys2 and added to PATH
On Macos 10, 12 and 13 using either java 17 or java 19 with homebrew gtk 4.10.4 on a paired down example from v0.4.0:
2023-06-08 10:06:16.095 java[7961:51584] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'nextEventMatchingMask should only be called from the Main Thread!'
*** First throw call stack:
(
0 CoreFoundation 0x00007ff80ec2a773 __exceptionPreprocess + 242
1 libobjc.A.dylib 0x00007ff80e98abc3 objc_exception_throw + 48
2 AppKit 0x00007ff8115e72d1 -[NSApplication(NSEvent) _nextEventMatchingEventMask:untilDate:inMode:dequeue:] + 4633
3 libgtk-4.1.dylib 0x00000001094ceb43 poll_func + 179
4 libglib-2.0.0.dylib 0x0000000102b4901b g_main_context_iterate + 349
5 libglib-2.0.0.dylib 0x0000000102b490cc g_main_context_iteration + 55
6 libgio-2.0.0.dylib 0x0000000108d74ca3 g_application_run + 521
7 jna16203219141762940508.tmp 0x00000001029eb17a ffi_prep_go_closure + 1370
8 ??? 0x0000700001efc688 0x0 + 123145334802056
)
libc++abi: terminating with uncaught exception of type NSException
Runs fine on Fedora 38 with openjdk 17.
This code sample:
public static void main(String[] args) {
var app = new Application(new Str("example.javagtk.FileChooserDialog"), ApplicationFlags.FLAGS_NONE);
app.onActivate(() -> {
var appWin = new ApplicationWindow(app);
var fcd = new FileChooserDialog(new Str("Open savefile"), appWin, FileChooserAction.OPEN, new Str("Open"));
appWin.show();
fcd.show();
});
System.exit(app.run(args.length, new Strs(args)));
}
Produces a GTK file chooser dialog with broken button text, seen below:
The broken text seems to be read from an incorrect place in memory by GTK. Pressing any of the buttons in my case also results in a segfault.
This happens on a Debian Unstable machine, using the GTK4 library from apt, and OpenJDK 17 installed through sdkman.
Fix is to add pluginManagement to settings.gradle.kts
pluginManagement {
repositories {
mavenCentral()
gradlePluginPortal()
}
}
Hello, I know that this is a weird request, so feel free to just say no, but I was wondering if you will be open to help the gtk-kt
project ^^
The gtk-kt
project is focused on Kotlin native, and not JNA so isn't exactly a direct competitor of your project.
Currently there is only one maintainer that started writing the bindings manually but now he's working on a GIR generator for the Kotlin native code. But it isn't an easy task to do without previous knowledge of GIR so I was wondering if you could help us.
If you are wondering who am I, I'm just an Android developer that would love to be able to write GTK application in Koltin native. I started contributing to the gtk-kt
project, very recently and, since I do not have a lot of C interop knowledge, my contributions are mostly on Gradle and pure Kotlin code level. And maybe a little of PR ^^.
How to setup a project? What do i need to do to make a new gradle project with this library?
Question: could this be combined via graalvm in theory?
i am asking because graalvm is pretty cool, and others have managed to get SWING applications to run.
My use case would be more like taking an existing python or ruby code base, commandline stuff,
and add a simple GUI around it. I don't really want to write in C though (Java is ok but Swing is
ugly, and JavaFX does not seem to be supported via Graalvm; also the graalvm team focuses
not so much on GUIs)
There seems to be no method getFile() to get a file from FileChooserNative
Hello, I want to know whether Gtk is required to be installed in order for this library to work. This is necessary for systems where Gtk might not be installed like Windows.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.