Vasilis Vlachoudis | 1 Jul 2010 16:30
Picon
Picon

Re: How to capture exceptions after the end of the program

Unfortunately I was not able to narrow down to a simple code. All my 
attempts failed and they worked ok. While in the big project is not 
behaving correctly.

The problem I see depends on the gc. If the gc deletes first the Tk_ 
root window then when it tries to delete the Font.__del__,  tcl fails. 
Which for me is a bit puzzling since there is a backlink of the root in 
the Font class.

However I saw that from python 2.6 the tkFont.Font.__del__ method has 
changed with respect to the 2.4 and there is a branch to catch the 
generic exception.
When I added this to the tkFont of the 2.4 it worked and absorbed all 
Exceptions.

Vasilis

On 06/25/10 22:39, Michael Lange wrote:
> Hi Vasilis,
>
> On Fri, 25 Jun 2010 12:20:30 +0200
> Vasilis Vlachoudis<Vasilis.Vlachoudis <at> cern.ch>  wrote:
>
>    
>> Hi all,
>>
>> I have a tkinter application that uses several fonts. However only
>> with python 2.4 when the application is closed then I get the
>> following exceptions (with 2.6 it works Ok)
>>
(Continue reading)

Guido Carballo-Guerrero | 10 Jul 2010 18:52

Tkinter (IDLE) freeze when I try to use ttk

Hello, I just update my Python version to 2.7. I was doing some programs using Tkinter and ttk. By the way I
have a Mac running 10.6.4. Well, after I install Python, I install ActivePython2.6.5--I try to install
2.7.0 but at the end of the installation it gave me an error message--and ActiveTcl, this 'cause I discover
that if I didn't do that, Python will use Tcl and Tk 8.4, which doesn't allow me to use ttk.

No my problem is that I can't use Python's IDLE. Well, I can only open one window at a time. If I try to open a new
window to make a program, Python freeze. Some curios, if that if I don't have Python open, and double click
on a program, Python opens the IDLE and the program in to separate windows without a problem, but when I try
to run the program it freeze.

I guess that this is a bug somewhere in the ttk implementation, or in Python. Do you guys have any idea how can I
solve this? Or have anybody update Python to 2.7, and use ttk on a Mac? If so, please let me know how you manage
to do it.

Regards!

Guido
Sibylle Koczian | 11 Jul 2010 10:07
Picon

Re: Tkinter (IDLE) freeze when I try to use ttk

-----Ursprüngliche Nachricht-----
Von: Guido Carballo-Guerrero <charras <at> me.com>
>No my problem is that I can't use Python's IDLE. Well, I can only open one window at a time. If I try to open a new
window to make a program, Python freeze. Some curios, if that if I don't have Python open, and double click
on a program, Python opens the IDLE and the program in to separate windows without a problem, but when I try
to run the program it freeze.
>
>I guess that this is a bug somewhere in the ttk implementation, or in Python. Do you guys have any idea how can
I solve this? Or have anybody update Python to 2.7, and use ttk on a Mac? If so, please let me know how you
manage to do it.
>
As far as I know this is just because IDLE is written in tkinter. So if you try to run another tkinter
application from IDLE, the two mainloop() calls interfere with each other. You should be able to run
console applications from IDLE, but with tkinter applications you can develop them using IDLE but run
them from a console (or whatever is used as a console on a Mac). It's nothing to do with the Python version or
with ttk and I doubt it can be called a bug.

HTH
Sibylle
___________________________________________________________
WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und 
50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de
_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Cameron Laird | 11 Jul 2010 13:58

Re: Tkinter (IDLE) freeze when I try to use ttk

On Sun, Jul 11, 2010 at 10:07:30AM +0200, Sibylle Koczian wrote:
			.
			.
			.
> Von: Guido Carballo-Guerrero <charras <at> me.com>
> >No my problem is that I can't use Python's IDLE. Well, I can only open one window at a time. If I try to open a
new window to make a program, Python freeze. Some curios, if that if I don't have Python open, and double
click on a program, Python opens the IDLE and the program in to separate windows without a problem, but when
I try to run the program it freeze.
> >
> >I guess that this is a bug somewhere in the ttk implementation, or in Python. Do you guys have any idea how
can I solve this? Or have anybody update Python to 2.7, and use ttk on a Mac? If so, please let me know how you
manage to do it.
> >
> As far as I know this is just because IDLE is written in tkinter. So if you try to run another tkinter
application from IDLE, the two mainloop() calls interfere with each other. You should be able to run
console applications from IDLE, but with tkinter applications you can develop them using IDLE but run
them from a console (or whatever is used as a console on a Mac). It's nothing to do with the Python version or
with ttk and I doubt it can be called a bug.
			.
			.
			.
