It is wrong approach. From you Notify you should call only method, namely
YouCanvas->Update();
All Draw() methods must be call "in advance" and "at once". When you
decided
that histogram must be present on that Canvas. I can repeat what I said with
my last reply:
There is no means to call any Draw() in loop.
Draw method INCLUDES the pointer of your object into the list of the object
of some
particular Pad. Apparently there is no means to include your object into the
said list
SEVERAL times the only result of that could be: your application will work
slow.
> First at all it
> may be a very time consuming, especially if I draw histograms with "fancy"
> options like "cont" for 2D, etc. On the other hand a user can only view a
> certain number of canvas/histograms at once. Moreover canvas can be
> overlapped so that only a few histograms in canvas need to be actually
> redrawn. What can you suggest in this case? Having in mind my experience
> working with other winlibs starting from Borland TurboVision I know that
> Object->Draw() checks if the Object is not hidden by other objects on the
> screen. Then it goes through the actual drawing. Moreover it checks if its
> children is not hidden before calling Children->Draw() for its Z
> buffer. In
> root it seems that Hist->Draw() does much more than just drawing, while
> Hist->Show() does similar things. The problem is that I have to use Draw()
> to update histogram because its content is changing dynamically.
>
Hello Anton I have explained the "drawing" is performed by TObject::Paint
method.
and this method is called by TPad, not by user code at all.
So one can gain nothing playing with Draw methods.
This matter have been discussed on rootalk many times. Please use "Search"
facility of the ROOT Web page to get further explanations.
Hope this helps,
Valery