I'm just starting to use MetroWerks CodeWarrior 1.1 For Mac 68k in a Mac System 7.5.5, but I need to know: How can I create a simple Form with a TextBox on it? Thanks.
Creating a Form In C++
6.3k Views Asked by Nathan Campos At
2
There are 2 best solutions below
Related Questions in C++
- How to immediately apply DISPLAYCONFIG_SCALING display scaling mode with SetDisplayConfig and DISPLAYCONFIG_PATH_TARGET_INFO
- Why can't I use templates members in its specialization?
- How to fix "Access violation executing location" when using GLFW and GLAD
- Dynamic array of structures in C++/ cannot fill a dynamic array of doubles in structure from dynamic array of structures
- How do I apply the interface concept with the base-class in design?
- File refuses to compile std::erase() even if using -std=g++23
- How can I do a successful map when the number of elements to be mapped is not consistent in Thrust C++
- Can std::bit_cast be applied to an empty object?
- Unexpected inter-thread happens-before relationships from relaxed memory ordering
- How i can move element of dynamic vector in argument of function push_back for dynamic vector
- Brick Breaker Ball Bounce
- Thread-safe lock-free min where both operands can change c++
- Watchdog Timer Reset on ESP32 using Webservers
- How to solve compiler error: no matching function for call to 'dmhFS::dmhFS()' in my case?
- Conda CMAKE CXX Compiler error while compiling Pytorch
Related Questions in FORMS
- How to add the dynamic new rows from my registration form in my database?
- how to play a sounds in c# forms?
- How can I prevent the password from appearing in the network tab payload?
- App script to prevent duplicate form submission
- php $_FILE variable undefined index
- Why are checkboxes not posted when unchecked?
- How do I integrate an existing delete function that is located in my routes.php file to a delete button in a modal in my hr.employees.profile.php?
- How to add default text in output to filled fields in Contact Form 7
- How to create yup schema for dynamic array of different objects
- How to Nest a TelerikGrid inside TelerikForm with Blazor
- How to customize woocommerce add to cart button position
- How to dynamically add two v-text-fields to a form when a button is clicked and uniquely identify them
- NG8003: No directive found with exportAs 'ngForm'. [plugin angular-compiler]
- single form and multiple submit (with multiple value)
- Receive AJAX Form data in Server side
Related Questions in USER-INTERFACE
- OS-wide text autocomplete service with popup
- Bootstrap 5 tooltips not working in Laravel 9.x application
- GUI window is not appearing
- Responsive gui customtkinter
- Unwanted text on created icon
- Custom styled "Add to cart" button in WooCommerce product archive pages
- Page behavior in flet works when used directly in `main`, but not in a UserControl?
- How could I reuse the CTk tabviews in python GUI app?
- mouse coordinates in image go below 0 and above width
- Use the same button in different interfaces (JAVA)
- Distributing a GTK4 Windows application
- How to design the file operation interface involving status and transactions?
- Creating a GUI application for creating graphs
- How point to other link after login
- How to align widget to another widget in Flutter
Related Questions in OBSOLETE
- How do I mark a procedure as deprecated or obsolete in Delphi?
- The border attribute on the table element is obsolete. Use CSS instead
- How should I pass variables between independent parallel tcl procs/scripts
- How to avoid mentioning a function pointer's arguments inside the definition of a function that takes it as argument?
- Create custom ObsoleteAttribute in C#
- Rebuild .NET solution in upgraded framework
- How to replace osolete CursorLoader in Xamarin?
- Will be any version of TypeScript Obsolete?
- Beginner - Why is execCommand() obsolete?
- My rpm Requires ncompress how do I get this to work on rhel 9 when the package now that the package is obsolete?
- How to mark a method that has become obsolete in the next version?
- Is there a gcc warning for non-multithreaded native C functions?
- Support of WebView2 for WPF Apps
- Obsolete Handling on field name in c #
- FMU import and export of Simulink and openModelica
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
There are a couple ways to do it. If your version of CodeWarrior has it, you would be best off using the PowerPlant framework. This is an application framework that makes it relatively easy to build applications that follow the Mac UI standards. It's been more than 10 years, so I have fully purged the PowerPlant class hierarchy from my memory. Sorry.
Another way to do this is to create a DLOG resource in ResEdit which includes a TextEdit field that more or less fits the window. Then you write your main app, which is going to include the typical toolbox initializations (I'm doing this TOTALLY from memory):
Which will probably work and is the most wrong way to do UI on the Mac, but if all you want is a box with a simple, simple UI, you'll be OK.
The problem with this code is that it doesn't handle the events well, the loop is infinite, there is no handling of cut/copy/paste, there is no honoring of menu events, and so on.
The Mac toolbox of that era requires you to do a hell of a lot more work than you might think. This is why there were libraries like MacApp, Think Class Library and PowerPlant - they provided OOP methods to handle a lot of the housekeeping crap for you. At the time that I did most of my Mac programming, I build a non-class library that was raw C code that made it easier to write layered windows (with floating palettes) and fluid UI without the overhead of OOP. Basically, I had to write a window manager, a menu manager, a dialog manager, an event manager, a command dispatcher and so on. When all was said and done, there was something like 18K of overhead to build a typical application. FYI, Acrobat Search on the Macintosh up until version 4 was built on this, as was Acrobat Catalog.
You can find canonical examples in MacTech, like this which is similar code to the above.
Before you start building your entire UI out of Dialog Boxes, all the old Macintosh tech notes said DON'T DO THIS. The DialogManager is one of the most abused chunks of Macintosh code there ever was. It was built for the purpose of making it easy to put of a box that says, "Are you sure you want to close 'Untitled'?" with an OK button and a cancel button. It's surprising how much it can be abused.
The real way to do things is to write a main that initializes the toolbox items, builds a basic menu bar then allocates an object that you design, say NathanWindow. NathanWindow might look like this:
then you will subclass this with code to call NewWindow() in the appropriate style.
Initialize will look something like this:
now, this last little bit is the tricky part - I've put a pointer to the NathanWindow into the Macintosh WindowPtr refCon field. Then you'll build an event loop in your main code that will look like this:
and then Click will look like this:
and so on.
And even still, this is (potentially) wrong in that you really want to have every NathanWindow to be hooked into an application parent that manages layers and groupings of windows.
A NathanWindow should contain a list of NathanControls. A NathanControl is something that can draw, responds to events, and so on.
All of this is in case you don't have PowerPlant, which does all of this for you. There was a reason why Apple liked to tout the line "it's hard to be easy", because the API that you had at your fingertips was so damn primitive.