finch/libgnt/pygnt/example/rss/gntrss-ui.py

changeset 19176
487103c2e783
parent 19175
d6cea4e8560f
child 19178
952bf9cb471d
equal deleted inserted replaced
19175:d6cea4e8560f 19176:487103c2e783
156 details.append_text_with_flags(str(item.title) + "\n", gnt.TEXT_FLAG_BOLD) 156 details.append_text_with_flags(str(item.title) + "\n", gnt.TEXT_FLAG_BOLD)
157 details.append_text_with_flags(str(item.summary), gnt.TEXT_FLAG_NORMAL) 157 details.append_text_with_flags(str(item.summary), gnt.TEXT_FLAG_NORMAL)
158 details.scroll(0) 158 details.scroll(0)
159 if item.unread: 159 if item.unread:
160 item.set_property('unread', False) 160 item.set_property('unread', False)
161 win.give_focus_to_child(browser)
162 161
163 # 162 #
164 # Look for action keys in the feed-item list. 163 # Look for action keys in the feed-item list.
165 def item_key_pressed(tree, text): 164 def item_key_pressed(tree, text):
166 current = tree.get_selection_data() 165 current = tree.get_selection_data()
194 box.add_widget(feeds) 193 box.add_widget(feeds)
195 box.add_widget(items) 194 box.add_widget(items)
196 195
197 win.add_widget(box) 196 win.add_widget(box)
198 197
199 win.add_widget(gnt.Line(vertical = False)) 198 line = gnt.Line(vertical = False)
199 win.add_widget(line)
200 200
201 # The textview to show the details of a feed 201 # The textview to show the details of a feed
202 details = gnt.TextView() 202 details = gnt.TextView()
203 203
204 win.add_widget(details) 204 win.add_widget(details)
215 elif property.name == 'unread': 215 elif property.name == 'unread':
216 feeds.change_text(feed, 1, str(feed.unread)) 216 feeds.change_text(feed, 1, str(feed.unread))
217 217
218 # populate everything 218 # populate everything
219 for feed in gntrss.feeds: 219 for feed in gntrss.feeds:
220 feed.refresh()
220 add_feed(feed) 221 add_feed(feed)
221 222
222 gnt.gnt_main() 223 gnt.gnt_main()
223 224
224 gnt.gnt_quit() 225 gnt.gnt_quit()

mercurial