Re: [Win32lib] setPenColor
- Posted by Wolf <wolfritz at KING.IGS.NET> Jun 16, 2002
- 482 views
> setPenColor must now be called with every drawLine( ). Interesting dilemma, isn't it ? Every call to drawLine(), calls createPen(), which calls replaceObject(), which calls xSelectObject(). ... so how's win32lib supposed to know, in advance, that we're done with this pen, so it can restore the previous one, which it should do before the *next* call to setPenColor, etc ? I think that any 'fix' would entail *forcing* the programmer to call a function to restore the previous pen, when done with the current one, or else, or otherwise! ... and this would apply to pen width, and style, as well... Pardon my rambling... but it seems to me that createPen() could be doing some tracking *before* it actually calls xCreatePen(). i.e: IF we've been here before, ... with the same id/hdc, ...... we should restore the previous pen *before* .......... creating another pen for the same id/hdc. , or, is that what's happening already?