LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-17-2009, 01:05 PM   #1
geekbynature
LQ Newbie
 
Registered: Jul 2008
Location: Colorado
Distribution: Fedora 9
Posts: 21

Rep: Reputation: 0
C/GTK: reading a file into a GtkList


A while back, I wrote a program for burning audio CDs. What I'd wanted to do was load the file containing the playlist into a GtkTextView, so that I could select individual rows (or lines in the file) and delete them, or add new ones. But it seems one can't select things with a TextView.

Then a found a few examples of a GtkList. This was exactly what I wanted in the first place, with selections and all. The problem is that I can't figure out how to load the playlist file into the list. With the TextView, I could use gtk_text_view_set_buffer to display the file, but there doesn't seem to be such a thing as gtk_list_set_buffer.

I've been looking around for about an hour and there's just not anything very helpful for this specific function. Anyone have any clues?
 
Old 01-17-2009, 05:34 PM   #2
ntubski
Senior Member
 
Registered: Nov 2005
Distribution: Debian, Arch
Posts: 3,783

Rep: Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083Reputation: 2083
Based on the docs here http://library.gnome.org/devel/gtk/stable/GtkList.html, it looks like you have to first put all the items into a GList first.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Reading/Wirting file/parsing xml file using javascript fakhrul Programming 1 08-14-2007 05:08 PM
Reading text file-writting binary file cdog Programming 5 06-13-2006 11:56 AM
awk: fatal:cannot open file for reading (no such file or Directory) in Linux sangati vishwanath Linux - Software 4 07-06-2005 12:59 AM
cant find gtk-config file or gtk-devel to install happychappy Linux - Software 2 02-16-2005 12:46 AM
Reading integers in a GTK textbox... Claus Programming 2 11-04-2003 08:44 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 04:49 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration