I've just switched to Python 2.3.2 and have encountered a problem that
causes a program to crash. The program was working with Python 2.2. The code
below will illustrate the problem. A listbox is created and the mouse
wheel is used to scroll the entries. The program crashes as soon as the
mouse wheel is moved. The program appears to work OK otherwise. The problem
occurs when the program is run within the IDE or from a DOS prompt. I'm
using ActivePython 2.3.2 on Win98SE. Any suggestions?
Thanks,
Gary Richardson
----------------------------------------------------------------------
from Tkinter import *
class MakeListBox:
def __init__(self, parent ):
self.lst = Listbox(parent, width=12, bg='lightblue')
self.lst.pack(s ide=LEFT, anchor=N, expand=NO)
self.lst.bind(' <ButtonPress-1>', self._onMouseBu tton)
self.scroll = Scrollbar(paren t, command=self.ls t.yview)
self.lst.config ure(yscrollcomm and=self.scroll .set)
self.scroll.pac k(side=LEFT, fill=Y)
parent.bind('<M ouseWheel>', self._onMouseWh eel)
for k in range(30):
self.lst.insert (END, str(k))
def _onMouseButton( self, event):
print self.lst.neares t(event.y)
def _onMouseWheel(s elf, event):
print event
root = Tk()
MakeListBox(roo t )
root.mainloop() 3 2430
"Gary Richardson" <ga***@fidalgo. net> wrote in message news:<vq******* *****@corp.supe rnews.com>... I've just switched to Python 2.3.2 and have encountered a problem that causes a program to crash. The program was working with Python 2.2. The code below will illustrate the problem. A listbox is created and the mouse wheel is used to scroll the entries. The program crashes as soon as the mouse wheel is moved. The program appears to work OK otherwise. The problem occurs when the program is run within the IDE or from a DOS prompt. I'm using ActivePython 2.3.2 on Win98SE. Any suggestions?
Thanks, Gary Richardson ---------------------------------------------------------------------- from Tkinter import *
class MakeListBox: def __init__(self, parent ): self.lst = Listbox(parent, width=12, bg='lightblue') self.lst.pack(s ide=LEFT, anchor=N, expand=NO) self.lst.bind(' <ButtonPress-1>', self._onMouseBu tton) self.scroll = Scrollbar(paren t, command=self.ls t.yview) self.lst.config ure(yscrollcomm and=self.scroll .set) self.scroll.pac k(side=LEFT, fill=Y) parent.bind('<M ouseWheel>', self._onMouseWh eel) for k in range(30): self.lst.insert (END, str(k))
def _onMouseButton( self, event): print self.lst.neares t(event.y)
def _onMouseWheel(s elf, event): print event
root = Tk() MakeListBox(roo t ) root.mainloop()
I tried your example under XP-HE and Python 2.2.2 and got
the same result.
What can't understand, I have an application with the same
MousWheel-event for three lisboxes and it worked always fine.
But now I tried it to see the difference to your program and
it crashed the same way.
So for me it looks as if this is not a problem of Tkinter
or python version. It seems that something has changend concerning
the wheelmouse-driver.
Would be interested in getting some responses.
Regards
Peter
"Gary Richardson" <ga***@fidalgo. net> I've just switched to Python 2.3.2 and have encountered a problem that causes a program to crash. The program was working with Python 2.2. The
code below will illustrate the problem. A listbox is created and the mouse wheel is used to scroll the entries. The program crashes as soon as the mouse wheel is moved. The program appears to work OK otherwise. The
problem occurs when the program is run within the IDE or from a DOS prompt. I'm using ActivePython 2.3.2 on Win98SE. Any suggestions?
Seems to be nothing special wuth 2.3. It happens after a few wheel turns in
Python 2.2.2/Win2000 as well.
Minimal test program:
----------------------------------
from Tkinter import *
def _onMouseWheel(e vent):
print event
root = Tk()
root.bind('<Mou seWheel>',_onMo useWheel)
root.mainloop()
---------------------------
MichaelP
BTW the program stops without an errortrace
but with Return code=-1073741819 and this only
if started from an editor.
Running in a DOS-Box is finishes without any
response and returns to the DOS-Prompt.
Regards
Peter This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Thomas |
last post by:
Python/Tk (Tkinter) does not work under Fedora Core 1; the problem
seems to be, that the Python RPM package uses a Python which was
compiled with the UCS4 option, whereas Tcl/Tk uses UCS2.
My solution: I got the Python 2.2 (FC1 uses Python 2.2) and Tkinter
RPM packages from python.org and updated Python and Tkinter with
those packages (rpm -U ...). (Luckily, the version numbers of the
python.org RPMs are higher than those from the FC1...
|
by: Logan |
last post by:
Several people asked me for the following HOWTO, so I decided to
post it here (though it is still very 'alpha' and might contain
many (?) mistakes; didn't test what I wrote, but wrote it - more
or less - during my own installation of Python 2.3 on Fedora Core 1
Linux for a friend of mine).
Anyway, HTH, L.
|
by: Mickel Grönroos |
last post by:
Hi everybody,
I'm using QuickTimeTcl (3.1) to be able to play movie files in my Tkinter
application (Python 2.3.2) on Windows 2000. I was planning to write a
simple wrapper class, QuickTimeMovie, that would wrap up the QuickTimeTcl
Tcl extension as a Python class. All seems to work pretty fine until the
Tkinter application is closed, when the Python interpreter crashes with an
error of the following kind:
The instruction at...
|
by: Jeffrey Barish |
last post by:
Since upgrading to python 2.4 yesterday, I am no longer able to use
Tkinter. From http://www.python.org/moin/TkInter I learned that I need
to edit Modules/Setup to include Tkinter during the make. However, it
isn't clear to me what modifications to make. I am supposed to specify
directories in which needed files can be found. I found the Tcl/Tk
libraries in /usr/local/lib/python2.4/lib-tk, but I can't find the
Tcl/Tk headers. The...
|
by: Ron Provost |
last post by:
Hello,
I'm using python 2.4.2 on Win XP Pro. I'm trying to understand a behavior
I'm seeing in some Tkinter code I have. I've reduced my question to a small
piece of code:
#####BEGIN CODE
#################
import Tkinter as Tk
| |
by: Kevin Walzer |
last post by:
From the introduction to PyObjC, the Python-Objective-C bridge on Mac OS X:
"As described in Objective-C for PyObjC users the creation of
Objective-C objects is a two-stage process. To initialize objects, first
call a class method to allocate the memory (typically alloc), and then
call an initializer (typically starts with init). Some classes have
class methods which perform this behind the scenes, especially classes
that create cached,...
|
by: karthikbalaguru |
last post by:
Hi,
One of my python program needs tkinter to be installed to run
successfully.
I am using Redhat 9.0 and hence tried installing by copying the
tkinter-2.2.2-36.i386.rpm
alone from the CD 3 to my pc. But, it is not getting installed and is
failing by throwing
the below errors. Should i need to configure / install any specific
files for resolving this issue ?
|
by: njwilson23 |
last post by:
I'm having trouble with tkinter on a new installation of Python (2.6),
built with the framework option from source that was downloaded from
python.org. I'm running OS 10.4 on a PowerPC G4.
The problem first arose when I tried to run matplotlib - it couldn't
find tcl/tk because it was searching for 8.5, and I had 8.4. I found
and built tcl/tk 8.5, which led to a new error, reproduced below:
Traceback (most recent call last):
File...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look !
Part I. Meaning of...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it.
First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
|
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth.
The Art of Business Website Design
Your website is...
| |
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
|
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
|
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 then checking html paragraph one by one.
At the time of converting from word file to html my equations which are in the word document file was convert into image.
Globals.ThisAddIn.Application.ActiveDocument.Select();...
|
by: 6302768590 |
last post by:
Hai team
i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
|
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
|
by: bsmnconsultancy |
last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...
| |