473,411 Members | 1,968 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,411 software developers and data experts.

Tkfont buggy for two Tk() top level windows

I'm calling Tk() twice to create two top level windows,
which works fine in every respect except fonts.
Assigning a Tkfont to widgets in the first Tk() window I create works
fine, the font looks good as it should. But if I start a another
window by calling Tk() again the second window will always use some
awful default font. Swapping the two lines that call Tk() will
change which one actually uses the font and which doesn't.

The code looks like:
win_one = Tk()
win_two = Tk()
myfont = tkFont.Font(family="Courier", size=12)

Entry(win_one, font=myfont).pack(fill='both',expand=1)
Entry(win_two, font=myfont).pack(fill='both',expand=1)

Any text on the first window obeys the font, the second
one will always use some system default. switching the two lines
that call Tk() reverses which window goes font happy.

If calling Tk() twice has undefined behavior I would rather it
raise a useful exception instead of continuing partially gimpy.

Debian testing, python 2.3.3, tk 8.2.3-5
This has been the behavior for 6-12 months (as long as I've been using
Tk). Until now I just assumed I had missed a call, after checking it
out it seems to be a Tk thing.

TIA,

-jackdied

Jul 18 '05 #1
0 1111

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

Similar topics

8
by: Eric Brunel | last post by:
Hi all, I was creating a Tkinter widget in the style of the reversed tabs below Excel worksheets and I stepped in a serious problem: the code I made makes python crash with a seg fault, bus...
4
by: Bgc | last post by:
Hello All, I've been struggling for years now trying to come up with a solution to a very personal programming problem with Python. I'm an educational programmer, and I make applications that...
6
by: Simon Foster | last post by:
Hi all, Has anyone seen the follwoing message on the Windows platform when tring to use Tk? --- >>> import Tkinter >>> root = Tkinter.Tk() Traceback (most recent call last):
3
by: Elaine Jackson | last post by:
When I use a function from tkFileDialog outside of a tk GUI context, it creates a "dummy" tk window. It would be nice to know how to close these windows programmatically. TIA Peace
16
by: Ali | last post by:
I have a the list: info = , , ] I want this info to show on a tk window like this: |--|------------------------| |TK|Blah |
1
by: Christian | last post by:
Hi all, I have an application with a GUI in Tcl/Tk (running on AIX /Linux) and I need to make it running (porting) in Windows 2000. I would like to have some suggestion about this. What IDE...
1
by: Atul | last post by:
Hi, I have installed a truetype font (.ttf) on a linux machne (SUSE linux 10, KDE) by copying it to my .fonts folder. I can use the font in all applications like open-office and firefox browser....
1
by: rahulnag22 | last post by:
Hi, I have a Tk() window "base_win = Tk()" with multiple frames on it having a combination of widgets. If I click on say a button widget which launches a new top level window "new_win =...
3
by: luke.hoersten | last post by:
I'm looking for a good example of how to correctly abstract TK code from the rest of my program. I want to just get some user info and then get 4 values from the GUI. Right now I've written it OOP...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
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...
0
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...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
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,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new...
0
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...

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.