How to read image data into Tkinter Canvas?

2012-03-03 Thread Frederic Rentsch
Hi, Familiarizing myself with Tkinter I'm stuck trying to fill a Canvas with an image. I believe the class I need is PhotoImage rather than BitmapImage. But I have no luck with either. The PhotoImage doc lists available handlers for writing GIF and PPM files. It doesn't say anything about r

Re: Tkinter canvas drag/drop obstacle

2008-06-22 Thread Simon Forman
On Jun 22, 7:41 pm, Peter Pearson <[EMAIL PROTECTED]> wrote: > On Fri, 20 Jun 2008 13:41:35 -0300, Guilherme Polo <[EMAIL PROTECTED]> wrote: > > On Fri, Jun 20, 2008 at 1:11 PM, Peter Pearson <[EMAIL PROTECTED]> wrote: > >> Tkinter makes it very easy to drag jpeg images around on a > >> canvas, but

Re: Tkinter canvas drag/drop obstacle

2008-06-22 Thread Peter Pearson
On Fri, 20 Jun 2008 13:41:35 -0300, Guilherme Polo <[EMAIL PROTECTED]> wrote: > On Fri, Jun 20, 2008 at 1:11 PM, Peter Pearson <[EMAIL PROTECTED]> wrote: >> Tkinter makes it very easy to drag jpeg images around on a >> canvas, but I would like to have a "target" change color when >> the cursor drag

Re: Tkinter canvas drag/drop obstacle

2008-06-20 Thread Matimus
On Jun 20, 11:10 am, Matimus <[EMAIL PROTECTED]> wrote: > On Jun 20, 9:11 am, Peter Pearson <[EMAIL PROTECTED]> wrote: > > > Tkinter makes it very easy to drag jpeg images around on a > > canvas, but I would like to have a "target" change color when > > the cursor dragging an image passes over it.

Re: Tkinter canvas drag/drop obstacle

2008-06-20 Thread Matimus
On Jun 20, 9:11 am, Peter Pearson <[EMAIL PROTECTED]> wrote: > Tkinter makes it very easy to drag jpeg images around on a > canvas, but I would like to have a "target" change color when > the cursor dragging an image passes over it.  I seem to be > blocked by the fact that the callbacks that might

Re: Tkinter canvas drag/drop obstacle

2008-06-20 Thread Guilherme Polo
On Fri, Jun 20, 2008 at 1:11 PM, Peter Pearson <[EMAIL PROTECTED]> wrote: > Tkinter makes it very easy to drag jpeg images around on a > canvas, but I would like to have a "target" change color when > the cursor dragging an image passes over it. I seem to be > blocked by the fact that the callback

Tkinter canvas drag/drop obstacle

2008-06-20 Thread Peter Pearson
Tkinter makes it very easy to drag jpeg images around on a canvas, but I would like to have a "target" change color when the cursor dragging an image passes over it. I seem to be blocked by the fact that the callbacks that might tell the target that the mouse has entered it (, , even ) aren't call

Re: tkinter, canvas, get color of image?

2008-04-18 Thread skanemupp
On 16 Apr, 00:46, Bryan Oakley <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On 13 Apr, 19:19, Bryan Oakley <[EMAIL PROTECTED]> wrote: > >> [EMAIL PROTECTED] wrote: > >>> mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') > >>> w.create_image(10, 10, image = mapq, anchor

Re: tkinter, canvas, get color of image?

2008-04-15 Thread Bryan Oakley
[EMAIL PROTECTED] wrote: > On 13 Apr, 19:19, Bryan Oakley <[EMAIL PROTECTED]> wrote: >> [EMAIL PROTECTED] wrote: >>> mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') >>> w.create_image(10, 10, image = mapq, anchor = NW) >>> after doing this is there any possibility of getting the

Re: tkinter, canvas, get color of image?

2008-04-15 Thread skanemupp
On 13 Apr, 19:19, Bryan Oakley <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') > > w.create_image(10, 10, image = mapq, anchor = NW) > > > after doing this is there any possibility of getting the > > characteristics of the

Re: tkinter, canvas, get color of image?

2008-04-13 Thread Bryan Oakley
[EMAIL PROTECTED] wrote: > mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') > w.create_image(10, 10, image = mapq, anchor = NW) > > after doing this is there any possibility of getting the > characteristics of the GIF-picture(or bitmap if i use that)? > > it would be very helpfu

tkinter, canvas, get color of image?

