import GUI; // Create a window, a text field, and a button int window = newWindow(0, 0, 350, 180, "WINDOW"); int textField = newTextField(10, 10, 300, 20, "TEXTFIELD"); int button = newButton(10, 50, 300, 50, "BUTTON"); // Mount the text field and button onto the window mountComponent(textField, window); mountComponent(button, window); // Event handler: called when the button is clicked void onButtonClick(int id, string label) { string text = getComponentText(textField); // Get text from the field popup(text); // Show it as a popup }