From: s37732v@snakemail.hut.fi (Markus Juhani Aalto)
Newsgroups: comp.sys.amiga.programmer
Subject: Re: Regions and BOOPSI gadgets?
Date: 09 Jan 93 09:50:23 GMT
Organization: Helsinki University of Technology, Finland
Distribution: comp
NNTP-Posting-Host: lk-hp-7.hut.fi
In-reply-to: dkeller@rain.fishkill.ibm.com's message of Fri, 08 Jan 93 23:10:45 GMT

In article <1993Jan08.231045.25479@watson.ibm.com> dkeller@rain.fishkill.ibm.com (Douglas Keller) writes:

   In article <S37732V.93Jan8183438@lk-hp-20.hut.fi> s37732v@snakemail.hut.fi (Markus Juhani Aalto) writes:
   >to the rastport. I currently InstallClipRegion when I get GM_RENDER
   >message and do my rendering after that. This works fine when I open
   >the gadgets but after I size the window all clipping goes absolutely
   >out of control. So is there a possible way to use Regions in BOOPSI
   >gadgets? 

   I think Intuition removes all layers regions during a resize.

   doug

Hmm. I didn't know that, but it shouldn't make any difference.

I'll describe little better the problem.

------------------
 I open the window.
 Create the gadgtools and boopsi gadget and install them to window.
 I refresh gadgets.

 So far everything is OK, All gadgets come up nicely and I can even use my
 BOOPSI listview gadget and it works OK.

 Then I size window and after I release sizing gadget only parts of the
 display is drawed properly and old stuff is leaving behind even if I
 called RectFill to fill the whole window interior with background color.
 This worked find before I started using regions in my boopsi gadgets.

-----------------

Here is a part of my BOOPSI listview gadget routine.

-----------------
        case GM_RENDER:
            lvw = (struct ListViewClass *)INST_DATA( cl, o);
            {
                struct gpRender *gpr = (struct gpRender *)msg;
                ULONG Count = lvw->ItemToRender;
                REND_FUNC func = lvw->ItemRenderer;
                struct Node *node = lvw->topNode;

                if(gpr->gpr_Redraw == GREDRAW_UPDATE) {
		    /* Here I install clip region for my window.
                       I have allocated it properly in the OM_NEW
		       code.
		    */
                    InstallListViewClipRegion((struct Gadget *)o,
                            gpr->gpr_GInfo,lvw);
                    if(Count == 0) {
                        while(Count < lvw->Visible) {
                            RetVal = (*func)(node, (struct Gadget *)o,
                                    gpr,Count,lvw->RenderString);
                            if(node) {
                                node = NextNode(node);
                                if( IsLastNode(node) ) {
                                    node = NULL;
                                }
                            }
                            Count += 1;
                        }
                    }
                    else {
                        node = GetTopNode(lvw->listToShow,lvw->TopVal+Count-1);
                        RetVal = (*func)(node, (struct Gadget *)o,
                                gpr,Count-1,lvw->RenderString);
                    }
 		   /* Here I delete clip region if it was installed. */ 
                   DeleteListViewClipRegion(gpr->gpr_GInfo,lvw);
                }
                else {
                    DrawImageState( gpr->gpr_RPort,
                            lvw->FrameImage,
                            0, 0, IDS_NORMAL,
                            gpr->gpr_GInfo->gi_DrInfo );

                    InstallListViewClipRegion((struct Gadget *)o,
                            gpr->gpr_GInfo,lvw);
                    Count = 0;
                    while(Count < lvw->Visible) {
                        RetVal = (*func)(node, (struct Gadget *)o,
                                gpr,Count,lvw->RenderString);
                        if(node) {
                            node = NextNode(node);
                            if( IsLastNode(node) ) {
                                node = NULL;
                            }
                        }
                        Count++;
                    }
                    DeleteListViewClipRegion(gpr->gpr_GInfo,lvw);
                }
            }
            break;
-------------------------------

I hope someone can help me with this one. The function I'm calling
in code is a rendering function for the listview.
--


**************************************************************************
*         Markus Aalto              | Helsinki University of Technology  *
*                                   |                                    *
*  EMail: s37732v@vipunen.hut.fi    | Faculty of Electric Engineering    *
*  Fax:   358-0-8746991 (Sometimes) |                                    *
*                                   | Undergraduate in Computer Science  *
**************************************************************************
        
Newsgroups: comp.sys.amiga.programmer