2008-04-13 Thread skanemupp
mapq = PhotoImage(file = 'C:\Users\saftarn\Desktop\elmapovic.gif') w.create_image(10, 10, image = mapq, anchor = NW) after doing this is there any possibility of getting the characteristics of the GIF-picture(or bitmap if i use that)? it would be very helpfull if i for example could do something

Re: Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-03 Thread frikk
On Aug 3, 2:26 am, "Hendrik van Rooyen" <[EMAIL PROTECTED]> wrote: > "frikk" wrote: > > 1. ... Am I somehow leaving > > objects laying around that aren't being deleted? Is create_rectangle > > not the appropriate function to use?) > > Try calling the canvas's delete method with the old rect

Re: Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-03 Thread Hendrik van Rooyen
"frikk" wrote: > 1. ... Am I somehow leaving > objects laying around that aren't being deleted? Is create_rectangle > not the appropriate function to use?) Try calling the canvas's delete method with the old rectangle before making a new one. - Hendrik -- http://mail.python.org/mailma

Re: Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-02 Thread Wojciech Muła
frikk wrote: > [...] > As you can see- I am doing nothing other than drawing a lot of > rectangles on the canvas. You aren't drawing, but **creating** rectangle objects, as a meth. name suggests. You find more info at tkinter.effbot.org. > [...] > > def clear_grid(): canv.delete(ALL)

Memory Leak with Tkinter Canvas (Python 2.5 Win32)

2007-08-02 Thread frikk
Hey everyone. I have been working with python for a couple years now, but just recently built my first program with a GUI. I decided to start with Tkinter since it is included with the base package, although wxWindows will likely be my next choice. Tkinter seems to be pretty slow for my needs.

RE: tkinter canvas

2007-04-19 Thread Gigs_
I want to when create text box with objid = self.canvas.create_text(x, y, width=event.x-x, text='') how can i bind KeyPress to objid? I want that text appear on canvas as i write it. dont know do I need to use self.canvas.create_window, and put in that window Tkinter Text widget. Or I can do it

Re: tkinter canvas

2007-04-19 Thread kyosohma
On Apr 19, 7:24 am, Gigs_ <[EMAIL PROTECTED]> wrote: > [EMAIL PROTECTED] wrote: > > On Apr 18, 3:43 pm, Gigs_ <[EMAIL PROTECTED]> wrote: > >> how to write text on canvas. i know that i need to use canvas.create_text, > >> but > >> how to write text than when i create_text? > >> or how to access ob

Re: tkinter canvas

2007-04-19 Thread Gigs_
[EMAIL PROTECTED] wrote: > On Apr 18, 3:43 pm, Gigs_ <[EMAIL PROTECTED]> wrote: >> how to write text on canvas. i know that i need to use canvas.create_text, >> but >> how to write text than when i create_text? >> or how to access object ID in canvas and change some options? >> >> thanks in advanc

Re: tkinter canvas

2007-04-18 Thread kyosohma
On Apr 18, 3:43 pm, Gigs_ <[EMAIL PROTECTED]> wrote: > how to write text on canvas. i know that i need to use canvas.create_text, but > how to write text than when i create_text? > or how to access object ID in canvas and change some options? > > thanks in advance! All you need to do is canvas.cre

tkinter canvas

2007-04-18 Thread Gigs_
how to write text on canvas. i know that i need to use canvas.create_text, but how to write text than when i create_text? or how to access object ID in canvas and change some options? thanks in advance! -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas

2007-04-06 Thread Gigs_
gigs wrote: > I have made drawing area and few butons. > How can I make when i click my fill button that later when i click on > oval oval gets filled with chousen color? when later click on my oval that is drawn in to change oval color, or to fill color in oval if click in oval with mouse -- ht

Re: tkinter canvas mvc

2007-04-06 Thread James Stroud
Gigs_ wrote: > Hi all! > > I have just finished my tkinter text editor, learning tkinter purpose. > > Now I want to learn canvas so I want to make my paint program, I think > that this will be the best to do over model-view-controler pattern which > I need to learn also. > > Is there any good

tkinter canvas mvc

2007-04-05 Thread Gigs_
Hi all! I have just finished my tkinter text editor, learning tkinter purpose. Now I want to learn canvas so I want to make my paint program, I think that this will be the best to do over model-view-controler pattern which I need to learn also. Is there any good tutorial for mvc in python or

tkinter canvas

