Fabrizio Pollastri | 5 Jul 2007 17:29
Picon

Temporary disabling TCL execution

Hello,
I am trying to disable temporary TCL execution during the instantiation 
of Tkinter classes. The scope is to build the Tkinter python structure 
of a Tk widget tree already generated by direct TCL commands.
I tried a "monkey patch" on the call method of tkapp as follow

from Tkinter import *

def dummy_tk_call(*args):
   return

root = Tk()

original_call = root.tk.call
root.tk.call = dummy_tk_call	# disable TCL execution
# put here code needing no TCL execution
root.tk.call = original_call	# enable TCL execution
...

The problem is that root.tk.call is a read only attribute.

Any solution is welcome.

Cheers,
F. Pollastri.
Marcus Gnaß | 6 Jul 2007 12:56
Picon
Picon

how to maximize a window (beginner question!)

I like to know how I can maximize a window at program start.
I haven't found any hint so far. Hope you can help me ...

Marcus
Cameron Laird | 6 Jul 2007 16:17

Re: how to maximize a window (beginner question!)

On Fri, Jul 06, 2007 at 12:56:52PM +0200, Marcus Gna? wrote:
			.
			.
			.
> I like to know how I can maximize a window at program start.
> I haven't found any hint so far. Hope you can help me ...
			.
			.
			.
Apparently no one has yet updated and transcribed
<URL: http://wiki.tcl.tk/2233 > for Tkinter.  That
would make a nice tiny task for someone ...

Is the maximization on that page the sort you had
in mind?
Surya Prakash Garg | 9 Jul 2007 18:51

Opening one frame after closing another

Hello,

 I am a newbie in the field of python. I want to create a wizard using 
python language. in which i am creating some buttons to open another 
frame and closing the parent frame. Right now i am facing problems in 
passing arguments from one frame to another frame. for example to 
dispose current frame i use frame1.destroy but am not able to navigate. 
Here is the code.........

import os, sys
from Tkinter import *
from ImageTk import PhotoImage           # <== use PIL replacement class

                                         # rest of code unchanged
imgdir  = 'images'
imgfile = 'sevasys1.jpg'
icon= 'sevasys2.ico'
imgpath = os.path.join(imgdir, imgfile)
icopath = os.path.join(imgdir, icon)
x0=0
y0=0
xoff=200
yoff=80
xhor=600
yver=450
class Application(Frame):
     def __init__(self, master,my):
            """ Initialize the frame. """
            my=Frame.__init__(self, master)
            my.pack()
(Continue reading)

Russell E. Owen | 9 Jul 2007 21:44
Favicon

Re: Opening one frame after closing another

In article <469267AF.1060803 <at> sevasys.com>,
 Surya Prakash Garg <surya.garg <at> sevasys.com> wrote:

> Hello,
> 
>  I am a newbie in the field of python. I want to create a wizard using 
> python language. in which i am creating some buttons to open another 
> frame and closing the parent frame. Right now i am facing problems in 
> passing arguments from one frame to another frame. for example to 
> dispose current frame i use frame1.destroy but am not able to navigate. 
> Here is the code.........

Here's a few thoughts:
- Instead of thinking in terms of "passing data from one frame to 
another" I suggest you keep the data in an object (the "model").

The different frames then can read and write the data in the model as 
necessary. This split (between GUI elements and model) allows you to 
tweak the GUI more easily.

To share that model data, create an instance of the data model object as 
an attribute of your Application class. Then all methods of the class 
can easily get to the data model.

- At the moment it looks as if create_frame1 creates and packs a frame 
and then destroys it. I suspect you want create_frame1 to only create 
and pack it. Then have callback functions from the various buttons do 
the "navigation" by hiding the current frame and showing the next 
desired frame.

(Continue reading)

Vinu Vikram | 11 Jul 2007 16:32
Picon

install tkinter separately

Hi All
I am working in machine which has python 2.3.4. The machine is a cluster and maintains by other people. One of my program use tkinter it is not available in the machine. Does anybody know  how to install tkinter module separately in my user account?
Thanking You
Vinu V
--
VINU VIKRAM
http://iucaa.ernet.in/~vvinuv/

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Picon

Dialog and mainloop (UNCLASSIFIED)

Classification:  UNCLASSIFIED 
Caveats: NONE

I have an application in the works but seem to have a basic misunderstanding
of the implementation of standard dialog windows.

When the user presses a button to commit an action, I wish to pop up a dialog
with a "Are you sure?" query. I'm trying to use the basic askyesno. If the
user chooses to continue, we go on our merry way and processing occurs
(potentially very time consuming).

