I am currently developing an application for my Linux desktop that reads data from my Garmin Forerunner sports watch, parses the not-so-well-formed XML file, and writes the data to a MySQL database table. I'm not overly experienced with Python or GTK, so the graphical stuff I handled using the Glade GUI designer. Here's the issue. There is some data that does not come from the watch that I would like to add prior to writing to the database. I read and/or calculate lap number, lap distance, lap pace, and lap duration. However, I would like to be able to view each lap on the interace, and categorize the lap as Speedwork, Easy Run, etc.. using a combobox. From what I've read, a listview is the way to go.
However, all examples and documentation that I've seen so far construct the Listview from code (as opposed to having it built via Glade). I would like to loop through my lists (lap [type: int], duration [type: string], distance [type: float], and pace [type: string] --- note, I store times as strings to write them to time/date fields in my db), and populate the fields in a listview (which I'm assuming is the right-way to do this --- correct me if I'm wrong) along with a combobox to categorize. Then, I would take each row from the listview and write it to the db.
Does anybody know of any examples that could help, or does anyone have any specific thoughts?
Update:
I basically want to know how, if I place a listview or treeview on a GUI via Glade, how I would pack it with the following columns: LapID (int), Distance (float), Duration (String), and a combobox where I could choose what type of lap it was. That's the first part of the battle.
Once I fill the list, how would I refer to each row to write it to a db table?
check if an example below would work for you. It loads ui from the glade file and uses sqlite database to store items.
script:
glade file (listview_test.glade):
hope this helps, regards