Hello everyone,
having the code to open a reaction window, i want to create a nice layout with few objects as follow:
one frame with a label (mylabel) and another label inside the frame (myDescriptionLabel):
1) How to put my description label inside the frame?
at the bottom, i want to create a second frame add a label and a string object inside the frame.
2) How to tell to reaction that the last frame and its objects should be positioned at the botton?
Thank you vewry much
1. Use a vertical layout object for your WINDOW_Layout.
2. LAYOUT_AddChild a layout object with LAYOUT_BevelStyle, BVS_GROUP and LAYOUT_Label, "First Frame"
3. Inside this layout, LAYOUT_AddImage a label image object with the "bla bla" text.
4. End the layout.
5. LAYOUT_AddChild another layout object with LAYOUT_BevelStyle, BVS_GROUP and LAYOUT_Label, "Second Frame".
6. Inside this layout, LAYOUT_AddChild the string gadget.
7. End the layout.
The layout hierarchy will be like this:
-parent layout (level 1)
--child layout (level 2)
---child label image (level 3)
--child layout (level 2)
---child string gadget (level 3)
Object positioning in ReAction depends on their placement in the layout hierarchy. If the second framed layout is placed after the first one and the parent layout is vertical, the second layout will be positioned at the bottom of the window.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
Could you, please, add an example code?
Thank you
Do something like this:
Note that the example code expects that you have obtained the relevant class pointers (LayoutClass, LabelClass, StringClass) before, via OpenClass(). See this tutorial, section 4.2 to learn how to do it.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
I uploaded a complete, compilable example here:
http://dl.dropbox.com/u/26599983/ra_layout_example.7z
Thank you both.
I will try as soon as possible.
Another things i wants to do is:
make the description label on first frame changeable when write something on the StrinObject.
I assume that the label should have a name (or ID) and i have to use SetAttr....
Sorry, double post.
In that case, don't LAYOUT_AddImage a label object. Instead, LAYOUT_AddChild a button gadget (or a texteditor gadget, if the string text can get long) object and make it read-only by passing GA_ReadOnly, TRUE.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
This is what my code looks, so far
@AmigaBlitter
The structure looks fine to me - but it won't do exactly what you describe in your first post :-)
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2
@Trixie
In the first post is that i want to achieve, while the structure i posted later is one of my some attemps. I'm a little confused by the many methods to do things in OS4. I want to focus on Reaction only, without using Macros (as you seggested).
@trixie
PM for you
@siteadmin
can pm messages be put in a more visible zone?
thank you