80 likes | 95 Views
Under the Hood : A Short Introduction to wxWindows. The textbook classes are an extension of wxWindows, a windowing library. The textbook classes package elements of wxWindows for your use. What’s a Windowing Library?. A collection of software to construct “windowed” programs. Examples :
E N D
Under the Hood : A Short Introduction to wxWindows • The textbook classes are an extension of wxWindows, a windowing library. • The textbook classes package elements of wxWindows for your use. CS2704-Parks-wxWindows Overview
What’s a Windowing Library? • A collection of software to construct “windowed” programs. • Examples : • wxWindows • Microsoft Foundation Classes (MFC) (The “Visual” part of Visual C++) • Java Foundation Classes (JFC) CS2704-Parks-wxWindows Overview
Why use a windowing library? • Easy to develop visually attractive code • Some libraries, like wxWindows and Java, are portable across platforms • They are all very similar - Once you learn one, it’s easy to learn others CS2704-Parks-wxWindows Overview
How do I use wxWindows, then? • Use your new best friend : the wxWindows Application Programming Interface! (API) • wxWindows 1 alphabetical class reference : http://web.ukonline.co.uk/julian.smart/wxwin/manuals/html/wx/ • wx72.htm#classref • Explore the API! CS2704-Parks-wxWindows Overview
A Simple Exercise in wxWindows Create wxFrame Put wxText (like Message) in frame Put wxButton (like Button) in frame Increment value in wxText object each time button is pressed CS2704-Parks-wxWindows Overview
Writing a wxWindows Application: A Rough Guide • To set a wxWindows application going, you'll need to derive a wxApp class. • An application must have a top-level wxFrame window (returned by wxApp::OnInit), each frame containing one or more instances of wxPanel, wxTextWindow or wxCanvas. CS2704-Parks-wxWindows Overview
More wxWindows Classes • A wxPanel is used to place items (classes derived from wxItem) which are used for user interaction. • Examples of items are wxButton, wxCheckBox, wxChoice, wxListBox, wxSlider, wxRadioBox. CS2704-Parks-wxWindows Overview
Even More wxWindows Classes • Instances of wxDialogBox can also be used for panels, items and they have the advantage of not requiring a separate frame. • Instead of creating a dialog box and populating it with items, it is possible to choose one of the convenient dialog functions, such as wxMessageBox and wxFileSelector CS2704-Parks-wxWindows Overview