i would like to dock a menu stack on the right side of the screen just like you see a windows taskbar at the bottom of the screen.
how would one attempt doing this?
dock a stack on the screen
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
dock a stack on the screen
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392
Re: dock a stack on the screen
Hi jesse,
checking "the screenrect" and using this as reference for
the position (especially "the right"!) of your stack could be helpful
Best
Klaus
checking "the screenrect" and using this as reference for
the position (especially "the right"!) of your stack could be helpful

Best
Klaus
Re: dock a stack on the screen
Klaus,
Thats a helpful start. Thanks. Could you tell me where I might find anymore information for that particular feature.
I'm not understanding how to set the rect of just the height on screenRects, and then position the window all the way to
the left of the screenRects. the documentation example code didn't seem to work at all for me when i plugged it
into a mouseup button code.
I tried plugging in this code to a button on the stack but it didn't work of course.
Thats a helpful start. Thanks. Could you tell me where I might find anymore information for that particular feature.
I'm not understanding how to set the rect of just the height on screenRects, and then position the window all the way to
the left of the screenRects. the documentation example code didn't seem to work at all for me when i plugged it
into a mouseup button code.
Code: Select all
set the rect of this stack to line 2 of the working screenRects
Code: Select all
set the rect of this stack to the screenRect - 300
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392
Re: dock a stack on the screen
The "screenRects" (plural) is a list of the rects of all the screens currently attached to your computer. "Line 2 of the screenRects" will be empty unless you have multiple screens. Each line in the screenRects is a series of 4 integers, separated by commas, and each line describes the rect of each screen.
If you have only one screen, or you only want to retrieve the rect of the primary screen, use "screenRect" (singular).
Whether singular, or one line of the plural, you will find the screenRect described by 4 integers, the left, top, right and bottom. So you can't take (for instance)0,0,1024,768 and subtract 300.
You could define the rect of the docked stack by something like:which should give you a stack 300 px wide positioned at the right of the screen, and taking the full height of the screen. You dont' have to use "rect" (or "rectangle") to define the shape and position properties of your stack. The "rect" defines the area covered by an object. Implicitly then you know that if you were to check the width property for the object, it would return the difference between the 1st and 3rd items of the rect. You can also set the width and height of an object. This would then reciprocally affect the rect. Setting the right (or left, or top or bottom) property of an object won't change its size, but it will change its rect as it is repositioned, but the difference between the 1st and 3rd, or between the 2nd and 4th items of its rect won't change when you set its new position. You could also do something likeHopefully it is a little clearer now to see that you can take any one of the properties and adjust it. If you affect a "rect" then you can take any one item in the list of properties that define it to adjust.
I hope that's made things easier to get the hang of, rather than confuse. If I've messed up explaining, please ask.
If you have only one screen, or you only want to retrieve the rect of the primary screen, use "screenRect" (singular).
Whether singular, or one line of the plural, you will find the screenRect described by 4 integers, the left, top, right and bottom. So you can't take (for instance)0,0,1024,768 and subtract 300.
You could define the rect of the docked stack by something like:
Code: Select all
-- get the screenRect and stuff it in a variable we can use
put the screenRect into tRect
--get item 3 of our variable, which will be the right, subtract 300
--and put the new value into item 1 of our variable, which will be the left
put item 3 of tRect - 300 into item 1 of tRect
--redefine the "rectangle" area covered by this stack to be the
--coordinates for left, top, right and bottom held in our variable
set the rect of this stack to tRect
Code: Select all
set the width of this stack to 300
set the height of this stack to item 4 of the screenrect - item 2 of the screenrect
set the right of this stack to item 3 of the screenrect
set the top of this stack to 0
I hope that's made things easier to get the hang of, rather than confuse. If I've messed up explaining, please ask.
Re: dock a stack on the screen
Thats great! Really helped me to understand it more. Thank you so much!
Deving on WinVista Home Prem. SP2 32 bit. Using LiveCode 4.6.1 Pro Build 1392