Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4320832
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T08:40:36+00:00 2026-05-21T08:40:36+00:00

Still writing a game. This error’s a little different, though. I get a trace

  • 0

Still writing a game. This error’s a little different, though. I get a trace back like this…

Exception in Tkinter callback
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/tkinter/__init__.py",
line 1399, in __call__
return self.func(*args)
File "/Users/bluedragon1223/Desktop/Djambi0-2.py", line 68, in _newSpaceChosen
pieceID = event.widget.find_withtag(currentCommand)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/tkinte/__init__.py",
line2199, in find_withtag
return self.find('withtag', tagOrId)
File "/Library/Frameworks/Python.framework/Versions/3.1/lib/python3.1/tkinter/__init__.py",
line 2173, in find
self.tk.call((self._w, 'find') + args)) or ()
_tkinter.TclError: wrong # args: should be ".23215664 find withtag tagOrId"

I mean, I thought the code innocuous enough.

I have global variables currentCommand = None and (CurX, CurY) = (0,0) and (ToX, ToY) = (0,0) to start with, if that has something to do with it, but the main problem is my events.

There are two:

def _newSpaceChosen(event):
print(event.widget.find_withtag('rN')) #Used to check if I had used find_withtag correctly
pieceID = event.widget.find_withtag(currentCommand) #This is the problem source
[CurX, CurY] = event.widget.coords(pieceID[1])
print(CurX, CurY)
[MetaToX, MetaToY] = _point2square(event.x, event.y)
print(event.x, event.y)
print(MetaToX, MetaToY)
[ToX, ToY] = _square2point(MetaToX, MetaToY)
print(ToX, ToY)
event.widget.move(pieceID, ToX - CurX, ToY - CurY)

def _onPieceClick(event):
stuffTags = event.widget.gettags(event.widget.find_closest(event.x, event.y))
try:
    event.widget.delete(event.widget.find_withtag('bbox'))
except:
    pass
bboxULX = (event.x // 90 + 1) * 90
bboxULY = (event.y // 90 + 1) * 90 
bboxLRX = (event.x // 90 + 1) * 90 - 90
bboxLRY = (event.y // 90 + 1) * 90 - 90
event.widget.create_rectangle(bboxULX,bboxULY,bboxLRX,bboxLRY, width=3,   
outline='yellow',tag='bbox')
currentCommand = stuffTags[0]
print(currentCommand)`

The idea was to store the game piece tag in currentCommand, and then use that value to control that specific piece until the piece was moved with bindings like this:

canvas.bind('<1>', _newSpaceChosen)

in the def __init__(self, mainWin): of a class Board(Canvas):
Each piece has it’s own tag_bind(#piece-var, '<1>', _onPieceClick)

My hypothesis is that currentCommand is not receiving a value soon enough.
What do you guys think causes this trace?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T08:40:37+00:00Added an answer on May 21, 2026 at 8:40 am

    Your hypothesis is almost certainly correct. You can easily test this hypothesis by printing out the value before calling find_withtag.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

So, I'm writing a game engine. I have a little example (see http://qrcode.kaywa.com/img.php?s=8&d=http://rokonandroid.com/rd.apk ),
I am currently writing a resource manager for my game. This is basically a
I am getting comfortable writing regular queries in SPARQL, but I'm still having trouble
I'm writing a game development IDE that creates and compiles .NET projects (which I've
I'm writing an iPhone game and I am trying to write some requirements documents.
I am writing a video game, Humm and Strumm , which requires a network
I am writing a game in which I want to kick off an event
I'm not actually writing this software myself, but it occurred to me that I
I'm writing an online game which allows a user to progress from one puzzle
I'm writing a Mahjong Game in C# (the Chinese traditional game, not the solitaire

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.