Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/Workshop.activity/TutorialStoreCategories.py
blob: c321d6620ba7374faef34375ea8e332703ff2dbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import sys, os
import gtk

class TutorialStoreCategories(gtk.Frame):

    def __init__(self,controller):
        gtk.Frame.__init__(self,'Categories')
        self.modify_bg(gtk.STATE_NORMAL, gtk.gdk.Color(0,0,0))
        
        self.controller = controller
        self.categorie_box = gtk.VBox(False, 5)
        
        self.add(self.categorie_box)
        self.categorie_box.show()
        
    def set_categories(self,categories):
        for child in self.categorie_box.get_children():
            self.categorie_box.remove(child)
            
        for category in categories:
            link = gtk.LinkButton("",category)
            self.categorie_box.pack_start(link,False,False,10)
            link.connect('clicked',self.controller.get_tutorials_by_category,category)
            link.show()