Skip to Content
Tkinter GUI Programming by Example
book

Tkinter GUI Programming by Example

by David Love
April 2018
Beginner content levelBeginner
340 pages
7h 54m
English
Packt Publishing
Content preview from Tkinter GUI Programming by Example

Updating our ChatWindow class to send requests to the server

With all of the heavy lifting passed over to our other classes, the changes required to our ChatWindow class should be very simple.

Firstly, let's update it so that the messages we send are sent to the web service and stored in a conversation database:

def send_message(self, event=None):    message = self.text_area.get(1.0, tk.END)    if message.strip() or len(self.text_area.smilies):        self.master.requester.send_message(            self.master.username,            self.friend_username,            message,        )        message = "Me: " + message        self.messages_area.configure(state='normal')        self.messages_area.insert(tk.END, message)        ...

Before adding the Me : and incorporating the smileys into our messages_area, we fire off a request ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Tkinter GUI Application Development Blueprints, Second Edition - Second Edition

Bhaskar Chaudhary

Publisher Resources

ISBN: 9781788627481Supplemental Content