HOWEVER, even though the user has pressed "yes" or "no", the dialog window
itself does not disappear until I fall out of the function and, I believe,
the process has returned to the mainloop.

The behavior I have now is, well, unacceptable. The underlying processing may
take some time, there are messages being written to a status window, etc; and
the user is stuck looking at the dialog not aware of what is going on.

Am I missing something? [well, of course I am!]

Suggestions/comments?

**************************************************************
Jeff Hensley, Ph.D.                      Phone: 601-634-4596
EQM On-site lead, ERDC PET    Fax: 601-634-2324
3909 Halls Ferry Road         Jeffrey.L.Hensley <at> erdc.usace.army.mil
Vicksburg, MS 39180-6199    http://www.erdc.hpc.mil
**************************************************************

Classification:  UNCLASSIFIED 
Caveats: NONE
Gerardo Juarez | 15 Jul 2007 21:41
Picon

Re: Dialog and mainloop (UNCLASSIFIED)


Use a Toplevel window, display your dialog there and add a button whose 
command is "withdraw". Like this:

def winmsg(s):
    w = Toplevel()
    Label(w, text=s, relief='groove').pack(padx=10, pady=5)
    Button(w, text='Ok', command=w.withdraw).pack(pady=5)

Every time I call winmsg() with a message I wish to display, the popup
dialog appears. When the user reads the message and presses the button,
the popup is immediately gone. I think this is what you want.

Note that this simple dialog is not modal, but that's a problem you may
run into further down the line, certainly not now.

Gerardo

On Fri, 13 Jul 2007, Hensley, Jeffrey L ERDC-ITL-MS Contractor wrote:

> Classification:  UNCLASSIFIED 
> Caveats: NONE
> 
> I have an application in the works but seem to have a basic misunderstanding
> of the implementation of standard dialog windows.
> 
> When the user presses a button to commit an action, I wish to pop up a dialog
> with a "Are you sure?" query. I'm trying to use the basic askyesno. If the
> user chooses to continue, we go on our merry way and processing occurs
> (potentially very time consuming).
> 
> HOWEVER, even though the user has pressed "yes" or "no", the dialog window
> itself does not disappear until I fall out of the function and, I believe,
> the process has returned to the mainloop.
> 
> The behavior I have now is, well, unacceptable. The underlying processing may
> take some time, there are messages being written to a status window, etc; and
> the user is stuck looking at the dialog not aware of what is going on.
> 
> Am I missing something? [well, of course I am!]
> 
> Suggestions/comments?
> 
> **************************************************************
> Jeff Hensley, Ph.D.                      Phone: 601-634-4596
> EQM On-site lead, ERDC PET    Fax: 601-634-2324
> 3909 Halls Ferry Road         Jeffrey.L.Hensley <at> erdc.usace.army.mil
> Vicksburg, MS 39180-6199    http://www.erdc.hpc.mil
> **************************************************************
> 
> Classification:  UNCLASSIFIED 
> Caveats: NONE
> 
> _______________________________________________
> Tkinter-discuss mailing list
> Tkinter-discuss <at> python.org
> http://mail.python.org/mailman/listinfo/tkinter-discuss
> 
Russell E. Owen | 17 Jul 2007 19:36
Favicon

Workaround for submenus not displaying in 8.4.15

Under Tcl/Tk 8.4.15 (at least on MacOS X) submenus of menubutton menus 
don't display (submenus do work fine from the menu bar). This is tk bug 
1731734.

Anyway, this is causing grief for my application and I was wondering if 
anyone had found a workaround (other than reverting to an older Tcl/Tk, 
which I really don't want to do -- this is the first universal binary of 
Tcl/Tk that reliably keeps track of mouse position; in fact it's the 
*only* version of Aqua Tcl/Tk other than 8.4.11 that does this).

I suppose I could rewrite my application to never use menubuttons with 
submenus, but I was hoping to not have to change the existing user 
interface.

-- Russell
Russell E. Owen | 26 Jul 2007 00:57
Favicon

Re: Workaround for submenus not displaying in 8.4.15

In article <rowen-FE8ABD.10361217072007 <at> sea.gmane.org>,
 "Russell E. Owen" <rowen <at> cesmail.net> wrote:

> Under Tcl/Tk 8.4.15 (at least on MacOS X) submenus of menubutton menus 
> don't display (submenus do work fine from the menu bar). This is tk bug 
> 1731734.
> 
> Anyway, this is causing grief for my application and I was wondering if 
> anyone had found a workaround...

The recent AciveState Tcl/Tk 8.4.15 contains a fix for this bug. So an 
easy answer is use that. Thanks again to Daniel A. Steffen for his many 
great improvements to Aqua Tcl/Tk.

-- Russell

Gmane