Can cards in a stack be of different sizes

Ken Norris pixelbird at interisland.net
Wed Nov 5 14:33:57 EST 2003


> Date: Wed, 5 Nov 2003 11:45:17 -0500
> From: "Russell" <rxfeldman at comcast.net>
> Subject: Re: Can cards in a stack be of different sizes
> 
> Oh Im sorry Ken I didn't realize youi ment this in reference to:
> :
>> How can an application be constrained to one 5x8 or whatever size window. ?
-----------
Well, I was replying specifically to a specific question. Here it is exactly
as I posted it (note: it included the specific question, so you must've
known what I was replying to):

>> How can an application be constrained to one 5x8 or whatever size window. ?
> ----------
> set resizeable of stack x to false

I thought one of the things you were trying to do was prevent the user from
resizing the stack window.
-----------
> But the above is only one line of a larger paragraph and in that context it
> was saying "How can a developer work an application with numerous different
> size windows in an environment that restricks windows to "5x8 or whatever size
> window" 
-----------
OK, I'm trying to help, but I guess I still don't understand the question. I
think that's why it got so convoluted (there was all kinds of different
stuff on that thread, splash windows, etc., and, worse than that, somehow
the same issue was being addressed in another relatively unrelated thread
[Making Windows application icons on Mac], a mistake I've made myself). I
read the question, as stated above, like this: "How can you have different
sized windows in an environment where you CAN'T have different sized windows
(because they're constrained to a specific size)." It makes no sense to me.

Let me try to get at what you really want.

1) There can be no such thing as a 5x8 window. I suppose you mean 5 inches x
8 inches or something, but in Rev and virtually all other IDEs, AFAIK,
window rects are sized by width and height in pixels, or by rectangle
coordinates measured in pixels from the left and top of the screen. Only
image manipulation software like PhotoShop will give you a choice to measure
an image (never a window) in inches or centimeters. Even PS doesn't really
know what the dimensions of your monitor (in inches) is (pixel sizes vary on
different size monitors at the same resolution), so those choices are meant
to refer to print sizes.

So I hope we have that gremlin out of the way.

2) As a general rule, card dimensions follow stack window dimensions. AFAIK,
you can't have a card smaller than the stack window. It can be larger than
the stack window, but you can only set it with the vScroll, which can affect
the menubar. IOW, setting the card width or height separately from dealing
with the window size (stack)has no effect.

3) You can set the backSize for compatibility with SuperCard.

4) If you mean that the window size is restricted to a MAXIMUM of, say, 512
x 360 pixels, and you want to have varying size windows up to that maximum
size, then put the following in a stack script, click in the card area, and
watch what happens, just to give an example:

on preOpenCard
  put random(512) into tWidth   ## 512 is max width
  if tWidth <32 then put 32 into tWidth   ## 32 is min width
  put random(360) into tHeight   ## 360 is max height
  if tHeight <32 then put 32 into tHeight   ## 32 is min height
  set the width of stack "WindowSizes" to tWidth
  set the height of stack "WindowSizes" to tHeight
end preOpenCard

on mouseUp
  go next card
end mouseUp

----------
> I was not asking how to restrict a stack "to one 5x8 or whatever size window"
> 
> Boy these one liners will get you every time..lol
> The following had me scratching my head when applying it to what I was saying.
> 
> ----------
> set resizeable of stack x to false
-----------
As I mentioned at the beginning, I did not leave that all by itself, but
included the question with it in the reply, specifically so that wouldn't
happen. I don't see how there can be a mistake what I was replying to in the
post, but I do see how convoluted and confusing the thread is.

HTH,
Ken N.




More information about the use-livecode mailing list