 |
 |
|
 |
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
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:
- You can disable the close button.
- You can adjust the border style.
- You can remove the titlebar completely.
- You can enable or disable resizing the window.
- You can add that little help-icon thingy. You know, the one where the
user clicks the help button, clicks something in the window and gets an
error message saying "sorry, no help available".
- You can select "keep on top".
- You can select horisontal and/or vertical scrollbars.
- You can select whether whatever the window obscures is cached for fast
redraw.
- You can enable file drag/drop. (I'm not kidding...)
- You can do that thing that floating toolbars have, where the titlebar
is rendered smaller than usual and the window won't resize.
- You can have the window initially minimised or maximised.
- You can make it so the window can't become the active window. (I.e.,
you can see it, but can't select it.)
- You can "open" the window but have it invisible initially. (Presumably
you'll make it visible at some point - again presumably once you've
finished adding controls to it.)
This not including all the low-level stuff like what clipping to do,
which drawing context to use, which window messages to send, and a bunch
of other stuff I don't even comprehend yet.
And you thought you could just OPEN a window... ha!
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> You know, if you sit down and read this stuff, there's actually a *hell*
> of a lot of switches and options in there...
Yes it's great isn't it? :-)
> And you thought you could just OPEN a window... ha!
To be fair, you can just pretty much just use all the defaults (ie use none
of those flags) and you'll get something resembling a "normal" window. I
guess they designed it that way.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> You know, if you sit down and read this stuff, there's actually a
>> *hell* of a lot of switches and options in there...
>
> Yes it's great isn't it? :-)
It'd be greater if the documentation were a little more illunimating -
although it's not too bad.
>> And you thought you could just OPEN a window... ha!
>
> To be fair, you can just pretty much just use all the defaults (ie use
> none of those flags) and you'll get something resembling a "normal"
> window. I guess they designed it that way.
Yeah, to some extent.
To another extent, there's a fair few layers of backwards compatibility
in there to wade through.
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...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
> 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...
Yes, you need to get your head around that otherwise you're going to be
*very* confused when it comes to adding icons and stuff to your "window"...
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
scott wrote:
>> 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...
>
> Yes, you need to get your head around that otherwise you're going to be
> *very* confused when it comes to adding icons and stuff to your "window"...
The fun thing is, half the stuff is talking about *actual* windows.
(E.g., only an actual window has a title bar and a menu.) And half of
the stuff is talking about widgets. (E.g., would you like a drop shadow
around that?) And it's not always clear which is which.
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
> The fun thing is, half the stuff is talking about *actual* windows.
Qt did better. Everything is a widget, and windows (main window, toolbar
window, dock window) are kinds of widgets.
Maybe Win32 inherited the terminology from X10/X11?
Of course, when you get actual OO with actual inheritance and such, it
becomes a lot easier.
w = new Window();
w.hasTitlebar(true);
w.canTakeFocus(false);
w.hasHelpIconThingie(true);
w.backgroundColor(white);
w.open();
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> The fun thing is, half the stuff is talking about *actual* windows.
>
> Qt did better. Everything is a widget, and windows (main window, toolbar
> window, dock window) are kinds of widgets.
Yeah. AWT did this. Smalltalk did this. Most people did this, actually.
(Except Tk. :-P )
> Maybe Win32 inherited the terminology from X10/X11?
Yeah, perhaps.
> Of course, when you get actual OO with actual inheritance and such, it
> becomes a lot easier.
For sure. ;-)
--
http://blog.orphi.me.uk/
http://www.zazzle.com/MathematicalOrchid*
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Orchid XP v8 wrote:
> (Except Tk. :-P )
Well, Tk called it a toplevel, and called the things inside a toplevel
widgets, so it wasn't too confusing. I.e., Tk didn't call anything just a
"window".
--
Darren New, San Diego CA, USA (PST)
I ordered stamps from Zazzle that read "Place Stamp Here".
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
Invisible wrote:
>
> 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."
--SKS
--
#macro T(E,N)sphere{x,.4rotate z*E*60translate y*N pigment{wrinkles scale
.3}finish{ambient 1}}#end#local I=0;#while(I<5)T(I,1)T(1-I,-1)#local I=I+
1;#end camera{location-5*z}plane{z,37 pigment{granite color_map{[.7rgb 0]
[1rgb 1]}}finish{ambient 2}}// TenMoons
Post a reply to this message
|
 |
|  |
|  |
|
 |
|
 |
|  |
|  |
|
 |
>> 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
|
 |
|  |
|  |
|
 |
|
 |
|  |