Hi, me again. I have a layout with a button(image) and if user enables MAX_WINSIZE tooltype I want ot add/show just below such image another one, but using LAYOUT_AddImage, instead of an image inside a button.
... LAYOUT_AddChild, OBJ(OBJ_PREVIEWS) = IIntuition->NewObject(LayoutClass, NULL, //"layout.gadget", LAYOUT_Orientation, LAYOUT_ORIENT_VERT, LAYOUT_HorizAlignment, LALIGN_CENTER, //LAYOUT_SpaceOuter, TRUE, LAYOUT_SpaceInner, FALSE, LAYOUT_AddChild, OBJ(OBJ_PREVIEW_BTN) = IIntuition->NewObject(ButtonClass, NULL, //"button.gadget", GA_ID, OBJ_PREVIEW_BTN, GA_RelVerify, TRUE, GA_Underscore, 0, BUTTON_BevelStyle, BVS_NONE, BUTTON_Transparent, TRUE, //BUTTON_BackgroundPen, BLOCKPEN, //BUTTON_FillPen, BLOCKPEN, TAG_DONE), CHILD_MaxWidth, 256, // pixels width of preview CHILD_MaxHeight, 224, // pixels height of preview TAG_DONE), .. if(MaxWinSize) { // Add preview box-cover image to General page/tab OBJ(OBJ_BOXCOVER_IMG) = IIntuition->NewObject(BitMapClass, NULL, //"bitmap.image", BITMAP_SourceFile, ROMS"/Covers3D/availablecover3d.png", BITMAP_Screen,screen, BITMAP_Masking,TRUE, TAG_DONE); if( OBJ(OBJ_BOXCOVER_IMG) ) IIntuition->IDoMethod(OBJ(OBJ_PREVIEWS), LM_ADDIMAGE, pwindow, OBJ(OBJ_BOXCOVER_IMG), NULL); } if( (pwindow=(struct Window *)IIntuition->IDoMethod(OBJ(OBJ_MAIN), WM_OPEN, NULL)) ) { ...
it shows ok the image, but when I choose an entry from a listbrowser I want that such image (like the one from the button) changes too:
... IIntuition->IDoMethod( OBJ(OBJ_PREVIEWS), LM_REMOVECHILD, pw, OBJ(OBJ_BOXCOVER_IMG) ); OBJ(OBJ_BOXCOVER_IMG) = IIntuition->NewObject(BitMapClass, NULL, //"bitmap.image", BITMAP_SourceFile, covers3d, BITMAP_Screen,screen, BITMAP_Masking,TRUE, TAG_DONE); if( OBJ(OBJ_BOXCOVER_IMG) ) { IIntuition->IDoMethod(OBJ(OBJ_PREVIEWS), LM_ADDIMAGE, pwindow, OBJ(OBJ_BOXCOVER_IMG), NULL); ...
But I'm missing what function do I need to call for refreshing and thus shows the new image until now haven't find the proper one. As I can see the new image if a resize the window or change from page/tab.
BTW could I use LM_MODIFYCHILD instead of LM_ADDIMAGE? How?
I tried with RefreshGList(), RefreshPageGadget() and RefreshGadgets(), but no luck, maybe I'm passing some wrong values?
TIA
IIntuition->IDoMethod((Object *)Objects[OID_WINDOW],WM_RETHINK);
After add/remove. With your window object name.
Ok, thanks will try that ASAP.
AOS4.1/SAM460ex/PPC460EX-1155MHZ/2048MB/RadeonHD6570/SSD120GB/DVDRW :-P