(no title)
pillusmany | 2 years ago
BTW, the current Windows Task Manager still shows the total HANDLE count on the CPU page.
They were not used in apps with complex UIs because native controls were hard to skin and didn't work very well when their size was very small (as complex UIs tend to need)
Someone|2 years ago
That depends on the overhead per window. Microsoft Windows could use nested windows because it had separate Graphics objects to store such things as the current drawing pen, its position and the current font to use for drawing (https://learn.microsoft.com/en-us/windows/win32/api/gdiplusg...)
In comparison, on the classic Mac every window had a GrafPort that defined a boundary region, a clipping region, the current pen position, size, drawing pattern, etc.
The Mac could have such heavy-weight window objects because it didn’t nest windows. Instead, each window had a single list of controls that were much lighter-weight.
my gut feeling says separating the drawing state from windows as in MS Windows is the better choice, but I also think having separate entities called “windows” and “controls” as on the Mac is the better choice.
(its documentation is ‘less than stellar’, but it appears GrafPort still exists: https://developer.apple.com/documentation/applicationservice...)
skissane|2 years ago
GrafPort is part of QuickDraw, almost all of which was removed in 64-bit macOS. (A handful of QuickDraw functions survive, but they can't actually be used to do drawing, just to manipulate Point/Region/etc data structures.)
From what I understand, this struct/typedef remains in the headers to help with compiling legacy code–but all the APIs which take it as an argument have been removed, so it is essentially a useless vestige.
bitwize|2 years ago
I like to sum up the difference between Mac and Windows thusly. Probably glossing over a bunch of stuff but still:
* Steve Jobs toured Xerox and came away with an idea, and a fairly shallow one -- the windowed, mouse-driven, document-centric interface. This is what he then had his team implement in the Lisa and Mac. As implementations go, it was really good and it looked good, but it was really procedural Pascal code beneath. (You had to handle window moving and resizing yourself in early Mac OS. There were library functions to help, but you had to code all that into your application's main loop.)
* Microsoft, at right about the same time, was hiring guys out of Xerox PARC itself -- guys like Charles Simonyi -- and they brought with them a whole passel of ideas, not just concerning interfaces but also software design, things like objects and message-passing. That's why Windows could do things like handle the move and resize drag actions, and then just post WM_MOVE or WM_RESIZE to the target window. Windows were objects -- members of classes, even, and could receive messages.
Granted, Windows couldn't run in 128K -- and Jobs would pivot completely with NeXT and deliver an object-oriented desktop based on Smalltalk grafted onto C (Objective-C), but initially it seems Apple were trying to build a cheaper, more user friendly Xerox Star and Microsoft were trying to get as much of the Smalltalk environment as would fit in a PC without requiring devs to learn a new language.
nxobject|2 years ago
On the point of GrafPort still existing – Carbon was insanely backwards source compatible until QuickDraw was deprecated in the transition to 64-bit! [1] Conservatively-written 80s Toolbox code would work with some switching around of headers, and shimming getting/setting members of structs with functions.
[1] https://www.highcaffeinecontent.com/blog/20150124-MPW,-Carbo...
adzm|2 years ago
bitwize|2 years ago
For a while there, at least on Windows 3.1 and before, possibly some Windows 9x versions -- you had a GDI heap and USER heap of 64k each (one 16-bit x86 segment). If you allocated too many HANDLEs, you could blow one of these heaps. So it still made sense to be judicious about how many windows you created. Most Web browsers and word processors, for instance, drew their documents in the client area and did not use subwindows to position text elements.
dspillett|2 years ago
IIRC this limit never applied to the NT family (NT, 2000, XP, …).
--
[1] I can't remember if this was resolved at all in the 98 releases, I imagine not
grumpyprole|2 years ago
Narishma|2 years ago
stouset|2 years ago
Every time I’m forced to use Windows I’m blow away by the clownishness of every application deciding to skin its own custom windowing controls.
This started happening some time around XP, I think?
jeroenhd|2 years ago
If applications used the theme APIs, they'd run fine on both beta and production versions of Windows. If applications tried to render bitmaps over title bars and such, they'd look weirdly out of place, because the real theme was extremely different.
Unless you preferred the beta Windows XP style, of course, which some people did. I think there were a few hacks you could do to get the beta theme working on release versions of Windows.
flohofwoe|2 years ago
https://www.google.com/search?q=Kai%27s+powertools+screensho...
amluto|2 years ago
I even vaguely recall MS jumping on this bandwagon with some MFC styles.