Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IDLE not working correctly on Windows (Py30a2/IDLE30a1) #45942

Closed
mark-summerfield mannequin opened this issue Dec 12, 2007 · 8 comments
Closed

IDLE not working correctly on Windows (Py30a2/IDLE30a1) #45942

mark-summerfield mannequin opened this issue Dec 12, 2007 · 8 comments
Assignees
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error

Comments

@mark-summerfield
Copy link
Mannequin

mark-summerfield mannequin commented Dec 12, 2007

BPO 1601
Nosy @kbkaiser, @amauryfa, @tiran, @mark-summerfield

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = 'https://github.com/tiran'
closed_at = <Date 2008-01-05.21:36:08.780>
created_at = <Date 2007-12-12.09:09:58.992>
labels = ['type-bug', 'expert-tkinter']
title = 'IDLE not working correctly on Windows (Py30a2/IDLE30a1)'
updated_at = <Date 2010-04-27.20:31:38.531>
user = 'https://github.com/mark-summerfield'

bugs.python.org fields:

activity = <Date 2010-04-27.20:31:38.531>
actor = 'loewis'
assignee = 'christian.heimes'
closed = True
closed_date = <Date 2008-01-05.21:36:08.780>
closer = 'christian.heimes'
components = ['Tkinter']
creation = <Date 2007-12-12.09:09:58.992>
creator = 'mark'
dependencies = []
files = []
hgrepos = []
issue_num = 1601
keywords = []
message_count = 8.0
messages = ['58486', '58512', '58519', '58715', '58717', '58718', '58737', '59019']
nosy_count = 5.0
nosy_names = ['kbk', 'amaury.forgeotdarc', 'christian.heimes', 'mark', 'JosephArmbruster']
pr_nums = []
priority = 'normal'
resolution = 'fixed'
stage = None
status = 'closed'
superseder = None
type = 'behavior'
url = 'https://bugs.python.org/issue1601'
versions = ['Python 3.0']

@mark-summerfield
Copy link
Mannequin Author

mark-summerfield mannequin commented Dec 12, 2007

(1) IDLE starts up on Windows OK, but if I press Alt+F the file menu
comes up giant sized (i.e., each menu entry is almost as tall as the
screen).
(2) If I open a file using Ctrl+O, the Open dialog pops up fine, but
when I select a file and click Open, IDLE crashes.

Oh, and (no version of) IDLE respects the cursor blink setting on Windows.

@mark-summerfield mark-summerfield mannequin added topic-IDLE type-bug An unexpected behavior, bug, or error labels Dec 12, 2007
@tiran
Copy link
Member

tiran commented Dec 13, 2007

We are aware of several Windows related bugs with IDLE. I assume they
are related to our Tcl/Tk build.

@JosephArmbruster
Copy link
Mannequin

JosephArmbruster mannequin commented Dec 13, 2007

Tiran, agreed. You can reproduce this issue quickly outside of IDLE
with this snippet:

from Tkinter import *
import tkMessageBox

class App(Frame):
  def __init__(self, master):
    Frame.__init__(self,master)
    self.master.title("Wierd Menu")
    self.configure(height=200,width=200)
    self.grid(padx=15, pady=15,sticky=N+S+E+W)       
    self.menu = Menu(self)
    self.master.config(menu=self.menu)
    self.tkMenu = Menu(self.menu)
    self.menu.add_cascade(label="MenuItem", menu=self.tkMenu)
    self.tkMenu.add_command(label="Test", command=self.Test)
  def Test(self):
    tkMessageBox.showinfo("Test", "Test")
if __name__ == "__main__":
  root = Tk()
  app = App(root)
  root.mainloop()

@amauryfa
Copy link
Member

I found that the huge font in menus is due to an error in the call to
SystemParametersInfo.
Digging more, vc2008 defines WINVER=0x0600, which corresponds to Windows
Vista, and is too high for Windows XP: this value activates the
definition of extra fields in the NONCLIENTMETRICS structure, and
SystemParametersInfo on Windows XP will not accept a sizeof() greater
than expected.

I recompiled tk, adding WINVER=0x500 to the command line:
nmake /f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
And the menu is correctly displayed.
I suggest to add this to the build_tkinter script.

@tiran
Copy link
Member

tiran commented Dec 18, 2007

Amaury Forgeot d'Arc wrote:

I found that the huge font in menus is due to an error in the call to
SystemParametersInfo.
Digging more, vc2008 defines WINVER=0x0600, which corresponds to Windows
Vista, and is too high for Windows XP: this value activates the
definition of extra fields in the NONCLIENTMETRICS structure, and
SystemParametersInfo on Windows XP will not accept a sizeof() greater
than expected.

Wow, you are a genius! :)

I recompiled tk, adding WINVER=0x500 to the command line:
nmake /f makefile.vc COMPILERFLAGS=-DWINVER=0x0500
And the menu is correctly displayed.
I suggest to add this to the build_tkinter script.

Is 0x0500 fine for Windows 2000? Should we add WINVER=0x0500 to the
Python project files, too?

Christian

@tiran
Copy link
Member

tiran commented Dec 18, 2007

Christian Heimes wrote:

Is 0x0500 fine for Windows 2000? Should we add WINVER=0x0500 to the
Python project files, too?

http://msdn2.microsoft.com/en-us/library/aa383745.aspx

Minimum system required Minimum value for _WIN32_WINNT and WINVER
Windows Server 2008 0x0600
Windows Vista 0x0600
Windows Server 2003 SP1, Windows XP SP2 0x0502
Windows Server 2003, Windows XP 0x0501
Windows 2000 0x0500

0x0500 is fine for Windows 2000.

Should we add something like this to PC/pyconfig.h to ensure that our
build uses only Win2k compatible features and that the user is using at
least 2k to compile Python?

#ifdef WINVER
#  if WINVER < 0x0400
#    error "Windows 2000 or newer is required"
#  endif
#  define WINVER 0x0500
#  define _WIN32_WINNT 0x0500
#endif

Christian

@amauryfa
Copy link
Member

I don't think this check is necessary.

Some users may want to target specific windows versions, and compile
their own modules with a higher WINVER.
OTOH, python.org should compile with WINVER=0x0500, so that distributed
binaries can run on most win32 platforms.

@kbkaiser
Copy link
Contributor

Assigning to tiran since I'm not building Python on XP.
Changing to Tkinter, also. Is the file open bug fixed
also by the suggested change?

@kbkaiser kbkaiser assigned tiran and unassigned kbkaiser Dec 28, 2007
@tiran tiran closed this as completed Jan 5, 2008
@ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic-tkinter type-bug An unexpected behavior, bug, or error
Projects
None yet
Development

No branches or pull requests

3 participants