Danny,
You are right.
Thanks for your great patience and kindness.
Shi
On 11/7/05, Danny Yoo <[EMAIL PROTECTED]> wrote:
>
>
> > it works now.
>
> Hi Shi Mu,
>
> Can you describe how you fixed it? The only diff between the two programs
> that I see is that you repositioned the setting of the frame
> it works now.
Hi Shi Mu,
Can you describe how you fixed it? The only diff between the two programs
that I see is that you repositioned the setting of the frame variable.
#
mumak:~ dyoo$ diff t1.txt t2.txt
6c6
<
---
> frame = c
16c16
< frame = c
---
>
##
On Sun, 6 Nov 2005, Shi Mu wrote:
> frame = c needs to be put before the click function or the lines can
> not be drawn.
Not at all. I have everything after the click function and it works.
This is my version (includes a small addition):
def click(event):
global lastX, lastY
frame = c needs to be put before the click function or the lines can
not be drawn.
On 11/6/05, Chris F.A. Johnson <[EMAIL PROTECTED]> wrote:
> On Sun, 6 Nov 2005, Shi Mu wrote:
>
> > based on the following rewritten code, why the lines still can not be
> > drawn? (there is no error report and the
On Sun, 6 Nov 2005, Shi Mu wrote:
> based on the following rewritten code, why the lines still can not be
> drawn? (there is no error report and the canvas appears).
It works for me.
> from Tkinter import *
>
> root = Tk()
>
> c = Canvas(root, bg='#0e2e0e', height=500, width=1000)
>
> last
it works now.
from Tkinter import *
root = Tk()
c = Canvas(root, bg='#0e2e0e', height=500, width=1000)
frame = c
lastX=""
lastY=""
def click(event):
global lastX, lastY
if lastX != "":
c.create_line(lastX,lastY,event.x,event.y,fill="white")
lastX = event.x
lastY = event.y
c.bind('
based on the following rewritten code, why the lines still can not be
drawn? (there is no error report and the canvas appears).
from Tkinter import *
root = Tk()
c = Canvas(root, bg='#0e2e0e', height=500, width=1000)
lastX=""
lastY=""
def click(event):
global lastX, lastY
if lastX != "":
Hi Shi Mu,
Let's look at click():
##
def click(event):
print event.x, event.y
m1=event.x
n1=event.y
##
By default, variable names in functions are local. Do you know about
local vs global variables? The assignments to m1 and n1 won't
I tried to write the follwoing code to draw lines on the anvas based
on the clicked points but retur the message:
>>> Traceback (most recent call last):
File "C:\Python23\lib\site-packages\Pythonwin\pywin\framework\scriptutils.py",
line 310, in RunScript
exec codeObject in __main__.__dict__