<AWT Dev> Bug 6913179, FileDialog uses native GTK under Linux: first patch
Peter Zhelezniakov
Peter.Zhelezniakov at Sun.COM
Thu Jan 28 07:02:37 PST 2010
Hi Costantino,
Costantino Cerbo wrote:
>> - Why would you bother with returning a String from
>> native_gtk_check_version()? It is effectively ignored later, so you
>> could as well return a boolean value from the native function.
> Sometime modifying native code may be annoying, therefore I return the
> same output as the original C function "gtk_check_version(..)" for the
> case that in the future we need these additional information also in
> our java Toolkit.
> Anyway if you find this disturbing, I can return in the java method a
> string as well as in the C function.
I think there's no use for this string on the Java side. I'd rather
return a jboolean from the native method.
>> - Note that g_thread_get_initialized() is available since glib-2.20
>> only. Is there a way to enable the new filechooser on older systems?
> I missed that particular... We could use "g_thread_supported()" that
> does exactly the same and exists longer.
> But it's a macro, not a function and I wasn't able to dynamically load
> it with dlsym.
> Do you know if it's possible to do that?
Definitely it's not possible to load a macro with dlsym(). You could try
and see what function call(s) the macro expands to, and load pointers
to those functions.
> Alternatively, we could check the GTK version before to call this
> function and for the older versions the shortcut "Search" will
> disapper.
This is quite acceptable, too.
Thanks!
--
Peter | x33066 | location: SPB04 | timezone: GMT+03
More information about the awt-dev
mailing list