473,322 Members | 1,398 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

askstring Window to the top under Windows

iwl
Hi,

I tryed askstring to input some text in my script,
but some ugly empty Window appears with the
Input-Window behind and all together behind my
Console showing my script. So all have to brought
to the top first by the user - very unconfortable

Mar 6 '07 #1
10 2941
iwl kirjoitti:
Hi,

I tryed askstring to input some text in my script,
but some ugly empty Window appears with the
Input-Window behind and all together behind my
Console showing my script. So all have to brought
to the top first by the user - very unconfortable
Are you asking about the function AskString in the EasyDialogs module of
Macintosh?

If so, I can't help you.

I'm just confused because the subject of your post contains the word
Windows which could mean Microsoft Windows on which Python hasn't the
EasyDialogs module.

Cheers,
Jussi
Mar 6 '07 #2
Jussi Salmela wrote:
iwl kirjoitti:
>Hi,

I tryed askstring to input some text in my script,
but some ugly empty Window appears with the
Input-Window behind and all together behind my
Console showing my script. So all have to brought
to the top first by the user - very unconfortable

Are you asking about the function AskString in the EasyDialogs module of
Macintosh?

If so, I can't help you.

I'm just confused because the subject of your post contains the word
Windows which could mean Microsoft Windows on which Python hasn't the
EasyDialogs module.
Not that I've used it, but...

http://www.averdevelopment.com/python/EasyDialogs.html

TJG
Mar 6 '07 #3
On Mar 6, 1:13 pm, "iwl" <Ingo.W...@gmx.dewrote:
Hi,

I tryed askstring to input some text in my script,
but some ugly empty Window appears with the
Input-Window behind and all together behind my
Console showing my script. So all have to brought
to the top first by the user - very unconfortable
It's not clear whether you're talking about the usual
"Why do I get a DOS window when I run my python script?"
question -- to which the answer is, in essence, change
your script's extension to .pyw or use the pythonw.exe
executable -- or "Why _when I use askstring_ do I get
an empty window?". If it's the latter, then I don't
know, but can you provide a small example script which
exhibits the behaviour.

TJG

Mar 6 '07 #4
iwl
On 6 Mrz., 14:48, "Tim Golden" <tjgol...@gmail.comwrote:
On Mar 6, 1:13 pm, "iwl" <Ingo.W...@gmx.dewrote:

It's not clear whether you're talking about the usual
"Why do I get a DOS window when I run my python script?"
question -- to which the answer is, in essence, change
your script's extension to .pyw or use the pythonw.exe
executable -- or "Why _when I use askstring_ do I get
an empty window?". If it's the latter, then I don't
know, but can you provide a small example script which
exhibits the behaviour.

TJG
>>import tkSimpleDialog
tkSimpleDialog.askstring("a","b")
at the python Console under XP (not pythonw).

-instead of only showing the Inputwindow at the top,
some additional empty window is shown, both not on top.

Mar 6 '07 #5
iwl kirjoitti:
On 6 Mrz., 14:48, "Tim Golden" <tjgol...@gmail.comwrote:
>On Mar 6, 1:13 pm, "iwl" <Ingo.W...@gmx.dewrote:

It's not clear whether you're talking about the usual
"Why do I get a DOS window when I run my python script?"
question -- to which the answer is, in essence, change
your script's extension to .pyw or use the pythonw.exe
executable -- or "Why _when I use askstring_ do I get
an empty window?". If it's the latter, then I don't
know, but can you provide a small example script which
exhibits the behaviour.

TJG
>>>import tkSimpleDialog
tkSimpleDialog.askstring("a","b")

at the python Console under XP (not pythonw).

-instead of only showing the Inputwindow at the top,
some additional empty window is shown, both not on top.
I assumed that by "python Console" you mean the IDLE editor/interpreter.
I entered your 2 lines and the behaviour is the same on Win XP. I doubt
it has nothing to do with the OS, though.

(A word of warning but don't tell anyone: I've never used Tkinter, I use
wxPython!)

Every GUI implementation has a command loop and things to initiate the
correct execution environment. I think that's what you are missing here
and that's causing the odd behaviour.

I found an example (16.1.2.2 A Simple Hello World Program) in Python 2.4
and modified as shown:

#===============================================
from Tkinter import *
import tkSimpleDialog # <<<=== modification here

class Application(Frame):
def say_hi(self):
print "hi there, everyone!"

def createWidgets(self):
self.QUIT = Button(self)
self.QUIT["text"] = "QUIT"
self.QUIT["fg"] = "red"
self.QUIT["command"] = self.quit

self.QUIT.pack({"side": "left"})

self.hi_there = Button(self)
self.hi_there["text"] = "Hello",
self.hi_there["command"] = self.say_hi

self.hi_there.pack({"side": "left"})

def __init__(self, master=None):
Frame.__init__(self, master)
self.pack()
self.createWidgets()

root = Tk()
app = Application(master=root)
app.mainloop()
tkSimpleDialog.askstring("a","b") # <<<=== modification here
root.destroy()
#===============================================

If you run it, it first shows the "Hello dialog" and after clicking the
QUIT button, your askstring gets run.

So: nothing wrong with Python, Tkinter or tkSimpleDialog.askstring.
Just carry on having fun with Python!

