ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
i want to display the contents of log files (e.g. /var/log/messages) in the textview of the GUI, but i don't know how to do that. i'm using GLADE for the gui.
/* This line gets a pointer to the text widget */
GtkWidget * textview = lookup_widget(GTK_WIDGET(button), "textview1");
/* ...and thils line prints the the text into the text box */
gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)), _(text_2_be_printed), -1);
working on something similar myself. Hope this helps
i just want to know if it is possible that i could have the text to be printed from a certain folder. (e.g from var/log/messages) i want to display the messages in the textview.
I've read the API with the link that u gave. I just want to ask if there is anything that i should add in my main.c inorder to use this function.
I'm also confused on where to put this function, is it in callbacks.c, interface.c or main.c.
Thank you very much for ur help, i just badly need it.
That I think depends on how you want the program to work i.e if you want it to display the text when the user pushes a button. But most likely it will go into a function in callbacks.c.
thanks again, i can already view the contents of the file into the textview provided that the log file or any file will be place in the src folder of my project folder.
i would have wanted to display a log file from any directory (e.g. from /var/log/messages.log) without copying this to my src file. would that be possible?
I can already display the contents of any file when i inserted g_file_get_contents()in my interface.c
But when i tried to have it in my main.c or callbacks.c, its compilation is successful but when i run the program, it would display an error like this:
The Application "myFilename" has quit unexpectedly.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.