4755 "arrange for a component to be positioned at a constant offset |
4755 "arrange for a component to be positioned at a constant offset |
4756 from the bottom of the box and its height to remain the same. |
4756 from the bottom of the box and its height to remain the same. |
4757 This will keep the component at a constant distance from the bottom |
4757 This will keep the component at a constant distance from the bottom |
4758 (without this setup, it would stay at a constant offset from the top)" |
4758 (without this setup, it would stay at a constant offset from the top)" |
4759 |
4759 |
|
4760 self stickAtBottomWithFixHeight:aComponent left:0.0 right:1.0 |
|
4761 |
|
4762 " |
|
4763 compare the resizing behavior of: |
|
4764 |
|
4765 |box| |
|
4766 |
|
4767 box := Dialog new. |
|
4768 box addTextLabel:'hello'. |
|
4769 box addTextLabel:'hello2'. |
|
4770 box addOkButton. |
|
4771 box show |
|
4772 |
|
4773 with: |
|
4774 |
|
4775 |box l2| |
|
4776 |
|
4777 box := Dialog new. |
|
4778 box addTextLabel:'hello'. |
|
4779 l2 := box addTextLabel:'hello2'. |
|
4780 box addOkButton. |
|
4781 box stickAtBottomWithFixHeight:l2. |
|
4782 box show |
|
4783 " |
|
4784 |
|
4785 "Created: 27.1.1996 / 17:17:41 / cg" |
|
4786 "Modified: 27.1.1996 / 18:29:03 / cg" |
|
4787 ! |
|
4788 |
|
4789 stickAtBottomWithFixHeight:aComponent left:left right:right |
|
4790 "arrange for a component to be positioned at a constant offset |
|
4791 from the bottom of the box and its height to remain the same. |
|
4792 This will keep the component at a constant distance from the bottom |
|
4793 (without this setup, it would stay at a constant offset from the top)" |
|
4794 |
4760 self resize. |
4795 self resize. |
4761 |
4796 |
4762 aComponent |
4797 aComponent |
4763 topInset:(self height - aComponent top) negated; |
4798 topInset:(self height - aComponent top) negated; |
4764 bottomInset:(self height - aComponent bottom); |
4799 bottomInset:(self height - aComponent bottom); |
4765 origin:0.0 @ 1.0; corner:1.0 @ 1.0. |
4800 origin:left @ 1.0; corner:right @ 1.0. |
4766 |
4801 |
4767 " |
4802 " |
4768 compare the resizing behavior of: |
4803 compare the resizing behavior of: |
4769 |
4804 |
4770 |box| |
4805 |box| |
4771 |
4806 |
4772 box := Dialog new. |
4807 box := Dialog new. |
4773 box addTextLabel:'hello'. |
4808 box addTextLabel:'hello'. |
4774 box addTextLabel:'hello2'. |
4809 box addTextLabel:'hello2'. |
4775 box addOkButton. |
4810 box addOkButton. |
4776 box show |
4811 box show |
4777 |
4812 |
4778 with: |
4813 with: |
4779 |
4814 |
4780 |box l2| |
4815 |box l2| |
4781 |
4816 |
4782 box := Dialog new. |
4817 box := Dialog new. |
4783 box addTextLabel:'hello'. |
4818 box addTextLabel:'hello'. |
4784 l2 := box addTextLabel:'hello2'. |
4819 l2 := box addTextLabel:'hello2'. |
4785 box addOkButton. |
4820 box addOkButton. |
4786 box stickAtBottomWithFixHeight:l2. |
4821 box stickAtBottomWithFixHeight:l2. |
4787 box show |
4822 box show |
4788 " |
4823 " |
4789 |
4824 |
4790 "Created: 27.1.1996 / 17:17:41 / cg" |
4825 "Created: 27.1.1996 / 17:17:41 / cg" |
4791 "Modified: 27.1.1996 / 18:29:03 / cg" |
4826 "Modified: 27.1.1996 / 18:29:03 / cg" |
4792 ! |
4827 ! |