The Qt library was the first to recognize that in almost every case, programmers don't need or even want all the low-level details: They don't care how the button was pressed, they just want to know that it was pressed so that they can respond appropriately. ![]() Although the outcome is the same in all these cases, each different means of clicking the button produces different events and different information. The user may have pressed the Tab key enough times to move the focus to the button and then pressed Spacebar, or maybe they pressed Alt+C. Similar information can be provided if the user "clicked" the button without using the mouse. The GUI library can tell us the coordinates of the mouse click relative to the button, relative to the button's parent widget, and relative to the screen it can tell us the state of the Shift, Ctrl, Alt, and NumLock keys at the time of the click and the precise time of the click and of the release and so on. ![]() For example, if we have a button with the text Click Me, and the user clicks it, all kinds of information becomes available. Rapid GUI Programming with Python and Qt: The Definitive Guide to PyQt ProgrammingĮvery GUI library provides the details of events that take place, such as mouse clicks and key presses.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |