Bill Barksdale | 12 Sep 04:08 2005

(0,0) off the visible area of a Canvas

I am sure this must be a common question but I couldn't find anything 
about it.

When I run the following on my system, the first line appears cut off 
and the second line doesn't appear at all.  I believe this is because 
(0,0) is not part of the visible area of a canvas, and that it starts 
instead at (3,3) or thereabouts.  How can I fix this?

import Tkinter as TK
root = TK.Tk()
canv = TK.Canvas(root,width=100,height=100,bg='red')
canv.pack()
canv.create_line(0,100,100,0)
canv.create_line(0,0,0,100)

Thanks,
--Bill Barksdale
Michael Lange | 12 Sep 12:24 2005
Picon

Re: (0,0) off the visible area of a Canvas

On Sun, 11 Sep 2005 22:08:04 -0400
Bill Barksdale <bill <at> billbarksdale.com> wrote:

> I am sure this must be a common question but I couldn't find anything 
> about it.
> 
> When I run the following on my system, the first line appears cut off 
> and the second line doesn't appear at all.  I believe this is because 
> (0,0) is not part of the visible area of a canvas, and that it starts 
> instead at (3,3) or thereabouts.  How can I fix this?
> 
> import Tkinter as TK
> root = TK.Tk()
> canv = TK.Canvas(root,width=100,height=100,bg='red')
> canv.pack()
> canv.create_line(0,100,100,0)
> canv.create_line(0,0,0,100)
> 
Hi Bill,

I think the line is being hidden under the Canvases border, so you can try:

    canv.configure(bd=0, highlightthickness=0)

and if you need a decorative border pack the canvas into another Frame.

I hope this helps

Michael
(Continue reading)

Fredrik Lundh | 12 Sep 14:40 2005

Re: (0,0) off the visible area of a Canvas

Bill Barksdale wrote:

> I am sure this must be a common question but I couldn't find anything
> about it.
>
> When I run the following on my system, the first line appears cut off
> and the second line doesn't appear at all.  I believe this is because
> (0,0) is not part of the visible area of a canvas, and that it starts
> instead at (3,3) or thereabouts.  How can I fix this?
>
> import Tkinter as TK
> root = TK.Tk()
> canv = TK.Canvas(root,width=100,height=100,bg='red')
> canv.pack()
> canv.create_line(0,100,100,0)
> canv.create_line(0,0,0,100)

stock answer:

    by default, the coordinate system is aligned with the widget's upper
    left corner, which means that things you draw will be covered by the
    inner border.

    to fix this, you can either set the border width to zero, add scrollbars
    to the widget (this fixes the coordinate system), or explicitly reset the
    coordinate system:

    w.xview_moveto(0)
    w.yview_moveto(0)

(Continue reading)

Michael Lange | 12 Sep 19:03 2005
Picon

debian tkinter broken or tk problem (or what)?

Hello,

I noticed that for some reason some Tkinter apps I wrote and successfully
used for a while seem to be broken when run on my newly installed debian
system (python-2.3.5 / tk-8.4.9).
The problem I noticed arises when I run a subprocess with popen2.Popen4()
and catch the output with tk.createfilehandler() ; sometimes this works without
problems, but sometimes after a while the gui freezes and in the process list
I can see the subprocess as "zombie".
Normally I would suspect my code to be buggy, but like I said, the same scripts
run fine on mandrake (python-2.3.3 / tk-8.4.5).

I just wondered if anyone has a clue, may the reason be the debian build or the
tk version ?

Best regards

Michael
gilcneth@earthlink.net | 12 Sep 19:42 2005
Picon
Picon

Trouble installing PyBWidgets

Hello All:
 
I am having trouble getting the PyBWidgets plugged in correctly in a Windows XP environment.  It appears to be path-related, since the BWidget package can't be found.  The installation 'Read Me' indicates that I should 'package require'--what does this mean and how would I do this?
 
 
Thanking you in advance,
 
Chris Nethery
gilcneth <at> earthlink.net (new email address)
 

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Michael Lange | 12 Sep 21:04 2005
Picon

Re: Trouble installing PyBWidgets

On Mon, 12 Sep 2005 13:42:33 -0400
"gilcneth <at> earthlink.net" <gilcneth <at> earthlink.net> wrote:

> Hello All:
> 
> I am having trouble getting the PyBWidgets plugged in correctly in a Windows XP environment.  It appears to
be path-related, since the BWidget package can't be found.  The installation 'Read Me' indicates that I
should 'package require'--what does this mean and how would I do this?
> 
> 
Hi Chris,

