change alternate treeview row color with css

2013-01-25 Thread Rudra Banerjee
I tried to change alternate row color of TreeView using css as: GtkCssProvider *provider = gtk_css_provider_new (); gtk_css_provider_load_from_data (provider, GtkTreeView {\n .row:nth-child(even): green;\n .row:nth-child(odd):red;\n }\n, -1, NULL); GdkDisplay *display =

open an existing file in buffer and write on it

2013-01-25 Thread Rudra Banerjee
Dear friends, as evident from my last few posts, I am struggling with opening a file as buffer and write to it (guess it has *nothing* to do with gtk, but C. Still I will be grateful if you people kindly help). So, first, how to open file in buffer? /* Files opened and edited directly*/ /* FILE

Re: open an existing file in buffer and write on it

2013-01-25 Thread zz
On Friday 25 January 2013 14:57:23 Rudra Banerjee wrote: Dear friends, as evident from my last few posts, I am struggling with opening a file as buffer and write to it (guess it has *nothing* to do with gtk, but C. Still I will be grateful if you people kindly help). So, first, how to open

Re: open an existing file in buffer and write on it

2013-01-25 Thread Rudra Banerjee
ZZ, thanks for your comment! But is it so tough? database and all that? All I want to do is to have the ability of editing an existing file. Since directly editing the file is not recommended, this is the reason why I want to open it as buffer! On Fri, 2013-01-25 at 16:10 +0100, z...@excite.it

Re: open an existing file in buffer and write on it

2013-01-25 Thread Damien Caliste
Hello, Le 25/01/2013, Rudra Banerjee rudra.baner...@aol.co.uk a écrit : But is it so tough? database and all that? For managing several bibliography files, that should be better yes. All I want to do is to have the ability of editing an existing file. Since directly editing the file is not

Re: open an existing file in buffer and write on it

2013-01-25 Thread Colomban Wendling
Le 25/01/2013 17:02, Damien Caliste a écrit : [...] The idea when you want to change a file on disk is (not too big) : - generate a buffer of the full content of the file in memory, using GString for instance (http://developer.gnome.org/glib/unstable/glib-Strings.html) since they are

Re: open an existing file in buffer and write on it

2013-01-25 Thread Rudra Banerjee
Hi Damien, Thanks for your reply. What I have ended up with is something like: FILE *fopf = fopen(filename, a ); if (!fopf){ filename=Untitled.bib; fopf= fopen(filename,a); } char buffer[]=Hello World; int buf_size= strlen(buffer)+1; fwrite(buffer,buf_size,1,fopf);

Re: Would this leak be inside gtk?

2013-01-25 Thread Edscott Wilson
I've just verified with tcmalloc that there is no leak in gtk_combo_box_new_with_entry(), on x86. The issue is with Valgrind which gets confused with concurrent threads. Although the spaguetti output pprof is a bit confusing at first, once you look through the documentation the diagrams are very

Re: open an existing file in buffer and write on it

2013-01-25 Thread Andrew Potter
On Fri, Jan 25, 2013 at 9:00 AM, Rudra Banerjee rudra.baner...@aol.co.ukwrote: But this writes the data in unformatted form. Can you kindly explain a bit more? A good tool glib has for serializing data is GVariant: http://developer.gnome.org/glib/stable/glib-GVariant.html All the example

Re: open an existing file in buffer and write on it

2013-01-25 Thread Liam R E Quin
On Fri, 2013-01-25 at 10:44 -0800, Andrew Potter wrote: [...] You can get a nice buffer of binary data to write to file: Please let's not encourage the use of binary file formats where there's no measured performance requirement. An XML file would be better if structure is needed, as then it

Re: open an existing file in buffer and write on it

2013-01-25 Thread Andrew Potter
On Fri, Jan 25, 2013 at 11:00 AM, Liam R E Quin l...@holoweb.net wrote: Please let's not encourage the use of binary file formats where there's no measured performance requirement. An XML file would be better if structure is needed, as then it can be interchanged with other tools and

Gnome 3 style tabs in vala

2013-01-25 Thread Satyajit Sahoo
Hi, I'm trying to implement a GUI in vala with tabs like in new Gnome 3 apps. I'm mostly successful, but have a few hiccups. I think perhas this may not be the nicest implementation. And, when you click a active tab, then the togglebutton state changes, which is kinda confusing. I cannot think of

Re: open an existing file in buffer and write on it

2013-01-25 Thread Andrew Potter
On Fri, Jan 25, 2013 at 11:14 AM, Andrew Potter agpot...@gmail.com wrote: [...] blah blah blah. On second reading this comes off as a little flippant, my apologies. You made a good point, and I should have prefaced my example with links to proper serialization tools.

Re: open an existing file in buffer and write on it

2013-01-25 Thread Liam R E Quin
On Fri, 2013-01-25 at 11:45 -0800, Andrew Potter wrote: On Fri, Jan 25, 2013 at 11:14 AM, Andrew Potter agpot...@gmail.com wrote: [...] blah blah blah. On second reading this comes off as a little flippant, my apologies. You made a good point, and I should have prefaced my example with

Re: open an existing file in buffer and write on it

2013-01-25 Thread David Nečas
On Fri, Jan 25, 2013 at 04:25:53PM -0500, Liam R E Quin wrote: That it's easier for the programmers to create and read application-specific binary files is a problem that would be worth fixing. Probably you mean replacing it with the problem of application-specific hodge podge XML... I have

why the menu item Options/SetVoice won't exit

2013-01-25 Thread Gary Kline
guys, I'm clueless here. in my test voice.c, my widget based on gespeaker works fine. I can change the voice from Male to Female, change the pitch, Speed [WPM], Volume, etc. when I press the Close button, voice.c fprintf's the changes to the

Re: open an existing file in buffer and write on it

2013-01-25 Thread Liam R E Quin
On Sat, 2013-01-26 at 00:06 +0100, David Nečas wrote: On Fri, Jan 25, 2013 at 04:25:53PM -0500, Liam R E Quin wrote: That it's easier for the programmers to create and read application-specific binary files is a problem that would be worth fixing. Probably you mean replacing it with the