Ok...I think there is too much blood in my caffeine system today...
Here's the short of it:
Got a wxScrolledWindow. Upon this window I have a label, a button and a
bitmap image.
The button is used to "get next image".
For my 'OnPaint' method, I get my DC, I PrepareDC(), I BeginDrawing().
Since the images can be of different sizes I do a dc.Clear() before
drawing the next bitmap and label.
I then EndDrawing()
First time thru...label, button and first image all there.
I click the button...next label, new bitmap...but button disappears.
If I click on the area where the button is "supposed" to be...it works.
(down-click and button shows up) Button disappears again on next image
draw.
For the life of me I can't get the button to show-back-up/stay visible.
So...would some kind soul stop me from spinning and point me in the
right direction?
Windows 2K
wxPython 2.4.1.2u
Python 2.2.2
For what it's worth, I manually call my OnPaint event method and check
to see if I have a 'valid' event and if so dc is a wxPaintDC, if no
event then dc is a wxClientDC.
Much thanx!
···
--
Jim West
The box said Windows 95 or better, so I installed Linux.
Ok...I think there is too much blood in my caffeine system today...
Here's the short of it:
Got a wxScrolledWindow. Upon this window I have a label, a button and a
bitmap image.
The button is used to "get next image".
For my 'OnPaint' method, I get my DC, I PrepareDC(), I BeginDrawing().
Since the images can be of different sizes I do a dc.Clear() before
drawing the next bitmap and label.
I then EndDrawing()
First time thru...label, button and first image all there.
I click the button...next label, new bitmap...but button disappears.
If I click on the area where the button is "supposed" to be...it works. (down-click and button shows up) Button disappears again on next image
draw.
For the life of me I can't get the button to show-back-up/stay visible.
So...would some kind soul stop me from spinning and point me in the
right direction?
Windows 2K
wxPython 2.4.1.2u
Python 2.2.2
For what it's worth, I manually call my OnPaint event method and check
to see if I have a 'valid' event and if so dc is a wxPaintDC, if no
event then dc is a wxClientDC.
Much thanx!
It sounds like the button isn't getting a repaint event. Maybe you need to trigger the whole control that contains both the image and the button. you can call its Refresh(False) method to trigger it to get a wxPaintEvent (if I understand this correctly).
I had at one point tried .Refresh()...but I believe I used True instead
of False.
It was definitely one of *those* days yesterday.
- Jim_who_picked_a_bad_day_to_give_up_caffeine
···
On Tue, 2003-10-28 at 17:14, Barry Tolnas wrote:
Jim West wrote:
>Ok...I think there is too much blood in my caffeine system today...
>
>Here's the short of it:
>
>Got a wxScrolledWindow. Upon this window I have a label, a button and a
>bitmap image.
>
>The button is used to "get next image".
>
>For my 'OnPaint' method, I get my DC, I PrepareDC(), I BeginDrawing().
>
>Since the images can be of different sizes I do a dc.Clear() before
>drawing the next bitmap and label.
>
>I then EndDrawing()
>
>First time thru...label, button and first image all there.
>
>I click the button...next label, new bitmap...but button disappears.
>
>If I click on the area where the button is "supposed" to be...it works.
>(down-click and button shows up) Button disappears again on next image
>draw.
>
>For the life of me I can't get the button to show-back-up/stay visible.
>
>So...would some kind soul stop me from spinning and point me in the
>right direction?
>
>Windows 2K
>wxPython 2.4.1.2u
>Python 2.2.2
>
>For what it's worth, I manually call my OnPaint event method and check
>to see if I have a 'valid' event and if so dc is a wxPaintDC, if no
>event then dc is a wxClientDC.
>
>Much thanx!
>
>
>
It sounds like the button isn't getting a repaint event. Maybe you need
to trigger the whole control that contains both the image and the
button. you can call its Refresh(False) method to trigger it to get a
wxPaintEvent (if I understand this correctly).
Barry
---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org
It sounds like the button isn't getting a repaint event. Maybe you need to trigger the whole control that contains both the image and the button. you can call its Refresh(False) method to trigger it to get a wxPaintEvent (if I understand this correctly).
You can also try using the wxCLIP_CHILDREN style flag on the parent of the button. Then when the image is drawn it won't be drawn over the child window and there should be no need to Refresh the button, and flicker should be reduced.
···
--
Robin Dunn
Software Craftsman http://wxPython.org Java give you jitters? Relax with wxPython!