txt_box.insert(0,trt)
but i added
self.txt_box.delete(0, END)
before inserting
From: James Reynolds
To: adedoyin adegoke
Sent: Sun, April 4, 2010 9:35:37 PM
Subject: Re: [Tutor] Display in a text field using tkinter
Did you try setting this (in the init):
"doyin adegoke" wrote
I made the changes and the error was still there
"print self.favorite.get()" prints the name of the selected database on
the console
The problem is that you are still calling grid when you create the widget.
grid() returns None so all your self.xxx attributes are set
ubject: Re: [Tutor] Display in a text field using tkinter
On Fri, Apr 2, 2010 at 2:25 AM, adedoyin adegoke wrote:
from Tkinter import *
>import MySQLdb
>
>
>class Snoop(Frame):
>def __init__(self, master):
>Frame.__init__(self, master)
>self.grid(
On Fri, Apr 2, 2010 at 2:25 AM, adedoyin adegoke wrote:
> from Tkinter import *
> import MySQLdb
>
> class Snoop(Frame):
> def __init__(self, master):
> Frame.__init__(self, master)
> self.grid()
> self.create_widgets()
>
> def create_widgets(self):
> Label(
"adedoyin adegoke" wrote >def
create_widgets(self):
Label(self, text = "Database Name:").grid(...
self.txt_box = Entry(self, text = "hool").grid(...
The grid(and pack etc) method returns None.
You have to create the widgets then apply the layout manager on a separate
line
from Tkinter import *
import MySQLdb
class Snoop(Frame):
def __init__(self, master):
Frame.__init__(self, master)
self.grid()
self.create_widgets()
def create_widgets(self):
Label(self, text = "Database Name:").grid(row = 0, column = 0,
sticky = W)