HTH,
Jussi
Mar 6 '07 #6
Jussi Salmela kirjoitti:
>
<snip>

Every GUI implementation has a command loop and things to initiate the
OOPS: an EVENT loop

Cheers,
Jussi
Mar 6 '07 #7
On Tuesday 06 March 2007 08:13, iwl wrote:
Hi,

I tryed askstring to input some text in my
script, but some ugly empty Window appears with
the Input-Window behind and all together behind
my Console showing my script. So all have to
brought to the top first by the user - very
unconfortable

By default
tk will open a root window.
so you will have to create
something to put into the
root window.
I suggest a button to open the tkSimpleDialog
box.

go to;

http://www.pythonware.com/library/tkinter/introduction/

jim-on-linux
http://www.inqvista.com
Mar 7 '07 #8
iwl
On 7 Mrz., 02:49, jim-on-linux <inq1...@verizon.netwrote:
On Tuesday 06 March 2007 08:13, iwl wrote:
Hi,
I tryed askstring to input some text in my
script, but some ugly empty Window appears with
the Input-Window behind and all together behind
my Console showing my script. So all have to
brought to the top first by the user - very
unconfortable

By default
tk will open a root window.
Is this default changeable befor askstring?

Mar 7 '07 #9
On Wednesday 07 March 2007 05:05, iwl wrote:
On 7 Mrz., 02:49, jim-on-linux
<inq1...@verizon.netwrote:
On Tuesday 06 March 2007 08:13, iwl wrote:
Hi,
>
I tryed askstring to input some text in my
script, but some ugly empty Window appears
with the Input-Window behind and all
together behind my Console showing my
script. So all have to brought to the top
first by the user - very unconfortable
By default
tk will open a root window.

Is this default changeable befor askstring?
Here is an example of a simple button that will
open a tkSimpleDialog box
======

from Tkinter import *
import tkSimpleDialog
from tkSimpleDialog import askfloat

root = Tk() ## this is the default window
vlab = Button( root, text= 'Click here to Open
Dialog',
width = 20, height = 2,
bg = 'yellow',
command =(lambda: askfloat( 'Entery',
'Enter credit card number') ) )
vlab.grid()
mainloop()

jim-on-linux
http://www.inqvista.com
Mar 7 '07 #10
On Wednesday 07 March 2007 05:02, Ingo Wolf wrote:
-------- Original-Nachricht --------
Datum: Tue, 06 Mar 2007 20:49:42 -0500
Von: jim-on-linux <in*****@verizon.net>
An: py*********@python.org
CC: "iwl" <In*******@gmx.de>
Betreff: Re: askstring Window to the top under
Windows
By default
tk will open a root window.
so you will have to create
something to put into the
root window.
I suggest a button to open the tkSimpleDialog
box.

go to;

http://www.pythonware.com/library/tkinter/int
roduction/

I've allready had a short look trough this to
find an idea how to change this behavior (which
should be done by the askstring makers) but
haven't up to now. I think what I do is what
askstring was made for keeping me away from tk
internals only wanting a little string input.

Because I have embedded python In my C-App I
make my own window now In C and extend python
by it so having more control about things
happen.

Check out how to use Entry Wiget
for data entry.

====

from Tkinter import *

root = Tk() ## this is the default window
vlab = Label(root, width = 20,
text = 'Enter data here')
vlab.grid( row=0, column =0)

ventry= Entry(root, width = 30)
ventry.grid(row = 0, column = 1)
mainloop()

jim-on-linux
http:\\www.inqvista.com



Mar 7 '07 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: wes weston | last post by:
Guys/Gals, Does anyone know why a call to tkSimpleDialog.askstring would result in a grab fail error. The call is from a toplevel window. The error happens about two thirds of the time! It...
0
by: Miki Tebeka | last post by:
Hello All, The following script "hangs" on win32 system: from Tkinter import * from tkSimpleDialog import askstring root = Tk() root.withdraw() # <<< Problem here askstring("Yap", "What's...
9
by: Christopher Benson-Manica | last post by:
In some old Javascript we have, we try to determine whether the client is IE or Netscape (assume for the purposes of this question that the question can be resolved satisfactorily) and tailor the...
4
by: Altramagnus | last post by:
I have 30 - 40 type of different window. For each type I need about 20 instances of the window. When I try to create them, I get "Error creating window handle" My guess is there is a maximum...
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
6
by: David Hayes | last post by:
juglesh <juglesh@nospamRadioKDUG.com> wrote in "Re: how to maximize the browser window that fits the monitor size?" (Saturday, January 01, 2005 3:12 AM): > > >I want to maximize the browser...
4
by: JeffP | last post by:
I want to add a short-cut to a windows app similar to launching from a windows run line a New window, to prevent changing an existing browser window from moving off a current logged in session...
14
by: D. Alvarado | last post by:
Hello, I am trying to open a window containing an image and I would like the image to be flush against the window -- i.e. have no padding or border. Can I make this happen with a single call to a...
4
by: alexandre.brisebois | last post by:
Hi, I am using access 2003, I would like to know if there is an option to reorganize the tables in a maner that is readable, as we can do in sql sever 2000 or 2005. I have been given a database...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.