943,027 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 1048
  • Python RSS
Jul 30th, 2008
0

issue with Tkinter canvas widget

Expand Post »
Hello everybody,

I've a somewhat odd issue displaying a .png image onto a Tkinter canvas.
The image is surrounded by a grey frame.
Here below an excerpt of the relevant code and by the way I'm running under windows xp.
The same thing happens with the menu of the gui, it stays grey whatever colour I set.
Any suggestion about this issue?

python Syntax (Toggle Plain Text)
  1. self.frameCanvas = Frame(master, bg="white", bd=0, relief=FLAT)
  2. self.frameCanvas.grid(column=1, row=0, rowspan=2, sticky=NE, padx=10, pady=5)
  3. #
  4. self.logo = Canvas(self.frameCanvas, width=70, height=70, bg="white", bd=0)
  5. self.logo.create_image(36, 36, image=self.Logo_TCTK)
  6. self.logo.grid()
  7. self.logo.image = self.Logo_TCTK

Thank you all
Attached Thumbnails
Click image for larger version

Name:	canvas.JPG
Views:	38
Size:	6.2 KB
ID:	6817  
Reputation Points: 10
Solved Threads: 2
Light Poster
TheOneElectroni is offline Offline
27 posts
since Jun 2008
Aug 3rd, 2008
0

Re: issue with Tkinter canvas widget

You might have to give us some more of your code. Don't be bashful!
Reputation Points: 625
Solved Threads: 211
Posting Virtuoso
Ene Uran is offline Offline
1,704 posts
since Aug 2005
Aug 4th, 2008
0

Re: issue with Tkinter canvas widget

I can indeed give you the full code of the app infrastructure which is the one creating the gui's aspect and common widgets. This part then call the various modules which I don't include here as I don't think they're useful to solve the problem.
Be warned that the code is rude and not at all smooth and clean

Thanks to all again.

Gab
Attached Files
File Type: txt P_list.txt (13.2 KB, 18 views)
Reputation Points: 10
Solved Threads: 2
Light Poster
TheOneElectroni is offline Offline
27 posts
since Jun 2008
Aug 4th, 2008
2

Re: issue with Tkinter canvas widget

Reputation Points: 927
Solved Threads: 666
Posting Maven
Gribouillis is online now Online
2,655 posts
since Jul 2008
Aug 4th, 2008
0

Re: issue with Tkinter canvas widget

that's it!
Thank you so much!

By the way, any advice to change the default menu grey colour? Just setting the bg option doesn't work. Somewhere I read it's a Tkinter bug.
Any idea?

Gab
Last edited by TheOneElectroni; Aug 4th, 2008 at 8:01 am. Reason: missing a question
Reputation Points: 10
Solved Threads: 2
Light Poster
TheOneElectroni is offline Offline
27 posts
since Jun 2008
Aug 4th, 2008
0

Re: issue with Tkinter canvas widget

google is your friend !
I post the solution here, for future reference:

set highlightthickness to 0 (zero)
Reputation Points: 927
Solved Threads: 666
Posting Maven
Gribouillis is online now Online
2,655 posts
since Jul 2008
Aug 4th, 2008
0

Re: issue with Tkinter canvas widget

That works fine indeed on the canvas widget.
For the menu it's not a valid option however.
I tried and googled some time ago and found only one reference stating that the bg setting in the menu widget it's broken.
That's why I was wondering if someone of you already faced such a problem.
Reputation Points: 10
Solved Threads: 2
Light Poster
TheOneElectroni is offline Offline
27 posts
since Jun 2008

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: Reading from DOS
Next Thread in Python Forum Timeline: 'global name 'handle_input' is not defined', Yes it is!





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC