[Tutor] tk entry focus

2005-07-13 Thread Ron Weidner
I've struggled... Now I'm asking...

What's wrong with this code?  Or more to the point,
how do you set the focus to an Entry widget?

Traceback (most recent call last):
  File "./run_dialogue.py", line 33, in ?
app = Run_dialogue( root )
  File "./run_dialogue.py", line 23, in __init__
self.cmd.focus()
AttributeError: 'NoneType' object has no attribute
'focus'


class Run_dialogue:
def __init__( self, master ):
img_path = path.dirname(sys.argv[0])
img_path = path.abspath(img_path)
#master.initial_focus.focus_set()
master.geometry( "300x150+200+200")
self.cmd_text = StringVar()
self.frame = Frame( master )
self.icon = PhotoImage( file=img_path +
"/target.gif" )
self.lbl_icon = Label( self.frame, image=self.icon )
self.lbl_icon.grid( row = 1, column = 0 )
self.label = Label( self.frame, text="Command: "
).grid( row = 1, column = 1 )
self.cmd   = Entry( self.frame,
textvariable=self.cmd_text ).grid( row = 1, column = 2
)
self.btn   = Button( self.frame, text=" Run ",
command=self.btn_run_click )
self.btn.grid( row = 2, column = 0, columnspan = 3,
sticky = "e")
self.btn.bind("", self.btn_run_click) 
self.frame.pack()
self.cmd.focus()

Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tkinter query?

2005-07-14 Thread Ron Weidner

> > tk = Tk()
> > tk.config(background='pink')
> > tk.geometry('400x400')
> >

# 320 = width
# 150 = height
#
# Left and down are relative to the screens uppeer
left
#
# 200 = position left (x)
# 200 = position down (y)

tk.geometry( "320x150+200+200")

hth


Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Tk -- which label clicked

2005-07-14 Thread Ron Weidner
This doesn't work.  Not an error though. :)  What I'm
trying to do is get the text value of a label.

def icon_click(self, event=None):
  print event.widget.option_get("text", event.widget)

Or, more to the point...  I need to dynamicaly create
clickable labels, each using the same callback.  When
clicked, I need to know which one was clicked.  I was
hoping to use the "text" of the label as the argument
to another function.

Any ideas, suggestions, or recommeded URLs to study?


Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.




Start your day with Yahoo! - make it your home page 
http://www.yahoo.com/r/hs 
 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tk -- which label clicked

2005-07-14 Thread Ron Weidner


--- geon <[EMAIL PROTECTED]> wrote:

> Ron Weidner napsal(a):
> 
> >This doesn't work.  

> >def icon_click(self, event=None):
> >  print event.widget.option_get("text",
> event.widget)
> >
> >  
> >
> maybe event.widget['text'] ?

event.widget['text'] works.  Thanks.


Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Send attachment

2005-07-21 Thread Ron Weidner


--- Jorge Louis De Castro <[EMAIL PROTECTED]> wrote:

> Hello,
> 
> Any ideas how I can use Python and the Windows API
> to open a PC's mail client and send an attachment?
> The idea is saving some data onto a file and then
> invoke the email client (OE or Outlook or whatever
> is the default on the machine) with the recipient's
> address filled in and the file ready to be sent as
> an attachment. 
> Kinda like when we right-click on a file and select
> the "send to mail recipient" behavior.
> Been reading docs, trying out samples, and googling
> this for a few days to no avail.
> 
> Cheers

I'm not sure how to do that but, if you learn how to
use the smtp protocol, you won't need to use someones
mail client.  It's actually simple to use.  Try
looking at the problem from that angle and see if it
gets you anywhere.

Good luck

--

Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Linux sound control

2005-07-21 Thread Ron Weidner
It's simple, without any bells and whistles. Move the
slider up and down to change the volume on your Linux
system. Written in Python and Tkinter, this little
program should work with any window manager.

http://www.techport80.com/soundctrl/sound_ctrl.tgz



--
Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.

__
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Tainted characters and CGI

2005-10-31 Thread Ron Weidner


--- Tim Johnson <[EMAIL PROTECTED]> wrote:

> Hello:
> I need to tighten my handling of CGI transmissions.
> I particular, I need to develop a strategy of safely
> dealing with "tainted" characters.

Ahh... tainted characters.  If by "tainted" you mean
not UTF-8, there is a c tool called "iconv" that fixes
"tainted" characters.  I believe Python has a wrapper,
but I didn't check before sending this e-mail.  Good
luck and please write back if you implement a working
solution.


--
Ronald Weidner
http://www.techport80.com
PHP Software developer for hire.




__ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com
___
Tutor maillist  -  Tutor@python.org
http://mail.python.org/mailman/listinfo/tutor