full screen gui

2006-01-13 Thread linuxnooby
Hi

I am trying to write a python script to run on windows xp that will
have a full screen gui.

The script has a function that creates a full screen (hides task bar)
top level window using tkinter.

If I close the window and call the function a 2nd time the resulting
window is full screen, but does not hide the task bar this time.

I have included code below. Any suggestions as to how i can fix this? I
am open to suggestions about other python gui

cheers David



from Tkinter import *
import time

#create invisible root window
root = Tk()
root.withdraw()

def closewindow():

top.destroy()
time.sleep(4)
create()

def create():
global top
top = Toplevel(root)


top.overrideredirect(1) #hides max min buttons
w, h = root.winfo_screenwidth(), root.winfo_screenheight()
top.geometry("%dx%d+0+0" % (w, h))


app = Frame(top)
app.grid()

bttnhide = Button(app, text ="destroy window and create a new window
in 4 seconds", command=closewindow)
bttnhide.grid()

bttnclose = Button(app, text ="exit application",
command=root.destroy)
bttnclose.grid()


create()

root.mainloop()

-- 
http://mail.python.org/mailman/listinfo/python-list


newbie pipe question

2006-09-04 Thread linuxnooby
Hi

I want to write a python script that accepts input ( a single line of
text) from another program (squid proxy) and sends back output ( a
single line of text). I am not sure how to go about this

cheers David

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: newbie pipe question

2006-09-06 Thread linuxnooby
Thanks

David

-- 
http://mail.python.org/mailman/listinfo/python-list


message box halts prgram flow

2006-03-17 Thread linuxnooby
HI

I am creating a tkinter app.

example

tkMessageBox.showinfo("Window Text", "A short message")
print "blah"

The execution of the application halts when the message box is
displayed until the user clicks OK, then "blah is printed.

However I want the program to display message box and continue on to
print blah without waiting for user response.

Any suggestions on how to go about this?

cheers David

-- 
http://mail.python.org/mailman/listinfo/python-list


tkinter question

2006-03-27 Thread linuxnooby
Hi

I have a tkinter question. In the following script the window will not
display until the script has finished executing. It appears at the same
time as the output "script finished". How can I make it appear
immediately,  with the output "script finished" appearing 5 seconds
later.

cheers Dave

from Tkinter import *
import time

print "script started"

top = Tk()
F = Frame(top)
F.pack()
Hello = Label(F, text="hello world")
Hello.pack()
   
time.sleep(5)
print "script finished"
   
mainloop()

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter question

2006-03-29 Thread linuxnooby
Ultimately what I am trying to is create a public computer session
manager.

1) User logs in and main application window is withdrawn (easy)
2) After (for example) 55 minutes - a warning window/dialoguebox
"session will end in 5 minutes"
3) With 30 seconds to go  - a warning window/dialoguebox "session will
end in 30 seconds"
4) User logged out (easy)

I am having problems with steps 2 and 3
Either the window/dialoguebox  will
(a) pause the program execution upon display waiting for user input
or (b) both warnings display together when application has finished.

What I want want is a window/dialogue box that will not halt
application logic, and will display immediately.

cheers David

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: tkinter question

2006-03-30 Thread linuxnooby
>If you just create
>a Toplevel and populate it with widgets, it will just display once the
>control is returned to the Tkinter mainloop and no user input will be
>needed.

Thanks for explaining that. I borrowed the "after" method that you used
in your first reply. It seems to do what I want (except for
root.destroy) Though any suggestions on a more elegant solution
welcome.

cheers David


from Tkinter import *

def message1():
top1 = Tk()
F1 = Frame(top1)
F1.pack()
Hello1 = Label(F1, text="step 2 you will be logged off in 5
seconds")
Hello1.pack()
top1.after(3000, message2)

def message2():
top2 = Tk()
F2 = Frame(top2)
F2.pack()
Hello2 = Label(F2, text="step 3 you will be logged off in 2
seconds")
Hello2.pack()
top2.after(2000, goodbye)

def goodbye():
print "step 4 you are logged out"
root.destroy

root = Tk()
root.withdraw()
print "step 1 login window withdrawn"

message1()
  
root.mainloop()

-- 
http://mail.python.org/mailman/listinfo/python-list