Hello to all. I am trying to create a list of thumbs in my program, and I would like this list to have a scrollbar. So I tried to use a virtual gadget with a vertical layout in it.
Here is what I wrote:
// Thumbs list LAYOUT_AddChild, objects[OID_LAYOUT_THUMBS_WRAPPER] = IIntuition->NewObject(NULL, "layout.gadget", LAYOUT_Orientation, LAYOUT_ORIENT_VERT, LAYOUT_SpaceOuter, TRUE, LAYOUT_BevelStyle, BVS_GROUP, LAYOUT_Label, " THUMBS ", LAYOUT_AddChild, objects[OID_VIRT_THUMBS] = IIntuition->NewObject(NULL, "virtual.gadget", VIRTUALA_Contents, objects[OID_LAYOUT_THUMBS] = IIntuition->NewObject(NULL, "layout.gadget", LAYOUT_Orientation, LAYOUT_ORIENT_VERT, LAYOUT_SpaceOuter, FALSE, TAG_DONE), CHILD_WeightedWidth, 0, TAG_DONE), TAG_DONE), CHILD_WeightedWidth, 35,
The problem is that other times it works just fine, but other times the program crashes before it even starts to show up.
Is there anything stupid I did there? Should I add something else too?
Hi, maybe you can take a look at AISSview (gui.c) it uses virtual.gadget to show icons and can help you a little with your thumbs programm.
http://www.os4depot.net/share/graphics/aiss/aissviewer-src.lha
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
Unless I'm reading it wrong you appear to have a CHILD_WeightedWidth,0, just after your thumbs layout, nad *inside* your Virtual gadgets tags, which is proably not what you want!
BTW a listbrowser is a better choice for a list of thumbs.
@jabirulo
Thanks. I will check this out
@broadblues
How can I dynamically show images inside a listbrowser? Is there a good example I could check? This solution could help me more, in case it works.
Thank you guys for your help and time.
being imageP:
I use it to show string/languages in its native/local charset.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P
@jabirulo
But where do you set the image at your example? It should be loaded as a file or using datatypes. Where do you give to the listbrowser where it can find the image?
@walkero
jabiluro's example is using a label image but you can just as well use a bitmap image.
adds the image to a coulmn in the node
LBNA_Column,1, LBNCA_Image,imageP,
code to load an image as bitmap:
imageP = IIntuition->NewObject(BitmapClass, NULL,
BITMAP_SelectSourceFile, path_s,
BITMAP_DisabledSourceFile, path_g,
BITMAP_Screen, scr,
BITMAP_Masking, TRUE,
, TAG_END);
@broadblues
Thanks for the code... it worked like charm. I have two more questions:
1. Is there a way to have a column of a listbrowser hidden? Checked the autodocs where you set the columninfo and didn't find anything useful. Rigo says that it is feasible at the following post (http://www.amigans.net/modules/xforum/viewtopic.php?post_id=80893). Any clue?
2. When I load a lot of images in the list the gfx memory fills. Is there a way to free the image from memory, but remain in the list? It also isn't cleared from memory when I close the app. It seems that when you dispose a win doesn't free it's resources.
Thank you all for your help and time.
How many is a lot of images?
You need to dispose of those bitmaps images at program exit, they wont be disposed of by disposing of the listbroswer, same goes for the listnode in fact.
@walkero
ADRipper uses column hiding when switching between the Compilation and the Normal mode, but looking at the code it merely modifies the ColumnInfo structure, setting ci_Width = 0 and ci_Title = "" for the particular column. A rather ugly kludge if you ask me but whether there's another way I don't know.
AmigaOne X5000-020 / 2GB RAM / Sapphire Pulse Radeon RX 560 / AmigaOS 4.1 Final Edition Update 2