2007-04-05 Thread gigs
I have made drawing area and few butons. How can I make when i click my fill button that later when i click on oval oval gets filled with chousen color? -- http://mail.python.org/mailman/listinfo/python-list

Make Tkinter canvas respond to MouseWheel event

2007-02-28 Thread WaterWalk
Hello. When I tried to make Tkinter canvas widget respond to MouseWheel event on Windows XP, I failed. The canvas just doesn't receive MouseWheel event. I used bind_all to find out which widget receives this event and the result showed that only the top Tk widget gets it. This is really ann

Print Tkinter canvas oject contents from Windows?

2006-07-08 Thread [EMAIL PROTECTED]
What is the best way to print a graphic image contained within the canvas oject in Tkinter ruinng under Windows (XP)? The only thing I found so far was the canvas postscript method...it there a more direct way? thanks -- http://mail.python.org/mailman/listinfo/python-list

Re: Tkinter canvas zooming (sortof)

2006-05-26 Thread Bob Greschke
"Bob Greschke" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] >I have a program that sucks in a list of equipment positions (Lats/Longs), >opens a Toplevel frame with a canvas set to, for example, 700x480 pixels, >and then does all of the calculations and plots the objects with 10-p

Tkinter canvas zooming (sortof)

2006-05-26 Thread Bob Greschke
I have a program that sucks in a list of equipment positions (Lats/Longs), opens a Toplevel frame with a canvas set to, for example, 700x480 pixels, and then does all of the calculations and plots the objects with 10-pixel wide ovals and rectangles. Now I want to zoom in (or out), but I don't w

Re: Tkinter Canvas Pre-Buffer

2006-05-05 Thread Fredrik Lundh
[EMAIL PROTECTED] wrote: > Is there a way that using Tkinter I can pre-render the canvas then draw > it on the screen? not really; the canvas is double-buffered, but it regenerates (portions of) the buffer when necessary. if you want to draw in a separate buffer, and use that when updating the w

Tkinter Canvas Pre-Buffer

2006-05-05 Thread [EMAIL PROTECTED]
Is there a way that using Tkinter I can pre-render the canvas then draw it on the screen? Thanks. -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas

