Re[5]: argv revisited



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 <llevrel yahoo fr> 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



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]