If one is clever and motivated, it's possible to code a Tkinter
application in a way that permits it to be run (apparently)
within IDLE.  I don't think I've ever seen it documented well
...  All that Sibylle Koczian writes is true, though, and, in
particular, a conventional Tkinter application simply is incom-
patible with IDLE.
Michael O'Donnell | 11 Jul 2010 18:01
Picon
Picon
Favicon

Re: Tkinter (IDLE) freeze when I try to use ttk

Hi all,

>> As far as I know this is just because IDLE is written in tkinter. So if you try to run another
> tkinter application from IDLE, the two mainloop() calls interfere with each other. You should be
> able to run console applications from IDLE, but with tkinter applications you can develop them
> using IDLE but run them from a console (or whatever is used as a console on a Mac). It's
> nothing to do with the Python version or with ttk and I doubt it can be called a bug.

  I don't understand this, I have been running my tkinter based
applications from within IDLE for years, on Mac, PC or Linux.
Am I misunderstanding something?

My biggest problems with IDLE on the Mac have been when python has
been compiled against one version of the tcl/tk libraries
but python is finding a different version of tcl/tk. Sometimes I
have needed to recompile python from sources. Other times I have
installed the asked-for version of tcl from ActiveState.

Try running idle from a terminal window. That way you can see the
error message when idle crashes. May suggest that the wrong tcl
is installed.

Mick

On Sun, Jul 11, 2010 at 1:58 PM, Cameron Laird <Cameron <at> phaseit.net> wrote:
> On Sun, Jul 11, 2010 at 10:07:30AM +0200, Sibylle Koczian wrote:
>                        .
>                        .
>                        .
>> Von: Guido Carballo-Guerrero <charras <at> me.com>
(Continue reading)

Guido Carballo-Guerrero | 11 Jul 2010 20:18

Tkinter (IDLE) freeze when I try to use ttk

Well, I fix the problem. The best to install Python on a Mac is to download the source files and do:

$ ./configure --enable-universalsdk --enable-framework
$ make
$ make frameworkinstall

Inside of the folder where you have all the files of the source. Something to remember is that you need to have SDK install in the computer. But after I did this, now I can use Python, Tkinter and ttk without any problems. And I notice that in some of the lines after one type make, Tcl, and Tk frameworks are call.

Now if I do:

>>> import Tkinter as Tkt
>>> Tkt.TclVersion
8.5

As you can see the Tcl version is 8.5, which is what ttk needs to run without problems.

Regards!

Guido


On Jul 11, 2010, at 4:00 AM, tkinter-discuss-request <at> python.org wrote:

Send Tkinter-discuss mailing list submissions to
tkinter-discuss <at> python.org

To subscribe or unsubscribe via the World Wide Web, visit
http://mail.python.org/mailman/listinfo/tkinter-discuss
or, via email, send a message with subject or body 'help' to
tkinter-discuss-request <at> python.org

You can reach the person managing the list at
tkinter-discuss-owner <at> python.org

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Tkinter-discuss digest..."
Today's Topics:

  1. Tkinter (IDLE) freeze when I try to use ttk
     (Guido Carballo-Guerrero)
  2. Re: Tkinter (IDLE) freeze when I try to use ttk (Sibylle Koczian)

From: Guido Carballo-Guerrero <charras <at> me.com>
Date: July 10, 2010 10:52:11 AM GMT-06:00
To: tkinter-discuss <at> python.org
Subject: [Tkinter-discuss] Tkinter (IDLE) freeze when I try to use ttk


Hello, I just update my Python version to 2.7. I was doing some programs using Tkinter and ttk. By the way I have a Mac running 10.6.4. Well, after I install Python, I install ActivePython2.6.5--I try to install 2.7.0 but at the end of the installation it gave me an error message--and ActiveTcl, this 'cause I discover that if I didn't do that, Python will use Tcl and Tk 8.4, which doesn't allow me to use ttk.

No my problem is that I can't use Python's IDLE. Well, I can only open one window at a time. If I try to open a new window to make a program, Python freeze. Some curios, if that if I don't have Python open, and double click on a program, Python opens the IDLE and the program in to separate windows without a problem, but when I try to run the program it freeze.

I guess that this is a bug somewhere in the ttk implementation, or in Python. Do you guys have any idea how can I solve this? Or have anybody update Python to 2.7, and use ttk on a Mac? If so, please let me know how you manage to do it.

Regards!

Guido




From: Sibylle Koczian <nulla.epistola <at> web.de>
Date: July 11, 2010 2:07:30 AM GMT-06:00
To: tkinter-discuss <at> python.org
Subject: Re: [Tkinter-discuss] Tkinter (IDLE) freeze when I try to use ttk


