Re: gtk_init_with_args behavior
- From: Allin Cottrell <cottrell wfu edu>
- To: Miroslav Rajcic <miroslav rajcic inet hr>
- Cc: "Lucky B.C" <lblackc13 gmail com>, 	gtk-app-devel-list list <gtk-app-devel-list gnome org>
- Subject: Re: gtk_init_with_args behavior
- Date: Sun, 20 May 2018 19:27:34 -0400 (EDT)
On Sun, 20 May 2018, Miroslav Rajcic wrote:
I've been doing it exactly like that in my own program, first getting the 
UTF-16 from Windows API, then converting to UTF-8 using g_utf16_to_utf8.
Thanks, I've now been able to confirm for myself that that works 
fine.
IMO, hooking this with gtk_init_with_args is not needed, GTK can use the 
standard args of the program, passed via "main()" function parameters,
but you will bypass that mechanism completely and use API to fetch UTF-16 
process parameters directly from OS.
gtk_init_with_args is still useful in my case: it automatically 
screens out any command-line arguments that are just option flags or 
parameters, via the GOptionEntry mechanism, leaving only a filename 
argument to which my program has to respond (but which may be broken 
in plain argv). Fortunately, it works fine after conversion via 
g_utf16_to_utf8. So my workflow is:
GetCommandLineW
CommandLineToArgvW
convert array of UTF-16 strings to UTF-8
pass the converted array to gtk_init_with_args
Allin Cottrell
ref: 
https://mail.gnome.org/archives/gtk-app-devel-list/2018-May/msg00052.html
and following
[
Date Prev][
Date Next]   [
Thread Prev][
Thread Next]   
[
Thread Index]
[
Date Index]
[
Author Index]