"package require .." is something like the tcl equivalent to python's "import ...".
However, you shouldn't have to bother with this, it's something the python module should do for you.
Did you run the setup.py, and if yes, where did it install the BWidgets ?
On my linux box they're in /usr/share/pybwidget , I'm not sure about windows, but I think somewhere in
your Tcl folder should work.

Regards

Michael
Fredrik Lundh | 12 Sep 23:52 2005

ANN: WCK for Tkinter 1.1 alpha 2 (september 12, 2004)

The Widget Construction Kit (WCK) is an extension API that allows
you to implement custom widgets in pure Python.  The WCK can be
(and is being) used for everything from light-weight display widgets
to full-blown editor frameworks.

The Tkinter3000 implementation of the WCK supports all recent
versions of Python and Tk/Tkinter.

The 1.1 alpha 2 release adds improved controller support, resource
caching for pens, brushes, and fonts, and support for creating image
objects from data in strings.

Introduction:
    http://www.effbot.org/zone/wck-1.htm

Downloads:
    http://www.effbot.org/downloads#tkinter3000

Documentation:
    http://www.effbot.org/zone/wck.htm
    http://www.effbot.org/zone/wck-api.htm

enjoy /F 
gilcneth@earthlink.net | 13 Sep 09:40 2005
Picon
Picon

Re: Trouble installing PyBWidgets

Thank you, Michael, for your reply.
 
I have tried running setup.py and receive the following error:
 
>python setup.py
usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: setup.py --help [cmd1 cmd2 ...]
or: setup.py --help-commands
or: setup.py cmd --help
 
error: no commands supplied
 
I guess I need to provide some additional commands, but I am not sure which commands I should provide.
 
-- Chris
 
 
 

_______________________________________________
Tkinter-discuss mailing list
Tkinter-discuss <at> python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss
Fredrik Lundh | 13 Sep 11:48 2005

Re: Trouble installing PyBWidgets

gilcneth <at> earthlink.net wrote:

> I have tried running setup.py and receive the following error:

> usage: setup.py [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
> or: setup.py --help [cmd1 cmd2 ...]
> or: setup.py --help-commands
> or: setup.py cmd --help
>
> error: no commands supplied

> I guess I need to provide some additional commands,
> but I am not sure which commands I should provide.

hint:

python setup.py --help-commands

Standard commands:
  build            build everything needed to install
  build_py         "build" pure Python modules (copy to build directory)
  build_ext        build C/C++ extensions (compile/link to build directory)
  build_clib       build C/C++ libraries used by Python extensions
  build_scripts    "build" scripts (copy and fixup #! line)
  clean            clean up output of 'build' command
  install          install everything from build directory
  install_lib      install all Python modules (extensions and pure Python)
  install_headers  install C/C++ header files
  install_scripts  install scripts (Python or otherwise)
  install_data     install data files
  sdist            create a source distribution (tarball, zip file, etc.)
  register         register the distribution with the Python package index
  bdist            create a built (binary) distribution
  bdist_dumb       create a "dumb" built distribution
  bdist_rpm        create an RPM distribution
  bdist_wininst    create an executable installer for MS Windows

given your subject line, "install" might be what you want.

reading the generic installation guide can also be a good idea:

    http://docs.python.org/inst/inst.html

</F> 
Michael Lange | 13 Sep 13:22 2005
Picon

Re: debian tkinter broken or tk problem (or what)?

On Mon, 12 Sep 2005 19:03:05 +0200
Michael Lange <klappnase <at> web.de> wrote:

> I noticed that for some reason some Tkinter apps I wrote and successfully
> used for a while seem to be broken when run on my newly installed debian
> system (python-2.3.5 / tk-8.4.9).
> The problem I noticed arises when I run a subprocess with popen2.Popen4()
> and catch the output with tk.createfilehandler() ; sometimes this works without
> problems, but sometimes after a while the gui freezes and in the process list
> I can see the subprocess as "zombie".
> Normally I would suspect my code to be buggy, but like I said, the same scripts
> run fine on mandrake (python-2.3.3 / tk-8.4.5).
> 
> I just wondered if anyone has a clue, may the reason be the debian build or the
> tk version ?
> 

Hello again,

another thing I noticed, on debian (unlike mandrake) tcl is build with thread support;
does anyone know if it is likely that my Tkinter trouble is caused by this?

Regards

Michael

Gmane