2006-04-04 Thread John McMonagle
On Tue, 2006-04-04 at 16:42 -0700, fxe wrote: > Hi John , thanks a million for the info.Looking at your solution I am sure > this would work. After struggling with this for the past few hours I found > another way just before reading your post. Its as simple as : > > canvas.create_line(x1,y1,x2,y2

Re: tkinter canvas

2006-04-04 Thread fxe
gain, Tom -- View this message in context: http://www.nabble.com/tkinter-canvas-t1395807.html#a3755397 Sent from the Python - python-list forum at Nabble.com. -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas

2006-04-04 Thread John McMonagle
On Tue, 2006-04-04 at 14:47 -0700, fxe wrote: > Hi, > I am using tkinter and I have a canvas that with several rectangles drawn > on it. The rectangles need to have bindings to move and resize them. No > problem here, but I also need to display a grid on the same canvas, for > which I am using cr

tkinter canvas

2006-04-04 Thread fxe
to be able to move and resize . Is this doable or any suggestions on an alternative.Maybe another way to display my grid on top of the canvas? Tom -- View this message in context: http://www.nabble.com/tkinter-canvas-t1395807.html#a3753823 Sent from the Python - python-list forum at Nabble.com

Re: Tkinter canvas size determination

2006-02-24 Thread Dean Allen Provins
Martin: Martin Franklin wrote: > Dean Allen Provins wrote: > >> Cameron: >> >> Cameron Laird wrote: >> >>> In article <[EMAIL PROTECTED]>, >>> Dean Allen Provins <[EMAIL PROTECTED]> wrote: >>> I need to determine the size of a canvas while the process is running. Does anyone know of a

Re: Tkinter canvas size determination

2006-02-24 Thread Martin Franklin
Dean Allen Provins wrote: > Cameron: > > Cameron Laird wrote: >> In article <[EMAIL PROTECTED]>, >> Dean Allen Provins <[EMAIL PROTECTED]> wrote: >> >>> I need to determine the size of a canvas while the process is running. >>> Does anyone know of a technique that will let me do that? >>

Re: Tkinter canvas size determination

2006-02-24 Thread Dean Allen Provins
Cameron: Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Dean Allen Provins <[EMAIL PROTECTED]> wrote: > >>I need to determine the size of a canvas while the process is running. >>Does anyone know of a technique that will let me do that? > > . >

Re: Tkinter canvas size determination

2006-02-22 Thread Dean Allen Provins
Cameron Laird wrote: > In article <[EMAIL PROTECTED]>, > Dean Allen Provins <[EMAIL PROTECTED]> wrote: > >>I need to determine the size of a canvas while the process is running. >>Does anyone know of a technique that will let me do that? > > . > . >

Re: Tkinter canvas size determination

2006-02-22 Thread Cameron Laird
In article <[EMAIL PROTECTED]>, Dean Allen Provins <[EMAIL PROTECTED]> wrote: >I need to determine the size of a canvas while the process is running. >Does anyone know of a technique that will let me do that? . . . Does >>>

Tkinter canvas size determination

2006-02-22 Thread Dean Allen Provins
I need to determine the size of a canvas while the process is running. Does anyone know of a technique that will let me do that? Thanks, Dean -- http://mail.python.org/mailman/listinfo/python-list

Re: Prevent Tkinter Canvas from resizing

2006-01-20 Thread Fredrik Lundh
Eric Wong wrote: > Using Tkinter, I have a Canvas with vertical Scrollbar attached. At > runtime, I dynamically create Checkboxes on the Canvas, each one on a > different row. When I add a lot of Checkboxes, instead of the > scrollbar kicking in, the Canvas resizes and subsequently, my > Applica

Prevent Tkinter Canvas from resizing

2006-01-19 Thread Eric Wong
Using Tkinter, I have a Canvas with vertical Scrollbar attached. At runtime, I dynamically create Checkboxes on the Canvas, each one on a different row. When I add a lot of Checkboxes, instead of the scrollbar kicking in, the Canvas resizes and subsequently, my Application window resizes such tha

Re: tkinter canvas tag stuff

2005-12-20 Thread Tuvas
It's funny, I can put in more variables than needed, it doesn't even call the function, and yet, magically, the picture appears. Odd... Just wish I could solve the problem... -- http://mail.python.org/mailman/listinfo/python-list

Re: tkinter canvas tag stuff

2005-12-16 Thread James Stroud
Tuvas wrote: > I'm trying to display a picture on a Tkinter Canvas. It seems to work > fine the first time that it is displayed. However, subsequent times > running shows an error like this: > > TCLerror: Wrong # args: should be ".-1211472948 .-1211470996 addtag tag

Re: tkinter canvas tag stuff

2005-12-16 Thread James Stroud
Tuvas wrote: > I'm trying to display a picture on a Tkinter Canvas. It seems to work > fine the first time that it is displayed. However, subsequent times > running shows an error like this: > > TCLerror: Wrong # args: should be ".-1211472948 .-1211470996 addtag tag

tkinter canvas tag stuff

2005-12-16 Thread Tuvas
I'm trying to display a picture on a Tkinter Canvas. It seems to work fine the first time that it is displayed. However, subsequent times running shows an error like this: TCLerror: Wrong # args: should be ".-1211472948 .-1211470996 addtag tag searchCommand ?arg arg ...? My code works

x, y coordinates in Tkinter canvas

2005-11-11 Thread Shi Mu
got confused by x, y coordinates in Tkinter canvas. from left to right, does X increase? from top to bottom, does y increase? -- http://mail.python.org/mailman/listinfo/python-list

Re: x, y coordinates in Tkinter canvas

2005-11-11 Thread jepler
Let's find out! This program creates a series of rectangles, with the color going from black to nearly white. White corresponds to higher x and y coordinate values. So the answer to your question can be seen in the output of the program. import Tkinter c = Tkinter.Canvas(width=220, height=220)

Re: exporting from Tkinter Canvas object in PNG

2005-01-11 Thread harold fellermann
On 11.01.2005, at 19:14, Nicolas Pourcelot wrote: Hello, I'm new to this mailing list and quite to Pyhon too. I would like to know how to export the contain of the Canvas object (Tkinter) in a PNG file ? Thanks :) Nicolas Pourcelot -- http://mail.python.org/mailman/listinfo/python-list you can make

exporting from Tkinter Canvas object in PNG

2005-01-11 Thread Nicolas Pourcelot
Hello, I'm new to this mailing list and quite to Pyhon too. I would like to know how to export the contain of the Canvas object (Tkinter) in a PNG file ? Thanks :) Nicolas Pourcelot -- http://mail.python.org/mailman/listinfo/python-list