Re: Open file from menu

2012-07-09 Thread Liam R E Quin
On Mon, 2012-07-09 at 22:01 +0200, David Nečas wrote: > On Mon, Jul 09, 2012 at 03:40:11PM -0400, Liam R E Quin wrote: > > also check that the free() was OK > > I wonder how you do that (apart from not getting any glibc MALLOC_CHECK_ > error message or similar). There's no portable way to do it r

Re: Open file from menu

2012-07-09 Thread David Nečas
On Mon, Jul 09, 2012 at 03:40:11PM -0400, Liam R E Quin wrote: > also check that the free() was OK I wonder how you do that (apart from not getting any glibc MALLOC_CHECK_ error message or similar). Yeti ___ gtk-app-devel-list mailing list gtk-app-deve

Re: Open file from menu

2012-07-09 Thread Liam R E Quin
On Tue, 2012-07-10 at 00:55 +0530, Rudra Banerjee wrote: > Will anyone kindly show the way? > stat(argv[1], &filestat); > buffer = (char *) malloc(filestat.st_size * sizeof (char)); > efile = fopen(argv[1], "r"); > fread(buffer, filestat.st_size, 1, efile); > gtk_text_buffer_set_text(textbuffer,

Re: Open file from menu

2012-07-09 Thread Michael Cronenworth
Rudra Banerjee wrote: > 1) putting the above block inside "if (argv[1] != "NULL")" is giving a > segmentation fault: Are you checking argc? If you are not passing an argument argv[1] does not exist so, yes, you will get a segfault for running beyond the argv[] array. if ( argc > 1 && argv[1] != N

Re: Open file from menu

2012-07-09 Thread Rudra Banerjee
Will anyone kindly show the way? -- Sent from my Android phone with K-9 Mail. Please excuse my brevity. Rudra Banerjee wrote: Dear friends, I am trying to create a textview that will show the file opens. I have managed to make it read the commandline argument as: stat(argv[1], &filestat); buff

pango_font_description_copy Segmentation fault

2012-07-09 Thread Weitian Leung
Hi, I wonder how pango_font_description_copy make a segmentation fault, I use it like this: /pango_font_description_free(priv->current_font); priv->current_font = pango_font_description_copy(priv->default_font);/ default_font comes from: /priv->default_font = gtk_style_contex