Re[5]: argv revisited

2016-05-08 Thread Lucas Levrel
(Approximate repost of a message I sent with a wrong From address; looks 
like the mods haven't delivered nor rejected it, hence the repost, but I 
don't have the original message so this will break the thread. Sorry for 
that.)


Andrew Robinson:
So is that how to actually get help on the GTK Dev forums? Beg for help? 
I thought posting a problem would be enough, but okay then ...


In my frame, saying please is not begging. I found your "Show me your 
code" a bit too imperative. Also, the etiquette in MLs is different from 
that in StackExchange. But well, I'm not a native English speaker.



Your source code doesn't work, so let's compare environments. I have:

1) Windows7
2) Win32 version of GTK+, version 3.18
3) The pathname that doesn't work contains the UTF-16 character, U+2026
(ellipsis)


Again, I cross-compiled in Linux for Win32, linking the last GTK2 (2.24.X 
I think) statically. Executable tested in Win XP.


NOTE: The UTF-8 version of U+2026 is 0E280A6h, but Windows doesn't 
support UTF-8.


I don't know how the infinity symbol I used is coded in Windows. I 
inserted it with the help of the character map tool. It displays properly 
in the file explorer.



Here is where the problem occurs (simplified):

  oSrcFilename = gtk_file_chooser_get_filename(oBtnSrcFile);
  g_file_get_contents(oSrcFilename,*ptrSrcCode,*lenFile,0);


I looked at your code and could see nothing different about it in this 
regards


I spot one difference in that I call g_file_new_for_path to turn the 
filename string into a GFile. Maybe this is relevant, maybe not, I can't 
tell.


HTH

--
Lucas Levrel
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[5]: argv revisited

2016-05-05 Thread Allin Cottrell

On Thu, 5 May 2016, Andrew Robinson wrote:


So is that how to actually get help on the GTK Dev forums? Beg for help?


(This in response to Lucas Levrel's suggesting a "please" following 
the imperative "show me your source code.")


LL was merely requesting a little civility. In many years of reading 
this list I don't think I've ever come across such a boorish and 
pig-headed poster.


--
Allin Cottrell
Department of Economics
Wake Forest University
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re[5]: argv revisited

2016-05-05 Thread Andrew Robinson
So is that how to actually get help on the GTK Dev forums? Beg for help? I
thought posting a problem would be enough, but okay then ... pretty please
help me ...

Your source code doesn't work, so let's compare environments. I have:

1) Windows7
2) Win32 version of GTK+, version 3.18
3) The pathname that doesn't work contains the UTF-16 character, U+2026
(ellipsis)

NOTE: The UTF-8 version of U+2026 is 0E280A6h, but Windows doesn't support
UTF-8.

Here is where the problem occurs (simplified):

  oSrcFilename = gtk_file_chooser_get_filename(oBtnSrcFile);
  g_file_get_contents(oSrcFilename,*ptrSrcCode,*lenFile,0);
 
gtk_message_dialog_format_secondary_markup(oMsgSuccess,*szPrintfLong,lenFile);
  gtk_dialog_run(oMsgSuccess);
  gtk_widget_hide(oMsgSuccess)
  g_free(ptrSrcCode)

What I am doing is just printing out the size of any file I choose from the
file chooser of the application. It works perfectly for any file in any
directory other than the one containing the ellipsis. I looked at your code
and could see nothing different about it in this regards, so I question
whether you are actually trying this in the same or similar environment I am.

On 5/5/2016 at 10:16 AM, Lucas Levrel  wrote:
>Le 5 mai 2016, Andrew Robinson a écrit :
>>> I've just tested a filename containing spaces and U+221E (infinity
>>> symbol), writing and reading both work.
>> So you verified that in Windows using the Win32 version of GTK+? Show me
your
>> source code.
>
>"Please."
>
>Cross-compiled on Linux with i686-pc-mingw32-gcc from mingw-cross-env-2.21 
>(previous name of MXE), GTK2 statically linked. I think I already posted 
>the code snippet for reading. Here for writing:
>-:-:-:-
>   GtkWidget *dialog;
>   dialog = gtk_file_chooser_dialog_new
> ("Title", GTK_WINDOW(gtkwin),
>  GTK_FILE_CHOOSER_ACTION_SAVE, GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
>  GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT, NULL);
>   gtk_file_chooser_set_do_overwrite_confirmation
> (GTK_FILE_CHOOSER (dialog), TRUE);
>   /* gtk_file_chooser_set_current_folder
>  (GTK_FILE_CHOOSER (dialog), default_folder_for_saving); */
>   gtk_file_chooser_set_current_name
> (GTK_FILE_CHOOSER (dialog), "foo.bar");
>   if(gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT){
> char *filename;
> filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
> GFile *outfile=g_file_new_for_path(filename);
> GFileOutputStream *FOstream=
>   g_file_replace(outfile, NULL, FALSE, G_FILE_CREATE_NONE, NULL,NULL);
> assert(FOstream);
> GDataOutputStream *DOstream=
>   g_data_output_stream_new(G_OUTPUT_STREAM(FOstream));
> assert(DOstream);
> gboolean res=
>   g_data_output_stream_put_string(DOstream,some_string,NULL,NULL);
> assert(res);
> g_object_unref(DOstream);
> g_object_unref(FOstream);
> g_object_unref(outfile);
> g_free(filename);
>   }
>   gtk_widget_destroy(dialog);
>-:-:-:-
>
>
>
>-- 
>Lucas Levrel
>___
>gtk-app-devel-list mailing list
>gtk-app-devel-list@gnome.org
>https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list