Читать книгу Beginning Programming All-in-One For Dummies - Wallace Wang - Страница 40

Designing a user interface

Оглавление

The main advantage of event-driven programming is how quickly it allows you to design a UI without writing a single command whatsoever. Instead of writing commands, you create a UI using a two-step process:

1 Visually draw your UI on a window by choosing which UI parts you want, such as buttons, check boxes, or menus, as shown in Figure 2-5.After you’ve drawn your UI, you wind up with a generic UI.FIGURE 2-5: Designing a UI involves drawing what you want to appear on your program's UI.

2 Customize each part of your UI by defining its appearance and behavior.To customize part of a UI, you must modify that UI’s properties. Each part of your UI contains properties that define its appearance and behavior. For example, if you wanted to change the size of a check box, you’d modify that check box’s Width or Height property, as shown in Figure 2-6.

With event-driven programming, designing a UI involves drawing your UI and then customizing it by changing its properties. After you’ve designed your UI, it will appear to work, but it won’t actually do anything until you write an event handler.


FIGURE 2-6: Properties define how each part of a UI looks and behaves.

Beginning Programming All-in-One For Dummies

Подняться наверх