From 1c0b5d7c47dc0ebfe8d445cfe81ff35dfbaf560f Mon Sep 17 00:00:00 2001 From: Charlie Date: Thu, 05 Nov 2009 15:55:20 +0000 Subject: Workshop activity My tutorials --- (limited to 'Workshop.activity/TutorialStoreSuggestion.py') diff --git a/Workshop.activity/TutorialStoreSuggestion.py b/Workshop.activity/TutorialStoreSuggestion.py new file mode 100644 index 0000000..9164ca0 --- /dev/null +++ b/Workshop.activity/TutorialStoreSuggestion.py @@ -0,0 +1,139 @@ +import sys, os +import gtk + +class TutorialStoreSuggestion: + + def __init__(self): + + tutorial1 = gtk.HBox(homogeneous=True, spacing=0) + tutorial2 = gtk.HBox(homogeneous=True, spacing=0) + tutorial3 = gtk.HBox(homogeneous=True, spacing=0) + tutorial4 = gtk.HBox(homogeneous=True, spacing=0) + tutorial5 = gtk.HBox(homogeneous=True, spacing=0) + tutorial6 = gtk.HBox(homogeneous=True, spacing=0) + + icon1 = gtk.Image() + icon1.set_from_file('icon.svg') + icon2 = gtk.Image() + icon2.set_from_file('icon.svg') + icon3 = gtk.Image() + icon3.set_from_file('icon.svg') + icon4 = gtk.Image() + icon4.set_from_file('icon.svg') + icon5 = gtk.Image() + icon5.set_from_file('icon.svg') + icon6 = gtk.Image() + icon6.set_from_file('icon.svg') + + label1 = gtk.Label('Tuto 1') + label2 = gtk.Label('Tuto 2') + label3 = gtk.Label('Tuto 3') + + label4 = gtk.Label('Tuto 4') + label5 = gtk.Label('Tuto 5') + label6 = gtk.Label('Tuto 6') + + self.more_button1 = gtk.Button('More') + more_button2 = gtk.Button('More') + more_button3 = gtk.Button('More') + more_button4 = gtk.Button('More') + more_button5 = gtk.Button('More') + more_button6 = gtk.Button('More') + + tutorial1.pack_start(icon1, expand=True, fill=True, padding=4) + tutorial1.pack_start(label1, expand=True, fill=True, padding=0) + tutorial1.pack_start(self.more_button1, expand=False, fill=False, padding=5) + tutorial1_frame = gtk.Frame() + tutorial1_frame.add(tutorial1) + tutorial1_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + tutorial2.pack_start(icon2, expand=True, fill=True, padding=4) + tutorial2.pack_start(label2, expand=True, fill=True, padding=0) + tutorial2.pack_start(more_button2, expand=False, fill=False, padding=5) + tutorial2_frame = gtk.Frame() + tutorial2_frame.add(tutorial2) + tutorial2_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + tutorial3.pack_start(icon3, expand=True, fill=True, padding=4) + tutorial3.pack_start(label3, expand=True, fill=True, padding=0) + tutorial3.pack_start(more_button3, expand=False, fill=False, padding=5) + tutorial3_frame = gtk.Frame() + tutorial3_frame.add(tutorial3) + tutorial3_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + tutorial4.pack_start(icon4, expand=True, fill=True, padding=4) + tutorial4.pack_start(label4, expand=True, fill=True, padding=0) + tutorial4.pack_start(more_button4, expand=False, fill=False, padding=5) + tutorial4_frame = gtk.Frame() + tutorial4_frame.add(tutorial4) + tutorial4_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + tutorial5.pack_start(icon5, expand=True, fill=True, padding=4) + tutorial5.pack_start(label5, expand=True, fill=True, padding=0) + tutorial5.pack_start(more_button5, expand=False, fill=False, padding=5) + tutorial5_frame = gtk.Frame() + tutorial5_frame.add(tutorial5) + tutorial5_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + tutorial6.pack_start(icon6, expand=True, fill=True, padding=4) + tutorial6.pack_start(label6, expand=True, fill=True, padding=0) + tutorial6.pack_start(more_button6, expand=False, fill=False, padding=5) + tutorial6_frame = gtk.Frame() + tutorial6_frame.add(tutorial6) + tutorial6_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + top_five = gtk.VBox(homogeneous=True, spacing=0) + self.top_five_frame = gtk.Frame('Top 5 Most Popular') +## top_five_frame.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0)) + + top_five.pack_start(tutorial1_frame, expand=True, fill=True, padding=0) + top_five.pack_start(tutorial2_frame, expand=True, fill=True, padding=0) + top_five.pack_start(tutorial3_frame, expand=True, fill=True, padding=0) + + also_like = gtk.VBox(homogeneous=True, spacing=0) + self.also_like_frame = gtk.Frame('You might also like :') + + also_like.pack_start(tutorial4_frame, expand=True, fill=True, padding=0) + also_like.pack_start(tutorial5_frame, expand=True, fill=True, padding=0) + also_like.pack_start(tutorial6_frame, expand=True, fill=True, padding=0) + + self.top_five_frame.add(top_five) + self.also_like_frame.add(also_like) + + label1.show() + label2.show() + label3.show() + label4.show() + label5.show() + label6.show() + icon1.show() + icon2.show() + icon3.show() + icon4.show() + icon5.show() + icon6.show() + self.more_button1.show() + more_button2.show() + more_button3.show() + more_button4.show() + more_button5.show() + more_button6.show() + tutorial1_frame.show() + tutorial2_frame.show() + tutorial3_frame.show() + tutorial4_frame.show() + tutorial5_frame.show() + tutorial6_frame.show() + tutorial1.show() + tutorial2.show() + tutorial3.show() + tutorial4.show() + tutorial5.show() + tutorial6.show() + top_five.show() + self.top_five_frame.show() + also_like.show() + self.also_like_frame.show() + + def get_more_button(self): + return self.more_button1 \ No newline at end of file -- cgit v0.9.1