Beispiel #1
0
    def test_label(self):

        textro = TextAlphaNumRO(name="")

        widget = tkwidgetfactory(self.master,
                                 textro,
                                 self.master,
                                 self.master,
                                 text='foobar')
        widget.pack(fill=BOTH, expand=1)
        #self.master.mainloop()
        self.assertIsInstance(widget, TkLabel)
Beispiel #2
0
    def setUp(self):
        dbname = CURRENTDIR + '/data/food'
        tbl_name = 'food'
        fldname = 'name'
        self.dbsetmember = DBSetMember(dbname,
                                       tbl_name,
                                       fldname,
                                       name='x{dblist}')

        self.master = Tk()
        self.master.geometry(geometry_get_dict(defaultmaster))

        self.combo = tkwidgetfactory(self.master, self.dbsetmember,
                                     self.master, self.master)
        self.combo.grid(row=0, column=0, sticky=NSEW)
Beispiel #3
0
    def setUp(self):
        self.master = Tk()
        self.master.geometry(geometry_get_dict(defaultmaster))

        set = [
            'pineapple', 'grapefruit', 'banana', 'peach', 'pomegranate',
            'passionfruit', 'pear', 'grape', 'strawberry', 'raspberry',
            'rhubarb', 'mango', 'guava', 'apple', 'Orange'
        ]

        self.setmemberp = SetMemberPartial(name='x{mylist}', set=set)
        self.setmemberp.widgettype = TkGridCombobox
        self.combo = tkwidgetfactory(self.master,
                                     self.setmemberp,
                                     self.master,
                                     self.master,
                                     values=set)
        self.combo.grid(row=0, column=0, sticky=NSEW)
Beispiel #4
0
    def test_label(self):

        label = 'foobar'

        self.mytextalphanumro = TextAlphaNumRO(name='textalphanum')

        self.lbl = tkwidgetfactory(self.master, self.mytextalphanumro,
                                   self.master, self.master)
        self.lbl.pack(fill=BOTH, expand=1)

        tkwidgetimage_set(self.ic, self.lbl, label, True, **self.image_args)

        exp_res = get_gif_filename(
            '/Users/burtnolej/Development/pythonapps3/clean/utils/test_gifs',
            label, self.lbl.image_args)

        #self.assertFilesEqual(exp_res,self.lbl.image)

        self.assertTrue(isinstance(self.lbl, TkLabel))
Beispiel #5
0
    def test_button(self):

        label = 'foobar'

        self.bool = TrueFalse(name='true-false')
        #self.button = TkButton(self.master,self.bool)

        self.lbl = tkwidgetfactory(self.master, self.bool, self.master,
                                   self.master)
        self.lbl.pack(fill=BOTH, expand=1)

        tkwidgetimage_set(self.ic, self.lbl, label, True, **self.image_args)

        # extent gets determined by image_set method
        self.image_args['extent'] = self.lbl.image_size

        exp_res = get_gif_filename(
            '/Users/burtnolej/Development/pythonapps3/clean/utils/test_gifs',
            label, self.image_args)
        #self.master.mainloop()

        #self.assertFilesEqual(exp_res,self.lbl.image)
        self.assertTrue(isinstance(self.lbl, TkButton))