-----Ursprüngliche Nachricht-----
Von: Guido Carballo-Guerrero <charras <at> me.com>
No my problem is that I can't use Python's IDLE. Well, I can only open one window at a time. If I try to open a new window to make a program, Python freeze. Some curios, if that if I don't have Python open, and double click on a program, Python opens the IDLE and the program in to separate windows without a problem, but when I try to run the program it freeze.

I guess that this is a bug somewhere in the ttk implementation, or in Python. Do you guys have any idea how can I solve this? Or have anybody update Python to 2.7, and use ttk on a Mac? If so, please let me know how you manage to do it.

As far as I know this is just because IDLE is written in tkinter. So if you try to run another tkinter application from IDLE, the two mainloop() calls interfere with each other. You should be able to run console applications from IDLE, but with tkinter applications you can develop them using IDLE but run them from a console (or whatever is used as a console on a Mac). It's nothing to do with the Python version or with ttk and I doubt it can be called a bug.

HTH
Sibylle
___________________________________________________________
WEB.DE DSL ab 19,99 Euro/Monat. Bis zu 150,- Euro Startguthaben und
50,- Euro Geldprämie inklusive! https://freundschaftswerbung.web.de



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

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Greg Ewing | 12 Jul 2010 02:34
Picon
Picon
Favicon

Re: Tkinter (IDLE) freeze when I try to use ttk

Sibylle Koczian wrote:

> As far as I know this is just because IDLE is written in tkinter.
> So if you try to run another tkinter application from IDLE, the two 
> mainloop() calls interfere with each other.

I thought IDLE had an option to run things in a separate
process nowadays.

--

-- 
Greg
Sridhar Ratnakumar | 12 Jul 2010 19:08
Picon
Gravatar

Re: Tkinter (IDLE) freeze when I try to use ttk


On 2010-07-10, at 9:52 AM, Guido Carballo-Guerrero wrote:

> Hello, I just update my Python version to 2.7. I was doing some programs using Tkinter and ttk. By the way I
have a Mac running 10.6.4. Well, after I install Python, I install ActivePython2.6.5--I try to install
2.7.0 but at the end of the installation it gave me an error message--and ActiveTcl, this 'cause I discover
that if I didn't do that, Python will use Tcl and Tk 8.4, which doesn't allow me to use ttk.

Hi there -

Were you using ActivePython 2.7? It was not clear from your message. ActivePython 2.7 is built against
Tcl/Tk 8.5; on Mac 10.6 it therefore uses Apple's Tcl/Tk (8.5) in /System/Library/Frameworks.
ActiveTcl 8.5 (which does not have 64-bit support yet) need not be installed.

cf. http://docs.activestate.com/activepython/2.7/faq.html#how-do-i-use-tkinter-or-idle-in-64-bit-activepython-on-osx-10-5

-srid
GKalman | 20 Jul 2010 19:00
Picon
Favicon

Widget to appear square-shaped on screen...


I'm trying to make a square-shaped  board, something like this:

from Tkinter import *

root = Tk()
w=[]
for k in range(9):
    i=k/3
    j=k%3    
    w.append(Label(root,text=str(k),bg="red",width=5,height=5))
    w[k].grid(row=i,column=j,padx=2,pady=2,ipadx=5,ipady=5)
mainloop()

It shows up on my screen as rectangular (non-square) shaped. What do I have
to do to make it appear in a square-shaped form (i.e. with Label height &
width to be equal on the sceen)?
--

-- 
View this message in context: http://old.nabble.com/Widget-to-appear-square-shaped-on-screen...-tp29216127p29216127.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.
Wayne Werner | 20 Jul 2010 19:45
Picon
Gravatar

Re: Widget to appear square-shaped on screen...

On Tue, Jul 20, 2010 at 12:00 PM, GKalman <kalman_g <at> msn.com> wrote:

I'm trying to make a square-shaped  board, something like this:

from Tkinter import *

root = Tk()
w=[]
for k in range(9):
   i=k/3
   j=k%3
   w.append(Label(root,text=str(k),bg="red",width=5,height=5))
   w[k].grid(row=i,column=j,padx=2,pady=2,ipadx=5,ipady=5)
mainloop()

It shows up on my screen as rectangular (non-square) shaped. What do I have
to do to make it appear in a square-shaped form (i.e. with Label height &
width to be equal on the sceen)?

That's because when you put text on a label the height and width are based on text height and width. Since those two are *not* equal for 99% of fonts, you'll get weird dimensions. 

You can get around it by following the directions here: http://effbot.org/tkinterbook/button.htm 

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

Gmane