Iain,

  You code is incomplete, the place where you create the Label widgets
is not included. We need that to see the problem.

Check the grid operation on each Label, in particular the row parameter.

Also, do a print as each Label is gridded, to see if they all are
actually created.

Mick

On Mon, Mar 16, 2009 at 10:50 PM, Iain Day
<i...@day-online.org.uk.invalid> wrote:
> Hi,
>
> I've written a short program which is supposed to populate a table
> constructed from tk.Label widgets. It does this by looping over the rows.
> Unfortunately, it only seems to populate the final row. What am I doing
> wrong?
>
> The code is:
>
> def updatedata():
>    updatetime.delete(0, tk.END)
>    for i in range(len(machines)):
>        print machines[i]
>        status = sshshowstat(machines[i])
>
>        for j in range(len(status)):
>            param, value = status[j].split(': ')
>
>            for k in range(len(variables)):
>                if re.match(variables[k], param) is None:
>                    continue
>                else:
> #                    print i, value
>                    if value in ('Acquiring', 'Regulated'):
>                        systemdata[i][k].config(text=value,
> foreground='green')
>                    elif value in ('Not Reg.'):
>                        systemdata[i][k].config(text=value, foreground='red')
>                    else:
>                        systemdata[i][k].config(text=value)
>
>
> tk.Button(root, text="Update Table Data",
> command=updatedata).grid(row=len(machines)+1, column=len(variables),
> sticky=tk.S)
>
>
>
> Thanks,
>
> Iain
>
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss@python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
>
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss

Reply via email to