Newbie question about method options

Scott David Daniels Scott.Daniels at Acm.Org
Wed Jun 17 09:41:58 EDT 2009


Dave Angel wrote:
> python-newbie113 wrote:
>> I am new to python and have a question about using methods.
>>
>> Here is the link i am looking at:
>> http://www.pythonware.com/library/tkinter/introduction/x2102-methods.htm
>>
>> If i use, create_arc(bbox, options) => id
>> what is id? and how do i find the parameter list representing options?
>
> Search for create_arc, and you'll find
> http://www.pythonware.com/library/tkinter/introduction/x2861-options.htm
>   as one of the links.  The link "Back" will get you to:
> http://www.pythonware.com/library/tkinter/introduction/canvas-arc.htm
> 
> which is the beginning of Chapter 14, "The Canvas Arc Item"
> 
> As for 'id' I have no idea, but if you read further, you'll probably 
> find out.  The fact that all of these methods return one indicates it's 
> some sort of object reference for those widgets.

Everything drawn on a canvas has an 'id' which just happens to be an
integer (treat it as a magic cookie).  You specify that id to the
canvas to talk about that particular element, but you often group
canvas elements together via "tags", and use the same canvas operations
on a tag so that you can do your operation to everything with that tag.
operations include such things as color manipulation, delete, clone,
and move.

--Scott David Daniels
Scott.Daniels at Acm.Org



More information about the Python-list mailing list