tcl /tk on cygwin + mouse wheel event

Mathieu Malaterre mmalater@nycap.rr.com
Mon Feb 9 01:55:00 GMT 2004


Alejandro,

	[Please CC as I am not on the cygwin ML, thank you]

	I am not sure I understand your explanation about python seg faulting. 
I did read the file:

/usr/share/doc/usr/share/doc/Cygwin/python-2.3.3.README on why you

But this is still not clear to me, why a wheel event is so complicated 
compare to a Button-1, Button-2 ...

BTW I don't understand why there is a difference in:
1. Starting wish, and then typing code
	% proc foo { args } { puts "foo" }
	% bind . "<MouseWheel>" foo

2. Writing a file contaning the same Tcl/tk code and starting is as:
	$wish wheel.tcl

The solution n°1 works on my system, the solution n°2 doesn't. When 
'wish' is started without argument does it loads some package I am not 
aware of ?

Your help is *greatly* appreciate,
Mathieu

Mathieu Malaterre wrote:

> Alejandro,
> 
>     I try something else:
> 
> #---- tcl program starts here
> % proc foo { args } { puts "foo" }
> % bind . "<Button-1>" foo
> #----
> 
> This gives me an Error: unknown option "-state". Here is the log file
> 
> unknown option "-state"
> unknown option "-state"
>     while executing
> "$w cget -state"
>     (procedure "tk::ButtonEnter" line 3)
>     invoked from within
> "tk::ButtonEnter .
> "
>     (command bound to event)
> 
> 
> I try searching for this on the internet and it appears as a tcl/tk 
> mismatch version. As I said before I completely remove the c:\cygwin 
> directory and reinstall the tcltk package.
> 
> Comments/suggestions *really* welcome
> 
> Thanks a bunch
> Mathieu
> 
> 
> 
> 
> Mathieu Malaterre wrote:
> 
>> Alejandro,
>>
>>     A few more questions. I browse through the python/lib-tk directory 
>> and i found that:
>> ...
>> if sys.plateform == "win32":
>> ...
>>
>> But on a cygwin system sys.plateform return "cygwin". Is this a 
>> mistake ? what does sys.plateform return on your system ?
>>
>> BTW what does tcl_platform(platform) return on your sytem ?
>>
>> Mathieu
>>
>> Mathieu Malaterre wrote:
>>
>>> Alejandro,
>>>
>>>     [Please CC as I am not on the list]
>>>
>>>     Your suggestion did get me a little further :) Now the python 
>>> script output 'foo' but I still get a seg fault (*). On the other 
>>> hand the tcl script didn't change, I still don't get anything. *But* 
>>> if I start startxwin.sh and then start:
>>>
>>> $ wish wheel.tcl
>>>
>>> then it works fine. The problem is that you told me it is 'Cygwin's
>>> Tcl/Tk is in reality a set of true *native* win32 binaries'. So why do I
>>> need to start X11 ?
>>>
>>> BTW I found somebody else having difficulties with python:
>>> <MouseWheel> causes crash on Windows2000
>>> https://sourceforge.net/tracker/?func=detail&atid=105470&aid=673115&group_id=5470 
>>>
>>> http://mail.python.org/pipermail/python-bugs-list/2003-January/015756.html 
>>>
>>>
>>> Thanks
>>> Mathieu
>>>
>>> (*)
>>> $ gdb python
>>> GNU gdb 2003-09-20-cvs (cygwin-special)
>>> Copyright 2003 Free Software Foundation, Inc.
>>> GDB is free software, covered by the GNU General Public License, and 
>>> you are
>>> welcome to change it and/or distribute copies of it under certain
>>> conditions.
>>> Type "show copying" to see the conditions.
>>> There is absolutely no warranty for GDB.  Type "show warranty" for 
>>> details.
>>> This GDB was configured as "i686-pc-cygwin"...(no debugging symbols
>>> found)...
>>> (gdb) r wheel.py
>>> Starting program: /usr/bin/python.exe wheel.py
>>>
>>> Program received signal SIGSEGV, Segmentation fault.
>>> 0x00b93d59 in tcl84!Tcl_FindExecutable ()
>>> (gdb) bt
>>> #0  0x00b93d59 in tcl84!Tcl_FindExecutable ()
>>> #1  0x00b9289d in tcl84!Tcl_ExternalToUtfDString ()
>>> #2  0x00c23344 in tk84!TkpGetString ()
>>> #3  0x00c3a0c6 in tk84!TkBindDeadWindow ()
>>> #4  0x00c3973d in tk84!Tk_BindEvent ()
>>> #5  0x00c5e33c in tk84!TkBindEventProc ()
>>> #6  0x00c6b6ad in tk84!Tk_HandleEvent ()
>>> #7  0x00c6bdb5 in tk84!TkQueueEventForAllChildren ()
>>> #8  0x00bbd385 in tcl84!Tcl_ServiceEvent ()
>>> #9  0x00bbd666 in tcl84!Tcl_DoOneEvent ()
>>> #10 0x6b384a12 in tkinter!init_tkinter () from
>>> /usr/lib/python2.3/lib-dynload/_tkinter.dll
>>> #11 0x6b274bba in libpython2!PyCFunction_Call () from
>>> /usr/bin/libpython2.3.dll
>>> #12 0x6b2ae23e in libpython2!PyEval_GetFuncDesc () from
>>> /usr/bin/libpython2.3.dll
>>> #13 0x0a06952c in ?? ()
>>>
>>>
>>>
>>>
>>>
>>> Mathieu Malaterre wrote:
>>>
>>>> Hello,
>>>>     I am having some issues with mouse wheel on a cygwin system. 
>>>> Could any one comment on this ?
>>>>
>>>> None of these scripts work:
>>>> wish
>>>> #---- tcl program starts here
>>>> % proc foo { args } { puts "foo" }
>>>> % bind . "<MouseWheel>" foo
>>>> #----
>>>>
>>>> python
>>>> #---- python program starts here
>>>> def foo(event): print "foo"
>>>> import Tkinter
>>>> win = Tkinter.Tk()
>>>> win.bind("<MouseWheel>", foo)
>>>> win.mainloop()
>>>> #----
>>>>
>>>>
>>>> Is there something I should know to use catch a mouse wheel event in 
>>>> tk on a cygwin system. I also tried the 'unix' fashion that is say 
>>>> binding the Button-4 and Button-5 but still I get no result at all.
>>>>
>>>> Comments/suggestions really welcome.
>>>> Thanks a bunch,
>>>> Mathieu
>>>> Ps: by the way if you think this is more of a tcl/tk problem just 
>>>> let me know.
>>>>
>>>
>>>
>>>
>>>
>>
>>
> 
> 


--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/



More information about the Cygwin mailing list