import sys, os import gtk class TutorialStoreResults: def __init__(self): tuto_icon1 = gtk.Image() tuto_icon1.set_from_file('icon.svg') tuto_icon2 = gtk.Image() tuto_icon2.set_from_file('icon.svg') full_star_icon1 = gtk.Image() full_star_icon1.set_from_file('full_star.svg') full_star_icon2 = gtk.Image() full_star_icon2.set_from_file('full_star.svg') full_star_icon3 = gtk.Image() full_star_icon3.set_from_file('full_star.svg') full_star_icon4 = gtk.Image() full_star_icon4.set_from_file('full_star.svg') full_star_icon5 = gtk.Image() full_star_icon5.set_from_file('full_star.svg') grayed_star_icon1 = gtk.Image() grayed_star_icon1.set_from_file('grayed_star.svg') grayed_star_icon2 = gtk.Image() grayed_star_icon2.set_from_file('grayed_star.svg') grayed_star_icon3 = gtk.Image() grayed_star_icon3.set_from_file('grayed_star.svg') grayed_star_icon4 = gtk.Image() grayed_star_icon4.set_from_file('grayed_star.svg') half_star_icon1= gtk.Image() half_star_icon1.set_from_file('half_star.svg') tuto_title_label1 = gtk.Label('Titre 1') tuto_title_label2 = gtk.Label('Titre 2') tuto_descrip_label1 = gtk.Label('Description 1 : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.') tuto_descrip_label1.set_line_wrap(True) tuto_descrip_label1.set_width_chars(50) tuto_descrip_label2 = gtk.Label('Description 2 : Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.') tuto_descrip_label2.set_line_wrap(True) tuto_descrip_label2.set_width_chars(50) download_button1 = gtk.Button('Download') download_button2 = gtk.Button('Download') details_button1 = gtk.Button('Details') details_button2 = gtk.Button('Details') show_resuls_label = gtk.Label('Showing results 1-29 of 109') # TODO : Probably must be something else than a label, or find a way to listen to click event on label ... next_results_label = gtk.Label('< 1 2 3 4 >') tutorial_title_bar1 = gtk.HBox (False, 0) tutorial_title_bar1.pack_start(tuto_icon1) tutorial_title_bar1.pack_start(tuto_title_label1) tutorial_title_bar1.pack_start(full_star_icon1) tutorial_title_bar1.pack_start(full_star_icon2) tutorial_title_bar1.pack_start(full_star_icon3) tutorial_title_bar1.pack_start(grayed_star_icon1) tutorial_title_bar1.pack_start(grayed_star_icon2) tutorial_button_bar1 = gtk.HBox(True, 25) tutorial_button_bar1.pack_start(download_button1) tutorial_button_bar1.pack_start(details_button1) tutorial1 = gtk.VBox (False, 5) tutorial1.pack_start(tutorial_title_bar1) tutorial1.pack_start(tuto_descrip_label1) tutorial1.pack_start(tutorial_button_bar1) tutorial_title_bar2 = gtk.HBox (False, 5) tutorial_title_bar2.pack_start(tuto_icon2) tutorial_title_bar2.pack_start(tuto_title_label2) tutorial_title_bar2.pack_start(full_star_icon4) tutorial_title_bar2.pack_start(full_star_icon5) tutorial_title_bar2.pack_start(half_star_icon1) tutorial_title_bar2.pack_start(grayed_star_icon3) tutorial_title_bar2.pack_start(grayed_star_icon4) tutorial_button_bar2 = gtk.HBox(True, 55) tutorial_button_bar2.pack_start(download_button2) tutorial_button_bar2.pack_start(details_button2) tutorial2 = gtk.VBox (False, 5) tutorial2.pack_start(tutorial_title_bar2) tutorial2.pack_start(tuto_descrip_label2) tutorial2.pack_start(tutorial_button_bar2) self.tutorial_store_results = gtk.VBox(False, 10) self.tutorial_store_results.pack_start(tutorial1, True, True, 10) self.tutorial_store_results.pack_start(tutorial2, True, True, 10) self.tutorial_store_results.pack_start(show_resuls_label) self.tutorial_store_results.pack_start(next_results_label) tuto_icon1.show() tuto_icon2.show() full_star_icon1.show() full_star_icon2.show() full_star_icon3.show() full_star_icon4.show() full_star_icon5.show() grayed_star_icon1.show() grayed_star_icon2.show() grayed_star_icon3.show() grayed_star_icon4.show() half_star_icon1.show() tuto_title_label1.show() tuto_title_label2.show() tuto_descrip_label1.show() tuto_descrip_label2.show() download_button1.show() download_button2.show() details_button1.show() details_button2.show() show_resuls_label.show() next_results_label.show() tutorial_title_bar1.show() tutorial_title_bar2.show() tutorial_button_bar1.show() tutorial_button_bar2.show() tutorial1.show() tutorial2.show() self.tutorial_store_results.show()