Hi Cristian,
The problem is, self is only defined within the class definition.
Basically, the function are not part of the class, just called by the class.
We use a lambda to get the class passed to the function.
So, to correct your code:
from Tkinter import *
class MyApp:
def
Hi,
Thus spoketh pyt...@bdurham.com
unto us on Thu, 16 Dec 2010 18:07:27 -0500:
Dave,
Works in Python 2.7 by changing import statements to:
from Tkinter import *
import ttk
Is there a way to change a frame's border color? (I think this is a
Tkinter limitation, but I'd love to be
Hi Michael,
For widgets that don't accept keyboard focus you can use the
highlightbackground option to create a colored border (although you cannot
add a 3D-relief this way) ... snipped
I took your example and added another frame and widgets that gain focus.
Your highlightbackground
I understand that Tkinter frames do not have a property that
allows their border color to be customized.
Here are some high level ideas I have on how to create a colored
border effect - any suggestions on best practice appreciated.
1. Turn off the frame's border. Enclose the frame in a parent
Hi,
Thus spoketh pyt...@bdurham.com
unto us on Fri, 17 Dec 2010 08:41:45 -0500:
Hi Michael,
For widgets that don't accept keyboard focus you can use the
highlightbackground option to create a colored border (although you
cannot add a 3D-relief this way) ... snipped
I took your
On Fri, Dec 17, 2010 at 8:00 AM, pyt...@bdurham.com wrote:
I understand that Tkinter frames do not have a property that allows their
border color to be customized.
Here are some high level ideas I have on how to create a colored border
effect - any suggestions on best practice appreciated.
Check the following out.
code.py
from tkinter import messagebox
from tkinter import *
from tkinter import ttk
class Option:
def quit(master):
if messagebox.askyesno(message='Close window'):
master.quit()
main.py
---
from tkinter import *
from
Michael,
Ah, I see! The trick seems to be:
- don't set a frame's border width or relief properties (or reset them
to 0 and 'flat')
- set highlightcolor=bordercolor
- set highlightbackground=bordercolor
- set highlightthickness=borderwidth
I think that also answers the question I just posted
On 2, definitely. Rather than using fill, you could set the
outline color, style, and width (e.g. dash/stipple):
[1] http://effbot.org/tkinterbook/canvas.htm
Thanks Wayne,
Malcolm
References
1. http://effbot.org/tkinterbook/canvas.htm
___
Thus spoketh pyt...@bdurham.com
unto us on Fri, 17 Dec 2010 09:00:08 -0500:
I understand that Tkinter frames do not have a property that
allows their border color to be customized.
Here are some high level ideas I have on how to create a colored
border effect - any suggestions on best
Looking for some advice on when to use .update() vs.
update_idletasks(). Are there use cases that favor the use of one
of these techniques vs. the other? Are there situations where one
of these techniques should always or never be used?
Thank you,
Malcolm
Thus spoketh pyt...@bdurham.com
unto us on Fri, 17 Dec 2010 12:04:18 -0500:
Michael,
Your code works wonderfully - thank you very much!!
One question: Why did you add your inner frame to the canvas as a window
via c.create_window() vs. just packing the frame?
To be honest, for no
I've seen the term stipple mentioned in recent posts. The
Tkinter documentation is woefully short on details here. I've
googled for examples and found very few. For those with the same
question as me, here's one example.
http://infohost.nmt.edu/tcc/help/pubs/tkinter/std-attrs.html
My question is
Thus spoketh pyt...@bdurham.com
unto us on Fri, 17 Dec 2010 12:27:41 -0500:
Looking for some advice on when to use .update() vs.
update_idletasks(). Are there use cases that favor the use of one
of these techniques vs. the other? Are there situations where one
of these techniques should
This question is related to using Canvases and Frames as
containers and does not consider the drawing capabilities of the
Canvas widget.
Canvas and Frames are both containers. My understanding is that
both of these containers provide identical layout behaviors via
their pack, grid, and place
As a rule of thumb I'd say: *never* use update() unless you really need it.
If update_idletasks() does the job, it is to be preferred.
Thanks Michael, that's a great tip.
Malcolm
___
Tkinter-discuss mailing list
Tkinter-discuss@python.org
Hi Malcom,
I have never heard of packing widgets within a canvas. Just use create_window,
so there is no automatic placement, you need to handle all placement.
Note with the following, packing a label within a canvas:
from Tkinter import *
root = Tk()
c=Canvas(root, bg=red, width=400,
Hi.
According to this code
--
import Tkinter
class App:
def __init__(self, master):
self.root = master
self.b1 = Tkinter.Button(master)
self.b1.pack()
self.b1.bind('Button-1', lambda
Thus spoketh pyt...@bdurham.com
unto us on Fri, 17 Dec 2010 12:56:22 -0500:
As a rule of thumb I'd say: *never* use update() unless you really
need it. If update_idletasks() does the job, it is to be preferred.
BTW, for those who want to read more about update() vs.
update_idletasks(),
Michael,
BTW, for those who want to read more about update() vs. update_idletasks(),
there are two pages on the tcl'ers wiki that discuss the potential problems
with the update() method in more detail:
http://wiki.tcl.tk/1252
http://wiki.tcl.tk/1255
Excellent resources.
Thank you,
Hi,
Thus spoketh Michael O'Donnell michael.odonn...@uam.es
unto us on Fri, 17 Dec 2010 19:14:27 +0100:
(...)
The Label widget in fact REPLACES the canvas in the display
rather than being packed within it. I don't know why (try commenting out
the d.pack() line) and see the difference.)
I
Hi Mick,
I have never heard of packing widgets within a canvas.
Here's the link that gave me that impression:
http://stackoverflow.com/questions/4080413/python-tkinter-place-a-widget-in-a-canvas-widget
quote
You can easily add widgets to a canvas just like you do any other
container, using
Hi,
Thus spoketh craf p...@vtr.net
unto us on Fri, 17 Dec 2010 15:16:22 -0300:
(...)
I have access to the function (greeting) from the button and the window
close button.
It works fine, but wanted to know whether the use of lambda (lambda),
can be expressed in another way more elegant and
Hi.
I'm trying that opening the window, the position of the handle, is
located where you want, using the method sashpos, in the following
code
from tkinter import *
from tkinter import ttk
class App:
def
Hi,
Thus spoketh craf p...@vtr.net
unto us on Fri, 17 Dec 2010 19:49:58 -0300:
Hi.
I'm trying that opening the window, the position of the handle, is
located where you want, using the method sashpos, in the following
code
(...)
- Mensaje reenviado
De: Michael Lange klappn...@web.de
Para: tkinter-discuss@python.org
Asunto: Re: [Tkinter-discuss] Upload control parameter sashpos to load
the program.
Fecha: Sat, 18 Dec 2010 02:41:57 +0100
Hi,
Thus spoketh craf p...@vtr.net
unto us on Fri, 17 Dec
Hi,
Thus spoketh craf p...@vtr.net
unto us on Fri, 17 Dec 2010 19:15:39 -0300:
(...)
My guess is that if the instruction...
self.root.protocol('WM_DELETE_WINDOW', lambda:((lambda
e,widget=self:greeting(widget))(self.root)))
can be shortened to occupy the same line?
It's for a better
Hi everyone.!
I apologize in advance, since English is not my native language and
some things can not understand and misinterpret.
Very recently I found Python and Tkinter. Needless to say, I find a tool
Tkinter extremely cool and functional, which I am discovering little by
little every day.
28 matches
Mail list logo