I am trying to make a simple dialog box, but when I run this, I get one black window in front of the working application window that I want. How do I get rid of that window? -
from Tkinter import *
-
import tkSimpleDialog
-
from traders import QueryTrader
-
-
class Inputs(tkSimpleDialog.Dialog):
-
-
def body(self, master):
-
Label(master, text="Enter Environment Name:").grid(row=0)
-
Label(master, text="ID #:").grid(row=1)
-
Label(master, text="Enter Start Date for Query:").grid(row=2)
-
Label(master, text="Enter End Date for Query:").grid(row=3)
-
Label(master, text="Output File Location:").grid(row=4)
-
-
self.e1 = Entry(master)
-
self.e2 = Entry(master)
-
self.e3 = Entry(master)
-
self.e4 = Entry(master)
-
self.e5 = Entry(master)
-
-
self.e1.grid(row=0, column=1)
-
self.e2.grid(row=1, column=1)
-
self.e3.grid(row=2, column=1)
-
self.e4.grid(row=3, column=1)
-
self.e5.grid(row=4, column=1)
-
return self.e1
-
-
def apply(self):
-
MXSess = int(self.e1.get())
-
Id = int(self.e2.get())
-
startDate = int(self.e3.get())
-
endDate = int(self.e4.get())
-
output = int(self.e5.get())
-
-
new = Query()
-
arr = new.loadFiles(MXSess, startDate, endDate, Id)
-
new.searchDocs(arr, output)
-
-
root = Tk()
-
root.title('Input Parameters')
-
d = Inputs(root)
-
1 1792
First, you have to pass the Tk() instance to your class. Second, you are not using SimpleDialog so there is no reason to inherit it. Take another look at where you got the code and see what they did and did not do. Some modified code that you can start with follows. Tkinter tutorials/references: http://infohost.nmt.edu/tcc/help/pub...ter/index.html http://effbot.org/tkinterbook/ - from Tkinter import *
-
##import tkSimpleDialog
-
##from traders import QueryTrader
-
-
class Inputs():
-
##class Inputs(tkSimpleDialog.Dialog):
-
-
def __init__(self, master):
-
self.body(master)
-
-
def body(self, master):
-
Label(master, text="Enter Environment Name:").grid(row=0)
-
Label(master, text="ID #:").grid(row=1)
-
Label(master, text="Enter Start Date for Query:").grid(row=2)
-
Label(master, text="Enter End Date for Query:").grid(row=3)
-
Label(master, text="Output File Location:").grid(row=4)
-
-
self.e1 = Entry(master)
-
self.e2 = Entry(master)
-
self.e3 = Entry(master)
-
self.e4 = Entry(master)
-
self.e5 = Entry(master)
-
-
self.e1.grid(row=0, column=1)
-
self.e2.grid(row=1, column=1)
-
self.e3.grid(row=2, column=1)
-
self.e4.grid(row=3, column=1)
-
self.e5.grid(row=4, column=1)
-
-
##----- you don't have to return as "self." variables
-
## are global within the class
-
##return self.e1
-
-
def apply(self):
-
MXSess = int(self.e1.get())
-
Id = int(self.e2.get())
-
startDate = int(self.e3.get())
-
endDate = int(self.e4.get())
-
output = int(self.e5.get())
-
-
## new = Query()
-
## arr = new.loadFiles(MXSess, startDate, endDate, Id)
-
## new.searchDocs(arr, output)
-
-
root = Tk()
-
root.title('Input Parameters')
-
d = Inputs(root)
-
root.mainloop()
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Thomas Nücker |
last post by:
Hi!
I am creating a dialog-box within my application, using tkinter. The
problem is the following: After the dialogbox is started, the main
application window comes again to top and the...
|
by: corrado |
last post by:
Hello
I have an application running several thread to display some financial
data;
basically I have a thread displaying HTML tables by means of Tkhtml,
another implementing a scrolling ticker...
|
by: Justin Ezequiel |
last post by:
What font is Tkinter using for displaying utf-8 characters?
On my Windows XP, most of the characters with names (unicodedata.name)
are displayed WYSIWYG.
However, on my Mandrake (warning: Linux...
|
by: krishnakant Mane |
last post by:
hello all,
I seam to have noticed this a bit late but it appears to me that
tkinter is being used very widely for gui development on all platform?
is that right?
since fredric lundh has written a...
|
by: Daniel Fetchinson |
last post by:
Was looking at PEP 3108, http://www.python.org/dev/peps/pep-3108/ ,
Is it just me or others also think that it would be a major loss to
remove tkinter from the python core? PEP 3108 starts off...
|
by: Protected |
last post by:
Hello. I'm a complete newbie trying to learn Python. I decided to try
some Tkinter examples, including the one from the library reference,
but they don't seem to do anything! Shouldn't there be,...
|
by: Dudeja, Rajat |
last post by:
Hi,
So, now I've finally started using Eclipse and PyDev as an IDE for my
GUI Application. I just wrote some sample programs as an hands on.
Now I would like to take up Tkinter. I'm using...
|
by: J-Burns |
last post by:
Hello. Im a bit new to using Tkinter and im not a real pro in
programming itself... :P. Need some help here.
Problem 1:
How do I make something appear on 2 separate windows using Tkinter? By...
|
by: dudeja.rajat |
last post by:
Hi,
I'm using Tkinter and Tix. I've created a combo box which I am able to
fill it up.
I'm want to call a function as soon as user selects some thing from
the combo box.
More precisely, I want...
|
by: Francesco Bochicchio |
last post by:
Il Mon, 18 Aug 2008 12:15:10 +0100, dudeja.rajat ha scritto:
Uhm, I don't think you should use the grid manager to obtain a window
like that. The grid manager is for equally distributing...
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: ryjfgjl |
last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
| |