Python Forum
Python Graphics Help With Entries
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Python Graphics Help With Entries
#1
Hi, I'm trying to make a flashcard maker and to start the flashcard making process I have an entry that I will check for text however when I use a while loop to check if the entry text is equal to some text it freezes my graphics screen. Any ideas?

Here is my code
from graphics import *

running = True

window_width = 500
window_height = 500
welcome_window = GraphWin(width = window_width, height = window_height)#Creates a window with a width of 1000 and a height of 1000

message1 = "Welcome to my program 'Flashcard Maker'"

welcome_message_x = 250
welcome_message_y = 100

welcome_message = Text(Point(welcome_message_x, welcome_message_y), message1)
welcome_message.setSize(15)#Sets size of the text to 30
welcome_message.draw(welcome_window)

start_message1 = "If you would like to go create flashcards type Yes into the box below"

start_message_x = 250
start_message_y = 150

start_message = Text(Point(start_message_x, start_message_y), start_message1)
start_message.setSize(15)
start_message.draw(welcome_window)

entry1 = Entry(Point(250, 200), 20)
entry1.draw(welcome_window)

entry1_text = start_message.getText()
if(entry1_text == 'Yes' or entry1_text == 'yes'):
	print("YESSSS")
	running = False

running = False
welcome_window.getMouse()#Pauses the window until a click occurs
Reply
#2
Any loops that take some time to perform will block the GUI event loop stopping the update of any drawn items.
I think the graphics module is written on top of tkinter, see the following forum thread.
https://python-forum.io/Thread-Tkinter-H...ng-the-gui
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Ldap3 Python print(conn.entries) doesnt work ilknurg 15 5,707 Dec-28-2022, 11:22 AM
Last Post: shad
  Python graphics kaltenherz 1 1,713 Sep-05-2021, 05:19 PM
Last Post: jefsummers
  read and extract entries in python RRR 3 1,961 Jul-07-2020, 06:14 AM
Last Post: bowlofred
  Turtle python graphics Y0sh1 6 3,429 Jun-10-2020, 10:05 AM
Last Post: DPaul
  from graphics import * jmaloney413 2 5,202 Oct-18-2018, 08:22 AM
Last Post: perfringo
  Python catch mouse click in pure text, no graphics samtal 7 7,221 Sep-10-2018, 03:02 PM
Last Post: samtal
  Working with turtle graphics in python and colour slices of a pie graph... netrate 1 4,474 Feb-03-2018, 08:41 PM
Last Post: Larz60+
  Graphics py not found vnc 13 22,412 Apr-05-2017, 05:36 PM
Last Post: wavic

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020