|
|
|
|
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> Also, the Win32 concept of a "window" is not the same thing as what
>> you or I would consider a "window". (E.g., a checkbox is a "window".)
>> Makes things interesting...
>
> *Everything* is a window. That is, if it's somehow graphical and
> something you might normally stick on a window, it's a subclass of
> "Window."
The usual term is "widget". That way, if you mean "any component", you
say widget, and if you mean "thing that looks like a window", you say
"window".
Under the Win32 terminology, there's no way to talk about real windows
specifically.
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> You know, if you sit down and read this stuff, there's actually a *hell*
> of a lot of switches and options in there...
>
> Like, you'd think creating a window would just be "hey, please create a
> window with this title please". But no. Apart from being able to specify
> the title, icon, and initial size and place, you can do a whole heap of
> other things:
>
> And you thought you could just OPEN a window... ha!
The way AmigaOS handled this stuff was to use tag lists.
If you call OpenWindowTagList(null), it opens an untitled window on the
current screen, taking up most but not all of the display, with the
default window gadgets. Instead of a null pointer, you can (and usually
do) pass a pointer to a "tag list". This is simply an array of key/value
pairs (ending with a TAG_DONE key).
I don't recall the symbol names off the top of my head any more, but you
could add a TAG_TITLE key, with a string pointer as the value, and the
window would then have that title. Or you could add TAG_LEFT and set the
X coordinate for the left edge of the window.
Basically, with each new release of the OS, they just added some more
tag IDs to the header files. So rather than remembering a bunch of
function parameters, or even having a struct full of fields that you
append to, you have this tag list which has any combination of values,
listed in any order. Each time they need to add a new tag, they just add
a new ID.
Now if you have a 32-bit bitmap, you can specify 32 flags. But if you
have 32-bit tag IDs, you have four billion possible tag IDs - which
you're never likely to run out of! (The header file would be several
gigabytes in size, back in a day when everybody worked off 720KB floppy
disks.)
This simple idea makes it trivial to expand the OS, trivial for the OS
to parse the window spec, and trivial for the application to write the
window spec. (It could be static data, for example. Or dynamically
written. Or whatever.) And AmigaOS used it for much more than just
creating windows, of course.
(Tag lists didn't exist under Kickstart 1.3. It was only added with
Kickstart 2.0.)
Oddly, this feature doesn't seem to be apparent anywhere in Win32. It
seems the Win32 Way(tm) is to have a big struct, and pass in a pointer
to the struct and also a length indication, and the function you're
calling decides which version of the struct you've given it based on the
length...
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
> The way AmigaOS handled this stuff was to use tag lists.
A very un-OO way of doing it.
Better would be something like
x = new Window();
x.title = "Hello there";
x.background_color = red;
....
x.show();
Of course, that works best if your language is meta enough that you can put
strings like "title\thello\nbackground_color\tred\n" into a file and read
the file at runtime and generate those calls/assignments without a whole lot
of effort. (And the assignments would translate to method calls, of course,
in the overloaded-operator sense.)
> (Tag lists didn't exist under Kickstart 1.3. It was only added with
> Kickstart 2.0.)
That explains it.
> Oddly, this feature doesn't seem to be apparent anywhere in Win32. It
> seems the Win32 Way(tm) is to have a big struct, and pass in a pointer
> to the struct and also a length indication, and the function you're
> calling decides which version of the struct you've given it based on the
> length...
Nobody said win32 was a *good* way to do it. :-)
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>> The way AmigaOS handled this stuff was to use tag lists.
>
> A very un-OO way of doing it.
Um, yes... This was 1992?
> Better would be something like
> x = new Window();
> x.title = "Hello there";
> x.background_color = red;
> ....
> x.show();
Sure. Just as soon as you figure out how to encode that at the machine
level in a language-independant way that's efficient to generate and
parse...
> Nobody said win32 was a *good* way to do it. :-)
Um... actually I'm pretty sure that's *exactly* what Microsoft says
every freakin' day. :-P
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Orchid XP v8 wrote:
>>> The way AmigaOS handled this stuff was to use tag lists.
>>
>> A very un-OO way of doing it.
>
> Um, yes... This was 1992?
That wasn't a criticism.
>> Better would be something like
>> x = new Window();
>> x.title = "Hello there";
>> x.background_color = red;
>> ....
>> x.show();
>
> Sure. Just as soon as you figure out how to encode that at the machine
> level in a language-independant way that's efficient to generate and
> parse...
I think we figured that out a while ago. Besides, doing what I just wrote is
trivial to wrap into your mechanism, or the win32 mechanism.
> Um... actually I'm pretty sure that's *exactly* what Microsoft says
> every freakin' day. :-P
Oh? And that's why they invented .NET?
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
On 10/13/2009 12:14 PM, Darren New wrote:
> Better would be something like
> x = new Window();
> x.title = "Hello there";
> x.background_color = red;
> ....
> x.show();
>
> Of course, that works best if your language is meta enough that you can
> put strings like "title\thello\nbackground_color\tred\n" into a file and
> read the file at runtime and generate those calls/assignments without a
> whole lot of effort. (And the assignments would translate to method
> calls, of course, in the overloaded-operator sense.)
Sounds like you would like HTML Applications (HTA).
http://msdn.microsoft.com/en-us/library/ms536496(VS.85).aspx
Now obsolete in favor of PowerShell.
-Mike
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
SharkD wrote:
> Sounds like you would like HTML Applications (HTA).
No need. Most of the interpreted languages can handle this. It's trivial in
Tcl or Python, for example, and not even very hard in Java or C#. It's just
when you throw out *all* the metadata that it becomes difficult to look up
functions by name.
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>> A very un-OO way of doing it.
>>
>> Um, yes... This was 1992?
>
> That wasn't a criticism.
Here's a thought... When the hell was Smalltalk invented? And the
Smalltalk machine hardware?
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
Invisible wrote:
>>>> A very un-OO way of doing it.
>>>
>>> Um, yes... This was 1992?
>>
>> That wasn't a criticism.
>
> Here's a thought... When the hell was Smalltalk invented? And the
> Smalltalk machine hardware?
Around 1974 to 1976, with the first "big" release non-experimental version
of smalltalk being the Smalltalk-80.
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |
| |
|
|
>>>> Um, yes... This was 1992?
>>>
>>> That wasn't a criticism.
>>
>> Here's a thought... When the hell was Smalltalk invented? And the
>> Smalltalk machine hardware?
>
> Around 1974 to 1976, with the first "big" release non-experimental
> version of smalltalk being the Smalltalk-80.
Mmm. Seems OO really, *really* took a long time to catch on. Hell, in
1989 I was still programming in BASIC on my dad's C64. :-P
Kinda scary to think that all the revolutionary ideas are actually
centuries old, eh?
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
|
| |
| |
|
|
|
|
| |