We're a community of 1.1M IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,080,307 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

Issues with a third tier Toplevel, tkinter

I'm having issues with a third level Toplevel in tkinter, that is to say having a toplevel popup from another Toplevel.

self.emailbttn= Button(self, text='Email', command=self.clientchooser)

    def clientchooser(self):
        showing.withdraw()
        client_choose()

    def client_choose():
        global client
        client=Toplevel()
        client.title=('Choose Email')
        client.geometry=('800x600')
        Client(client)




class Client(Frame):
    '''Choose Email Client'''
    def __init__(self,master):
        super(Client, self).__init__(master)
        self.grid()
        self.create_widget()

    def create_widget(self):
        self.notice=Label(self, text='Choose your Email Type')
        self.notice.grid(row=1,rowspan=2,column=3,columnspan=4)
        self.gmail=Button(self, text='GMAIL', command=self.gopen)
        self.gmail.grid(row=3,column=3,columnspan=3)

    def gopen(self):
        import webbrowser
        webbrowser.open('https://mail.google.com/mail/u/0/?hl=en&tab=wm#compose)

And yes I'm aware that Gmail is more properly webmail as opposed to a mail client. On a related note is there a way to have the To: field automatically filled upon opening a message composition page in gmail? I'm sure there's a much better way to do email than the way I'm doing it, but I suppose the real issue at hand for me is the fact that the third level toplevel is opening WAY too small and the title doesn't show.

2
Contributors
6
Replies
3 Hours
Discussion Span
1 Year Ago
Last Updated
7
Views
pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

found it, I had client.title#and geometry#=() but it's just client.title()

I suppose now on to having a better way to do email, is there one?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0
pyTony
pyMod
Moderator
6,330 posts since Apr 2010
Reputation Points: 879
Solved Threads: 989
Skill Endorsements: 27

I've tried that a few times and gotten socket errors for local host. Also does the From: field need to be a valid email address?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

I think your computer has not smtp server running but you must put in your Internet Service providers SMTP server information. From field could probably be faked, but replies would not arrive OK. Like some companies or mailing lists no_reply.... Email addresses. I try to take the code and let it transmit itself to you now that I dig up some stuff for gmail from net.

pyTony
pyMod
Moderator
6,330 posts since Apr 2010
Reputation Points: 879
Solved Threads: 989
Skill Endorsements: 27

I got it, wow, that worked well from you. Let's see if I can do that. How would I find my ISP's SMTP server info?

pyguy62
Posting Whiz
353 posts since Aug 2011
Reputation Points: 34
Solved Threads: 19
Skill Endorsements: 0

See the code snippet I posted. There was some issue with bytes trying to send the code of the program from Python3, so in snippet there is only simple built in string sent instead. Subject is left incorrectly sam as in message I sent to you. The program has the information how to use gmails SMTP, not ISP specific one.

pyTony
pyMod
Moderator
6,330 posts since Apr 2010
Reputation Points: 879
Solved Threads: 989
Skill Endorsements: 27

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
View similar articles that have also been tagged:
 
© 2013 DaniWeb® LLC
Page generated in 0.0975 seconds using 2.83MB