Beispiel #1
0
    def _create_container(self):
        cnf = {}
        cnf['bd'] = 10

        self.container = TKUtils.get_container(master=self, cnf=cnf)

        self._create_error_label()
        self._create_confirm_button()
Beispiel #2
0
    def create_activity_label(self, activity):
        # Container
        cnf, pack = {}, {}

        cnf['bd'] = 1
        cnf['bg'] = 'grey'

        label_container =\
            TKUtils.get_container(master=self.viewport, cnf=cnf, pack=pack)

        # Label
        cnf, pack = {}, {}

        cnf['text'] = activity['title']
        cnf['bg'] = 'blue'
        cnf['fg'] = 'white'
        cnf['width'] = 93
        cnf['height'] = 2

        pack['side'] = 'left'

        label_container.label =\
            TKUtils.get_label(master=label_container, cnf=cnf, pack=pack)

        # Raffle Button
        cnf, pack, defs = {}, {}, {}

        defs['type'] = 'activity'
        defs['value'] = activity

        cnf['text'] = 'O'
        cnf['bg'] = 'orange'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.commands['raffle'](defs=defs)

        pack['side'] = 'left'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        # Remove Button
        cnf, pack = {}, {}

        cnf['text'] = 'X'
        cnf['bg'] = 'red'
        cnf['width'] = 2
        cnf['command'] =\
            lambda evt=None: self.commands['remove'](activity['activity_id'])

        pack['side'] = 'right'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        self.label_list.append(label_container)
Beispiel #3
0
    def create_student_label(self, student_name):
        # Container
        cnf, pack = {}, {}

        cnf['bd'] = 1
        cnf['bg'] = 'grey'

        label_container =\
            TKUtils.get_container(master=self.viewport, cnf=cnf, pack=pack)

        # Label
        cnf, pack = {}, {}

        cnf['text'] = student_name
        cnf['bg'] = 'red'
        cnf['fg'] = 'white'
        cnf['width'] = 98
        cnf['height'] = 2

        pack['side'] = 'left'

        label_container.label =\
            TKUtils.get_label(master=label_container, cnf=cnf, pack=pack)

        # Raffle Button
        cnf, pack, defs = {}, {}, {}

        defs['type'] = 'student'
        defs['value'] = student_name

        cnf['text'] = 'O'
        cnf['bg'] = 'orange'
        cnf['width'] = 2
        cnf['command'] = lambda evt=None: self.commands['raffle'](defs=defs)

        pack['side'] = 'right'

        label_container.button =\
            TKUtils.get_button(master=label_container, cnf=cnf, pack=pack)

        self.label_list.append(label_container)
Beispiel #4
0
 def _create_container(self):
     self.container = TKUtils.get_container(master=self)