After reading lesson 37, you’ll be able to
- Describe a graphical user interface
- Use a library for a graphical user interface to write a program
Every program you’ve written has interacted with the user in a text-based way. You’ve been displaying text on the screen and getting text input from the user. Although you can write interesting programs this way, the user is missing a more visual experience.
Consider this
Think about a program you use in your everyday life: a browser to go on the internet. What kinds of interactions do you have with the browser?
Answer: You open the browser window, click buttons, scroll, select text, and close the browser window.
Many programming languages have libraries that help programmers write visual applications. These applications use familiar interfaces between the user and the program: buttons, text boxes, drawing canvases, icons, and many more.
A library for a graphical user interface (GUI) is a set of classes and methods that know how to interface between the user and the operating system to display graphical control elements, called widgets. Widgets are meant to enhance the user experience through interaction: buttons, scrollbars, menus, windows, drawing canvases, progress bars, or dialog boxes are a few examples.