Ejemplo n.º 1
0
    def setUp(self):
        self.master = Tk()

        setmemberp = SetMemberPartial(name='x{mylist}', set=['foo', 'bar'])
        widget_args = dict(background='white', values=['foo', 'bar'])
        widgetcfg = nxnarraycreate(60, 10, widget_args)

        self.entrygrid = TkImageLabelGrid(self.master, 'entrygrid', setmemberp,
                                          500, 500, 0, 0, 30, 5, True, {},
                                          widgetcfg)
        self.entrygrid.grid(row=0, column=0, sticky=NSEW)
Ejemplo n.º 2
0
            def __init__(self):
                Tk.__init__(self)

                self.maxrows = 2  # rows in the grid
                self.maxcols = 2  # cols in the grid
                self.wmheight = 400  # master height
                self.wmwidth = 400  # master width

                image_args = dict(pointsize=48,
                                  font='Helvetica',
                                  gravity='center',
                                  rotate=90,
                                  label='foobar')
                gridcfg = nxnarraycreate(self.maxrows, self.maxcols,
                                         image_args)

                widget_args = dict(values=[
                    'peach', 'pomegranate', 'passionfruit', 'pear', 'grape',
                    'strawberry', 'raspberry', 'rhubarb', 'mango', 'guava',
                    'apple', 'Orange'
                ])
                widgetcfg = nxnarraycreate(self.maxrows, self.maxcols,
                                           widget_args)

                self.setmemberp = SetMemberPartial(
                    name='x{mylist}',
                    set=[
                        'pineapple', 'grapefruit', 'banana', 'peach',
                        'pomegranate', 'passionfruit', 'pear', 'grape',
                        'strawberry', 'raspberry', 'rhubarb', 'mango', 'guava',
                        'apple', 'Orange'
                    ])

                #self.tkilg = TkImageLabelGrid(self.master,'grid',self.setmemberp,self.wmwidth,self.wmheight,
                #                              0,0,self.maxrows,self.maxcols,
                #                              gridcfg,widgetcfg)

                self.tkilg = TkImageLabelGrid(self.master, 'grid',
                                              self.setmemberp, self.wmwidth,
                                              self.wmheight, 0, 0,
                                              self.maxrows, self.maxcols, True,
                                              True, gridcfg, widgetcfg, 0, 0)

                self.tkilg.grid(row=0, column=0, sticky=NSEW)
                self.grid_rowconfigure(0, weight=1, uniform="foo")
                self.grid_columnconfigure(0, weight=1, uniform="foo")
Ejemplo n.º 3
0
    def setUp(self):
        self.master = Tk()

        self.maxrows = 7  # rows in the grid
        self.maxcols = 5  # cols in the grid
        self.maxwidgets = self.maxrows * self.maxcols
        self.wwidth = 48  # default button width with text of 3 chars
        self.wheight = 29  # default button height
        self.wmheight = self.wheight * self.maxrows  # master height
        self.wmwidth = self.wwidth * self.maxcols  # master width

        self.mytextalphanum = TextAlphaNum(name='textalphanum')
        self.tkilg = TkImageLabelGrid(self.master, 'grid', self.mytextalphanum,
                                      self.wmwidth, self.wmheight, 0, 0, 7, 5)
        self.tkilg.grid(row=0, column=0, sticky=NSEW)
        self.tkilg.grid_rowconfigure(0, weight=1, uniform="foo")
        self.tkilg.grid_columnconfigure(0, weight=1, uniform="foo")
Ejemplo n.º 4
0
    def setUp(self):
        self.master = Tk()

        self.geom = geometry_get(300, 300, 0, 0)
        self.master.geometry(self.geom)

        self.maxrows = 7  # rows in the grid
        self.maxcols = 5  # cols in the grid
        #self.maxwidgets=self.maxrows*self.maxcols
        self.wmheight = 500  # master height
        self.wmwidth = 500  # master width

        image_args = dict(pointsize=16,
                          font='Helvetica',
                          gravity='center',
                          rotate=0,
                          label='foobar')
        gridcfg = nxnarraycreate(self.maxrows, self.maxcols, image_args)

        widget_args = dict(background='black', text='foo')
        widgetcfg = nxnarraycreate(self.maxrows, self.maxcols, widget_args)

        rowcfg = dict(height=2, fg='yellow', text="x")
        colcfg = dict(width=2, fg='yellow', text="y")

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

        self.tkilg = TkImageLabelGrid(self.master, 'grid',
                                      self.mytextalphanumro, self.wmwidth,
                                      self.wmheight, 0, 0, self.maxrows,
                                      self.maxcols, True, False, gridcfg,
                                      widgetcfg, 1, 1, rowcfg, colcfg)

        self.tkilg.grid(row=0, column=0, sticky=NSEW)

        self.tkilg.cell_set(0, 0, **dict(background='yellow',
                                         width=2,
                                         height=2))
        self.tkilg.cell_set(1, 1, **dict(background='pink', width=2, height=2))

        self.master.grid_rowconfigure(0, weight=1, uniform="foo")
        self.master.grid_columnconfigure(0, weight=1, uniform="foo")

        self.tkilg.image_set()
Ejemplo n.º 5
0
            def __init__(self):
                Tk.__init__(self)

                self.maxrows = 13  # rows in the grid
                self.maxcols = 13  # cols in the grid
                self.wmheight = 1300  # master height
                self.wmwidth = 1200  # master width

                custommaster = dict(height=self.wmheight,
                                    width=self.wmwidth,
                                    x=0,
                                    y=0)

                self.geometry(geometry_get(**custommaster))

                image_args = dict(pointsize=24,
                                  font='Helvetica',
                                  gravity='center',
                                  rotate=0,
                                  label='foobar')

                gridcfg = nxnarraycreate(self.maxrows, self.maxcols,
                                         image_args)

                widget_args = {'background': 'white'}
                widgetcfg = nxnarraycreate(self.maxrows, self.maxcols,
                                           widget_args)

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

                self.tkilg = TkImageLabelGrid(self.master, 'grid',
                                              self.mytextalphanumro,
                                              self.wmwidth, self.wmheight, 0,
                                              0, self.maxrows, self.maxcols,
                                              True, True, gridcfg, widgetcfg)

                self.tkilg.grid(row=0, column=0, sticky=NSEW)
                self.grid_rowconfigure(0, weight=1, uniform="foo")
                self.grid_columnconfigure(0, weight=1, uniform="foo")