473,785 Members | 2,639 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 2974
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
tkSimpleDialo g.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
tkSimpleDial og.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(Fra me):
def say_hi(self):
print "hi there, everyone!"

def createWidgets(s elf):
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.p ack({"side": "left"})

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

root = Tk()
app = Application(mas ter=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...@verizo n.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...@verizo n.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

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

Similar topics

1
2603
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 doesn't happen at all in other apps. Is it a build issue? Redhat 9.0 Python 2.3.3 Thanks,
0
1656
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 up?")
9
1766
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 script to it: var myOpen=open(url, 'subWin', 'width=600, height=400,*A*resizable=1,scrollbars=1' ); if ( myOpen && !myOpen.closed ) { myOpen.focus(); } *B*
4
561
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 number of window handle, because if I reduce to about 2 instances of each window, it can run. But not 20 instances of each window. Does anyone know what the problem is? is it really because it exceeds the maximum number of window handle?
18
2497
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 statusbar. Yet FF gives me both a statusbar and the window is resizable! Does this mean that FF does not support these "features" or is there a different way to code them for FF?
6
5645
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 window when I open a new window. > > function expand() { > window.moveTo(0,0); > window.resizeTo(screen.availWidth, screen.availHeight); > }
4
5982
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 to another web application. And, I'd like it to be a chromeless window, sans toobars and sized similar to a popup. TIA
14
11096
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 window.open function? I would prefer not to create a separate HTML page. So far all I have is the basic var cwin = window.open('images/KJV-THANKS.gif', 'Thanks', 'width=243,height=420,'); cwin.focus();
4
6408
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 to look a and I am loosing tremendious amounts of time trying to organize it so that I could view it. Regards, Alexandre Brisebois
0
9481
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10336
Oralloy
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10155
jinu1996
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10095
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8978
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6741
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5383
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4054
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3655
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.