Python

NAVIGATION
CATEGORIES
REFERRENCE
LINKS
  • refresh a wxBitmapButton

    10 answers - 348 bytes - related search similar search Add To My Delicious Add To My Stumble Upon Add To My Google Mark Add To My Facebook Add To My Digg Add To My Reddit

    is there a way to refresh a wxBitmapButton so that when i change the image
    on the button it will show the new image, the only way i can achieve this
    efect is to Destroy() the button and recreate it in the same spot but im
    having trouble getting it to place into the FlexGridSizer, it doesnt seem to
    be inside the sizer at all
  • No.1 | | 943 bytes | |

    Try:
    <bitmapbuttonobj>.Show(False)
    <bitmapbuttonobj>.Show(True)

    That should force a repaint.

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:

    >is there a way to refresh a wxBitmapButton so that when i change the image
    >on the button it will show the new image, the only way i can achieve this
    >efect is to Destroy() the button and recreate it in the same spot but im
    >having trouble getting it to place into the FlexGridSizer, it doesnt seem to
    >be inside the sizer at all


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.2 | | 1172 bytes | |

    that does force a repaint but it doesnt change the picture on the button

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:

    Try:
    <bitmapbuttonobj>.Show(False)
    <bitmapbuttonobj>.Show(True)

    That should force a repaint.

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:
    >
    >is there a way to refresh a wxBitmapButton so that when i change the

    image
    >on the button it will show the new image, the only way i can achieve this
    >efect is to Destroy() the button and recreate it in the same spot but im
    >having trouble getting it to place into the FlexGridSizer, it doesnt seem

    to
    >be inside the sizer at all
    >


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    --
  • No.3 | | 515 bytes | |

    justin mcguire wrote:
    is there a way to refresh a wxBitmapButton so that when i change the
    image on the button it will show the new image, the only way i can
    achieve this efect is to Destroy() the button and recreate it in the
    same spot but im having trouble getting it to place into the
    FlexGridSizer, it doesnt seem to be inside the sizer at all

    This:

    btn.SetBitmap(newBitmap)
    btn.Refresh()

    should do it. If not then it is a bug. Which platform and version are
    you using?
  • No.4 | | 2069 bytes | |

    Are you doing the SetBitmap*() functions to set the new bitmaps before
    attempting a refresh?

    Works fine here

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 10:01:15 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:

    >that does force a repaint but it doesnt change the picture on the button
    >

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>

    >Try:
    ><bitmapbuttonobj>.Show(False)
    ><bitmapbuttonobj>.Show(True)
    >>

    >That should force a repaint.
    >>

    >Christoper L. Spencer
    >CT RXX, LLC
    >4515 Leslie Ave.
    >Cincinnati, H
    >45242
    >TEL: 513-545-7057
    >EMAIL: chris (AT) roxx (DOT) biz
    >>

    >Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    ><jherrico (AT) gmail (DOT) comwrote:
    >>
    >>is there a way to refresh a wxBitmapButton so that when i change the

    >image
    >>on the button it will show the new image, the only way i can achieve this
    >>efect is to Destroy() the button and recreate it in the same spot but im
    >>having trouble getting it to place into the FlexGridSizer, it doesnt seem

    >to
    >>be inside the sizer at all
    >>

    >
    >To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>
    >>


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.5 | | 2548 bytes | |

    when i try to do <btn>.SetBitmap i get this error:

    AttributeError: 'BitmapButton' object has no attribute 'SetBitmap'

    im using windows xp and wxpython 2.5 with python 2.4

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:

    Are you doing the SetBitmap*() functions to set the new bitmaps before
    attempting a refresh?

    Works fine here

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 10:01:15 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:
    >
    >that does force a repaint but it doesnt change the picture on the button
    >

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>

    >Try:
    ><bitmapbuttonobj>.Show(False)
    ><bitmapbuttonobj>.Show(True)
    >>

    >That should force a repaint.
    >>

    >Christoper L. Spencer
    >CT RXX, LLC
    >4515 Leslie Ave.
    >Cincinnati, H
    >45242
    >TEL: 513-545-7057
    >EMAIL: chris (AT) roxx (DOT) biz
    >>

    >Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    ><jherrico (AT) gmail (DOT) comwrote:
    >>
    >>is there a way to refresh a wxBitmapButton so that when i change the

    >image
    >>on the button it will show the new image, the only way i can achieve

    this
    >>efect is to Destroy() the button and recreate it in the same spot but

    im
    >>having trouble getting it to place into the FlexGridSizer, it doesnt

    seem
    >to
    >>be inside the sizer at all
    >>

    >
    >To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail:

    wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>
    >>

    >


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    --
  • No.6 | | 3661 bytes | |

    There is no such method as "SetBitmap"

    You must use "SetBitmapLabel"

    I'd suggest looking at the reference docs under wxBitmapButton for
    more information.

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 11:03:47 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:

    >when i try to do <btn>.SetBitmap i get this error:
    >
    >AttributeError: 'BitmapButton' object has no attribute 'SetBitmap'
    >
    >im using windows xp and wxpython 2.5 with python 2.4
    >

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>

    >Are you doing the SetBitmap*() functions to set the new bitmaps before
    >attempting a refresh?
    >>

    >Works fine here
    >>

    >Christoper L. Spencer
    >CT RXX, LLC
    >4515 Leslie Ave.
    >Cincinnati, H
    >45242
    >TEL: 513-545-7057
    >EMAIL: chris (AT) roxx (DOT) biz
    >>

    >Tue, 22 Aug 2006 10:01:15 -0700, "justin mcguire"
    ><jherrico (AT) gmail (DOT) comwrote:
    >>
    >>that does force a repaint but it doesnt change the picture on the button
    >>

    >8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>>

    >>Try:
    >><bitmapbuttonobj>.Show(False)
    >><bitmapbuttonobj>.Show(True)
    >>>

    >>That should force a repaint.
    >>>

    >>Christoper L. Spencer
    >>CT RXX, LLC
    >>4515 Leslie Ave.
    >>Cincinnati, H
    >>45242
    >>TEL: 513-545-7057
    >>EMAIL: chris (AT) roxx (DOT) biz
    >>>

    >>Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    >><jherrico (AT) gmail (DOT) comwrote:
    >>>
    >>>is there a way to refresh a wxBitmapButton so that when i change the

    >>image
    >>>on the button it will show the new image, the only way i can achieve

    >this
    >>>efect is to Destroy() the button and recreate it in the same spot but

    >im
    >>>having trouble getting it to place into the FlexGridSizer, it doesnt

    >seem
    >>to
    >>>be inside the sizer at all
    >>>

    >>
    >>To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >>For additional commands, e-mail:

    >wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>>
    >>>

    >>

    >
    >To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>
    >>


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.7 | | 195 bytes | |

    unless im reading it wrong Robin told me:
    This:
    btn.SetBitmap(newBitmap)
    btn.Refresh()
    should do it. If not then it is a bug. Which platform and version are
    you using?
  • No.8 | | 5566 bytes | |

    Robin was wrong. Please look at the docs.

    Christoper L. Spencer
    CT RXX, LLC
    4515 Leslie Ave.
    Cincinnati, H
    45242
    TEL: 513-545-7057
    EMAIL: chris (AT) roxx (DOT) biz

    Tue, 22 Aug 2006 11:27:29 -0700, "justin mcguire"
    <jherrico (AT) gmail (DOT) comwrote:

    >unless im reading it wrong Robin told me:
    >

    This:
    >>

    >btn.SetBitmap(newBitmap)
    >btn.Refresh()
    >>

    >should do it. If not then it is a bug. Which platform and version are
    >you using?
    >>

    >--
    >Robin Dunn
    >Software Craftsman
    >http://wxPython.org <http://wxpython.org/Java give you jitters? Relax
    >with wxPython!
    >
    >
    >in a previous reply, which is why i did it
    >

    8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>

    >There is no such method as "SetBitmap"
    >>

    >You must use "SetBitmapLabel"
    >>

    >I'd suggest looking at the reference docs under wxBitmapButton for
    >more information.
    >>

    >Christoper L. Spencer
    >CT RXX, LLC
    >4515 Leslie Ave.
    >Cincinnati, H
    >45242
    >TEL: 513-545-7057
    >EMAIL: chris (AT) roxx (DOT) biz
    >>
    >>

    >Tue, 22 Aug 2006 11:03:47 -0700, "justin mcguire"
    ><jherrico (AT) gmail (DOT) comwrote:
    >>
    >>when i try to do <btn>.SetBitmap i get this error:
    >>
    >>AttributeError: 'BitmapButton' object has no attribute 'SetBitmap'
    >>
    >>im using windows xp and wxpython 2.5 with python 2.4
    >>

    >8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>>

    >>Are you doing the SetBitmap*() functions to set the new bitmaps before
    >>attempting a refresh?
    >>>

    >>Works fine here
    >>>

    >>Christoper L. Spencer
    >>CT RXX, LLC
    >>4515 Leslie Ave.
    >>Cincinnati, H
    >>45242
    >>TEL: 513-545-7057
    >>EMAIL: chris (AT) roxx (DOT) biz
    >>>

    >>Tue, 22 Aug 2006 10:01:15 -0700, "justin mcguire"
    >><jherrico (AT) gmail (DOT) comwrote:
    >>>
    >>>that does force a repaint but it doesnt change the picture on the

    >button
    >>>

    >>8/22/06, Chris Spencer <cspencer (AT) cinci (DOT) rr.comwrote:
    >>>>
    >>>Try:
    >>><bitmapbuttonobj>.Show(False)
    >>><bitmapbuttonobj>.Show(True)
    >>>>
    >>>That should force a repaint.
    >>>>
    >>>Christoper L. Spencer
    >>>CT RXX, LLC
    >>>4515 Leslie Ave.
    >>>Cincinnati, H
    >>>45242
    >>>TEL: 513-545-7057
    >>>EMAIL: chris (AT) roxx (DOT) biz
    >>>>
    >>>Tue, 22 Aug 2006 09:48:25 -0700, "justin mcguire"
    >>><jherrico (AT) gmail (DOT) comwrote:
    >>>>
    >>>>is there a way to refresh a wxBitmapButton so that when i change

    >the
    >>>image
    >>>>on the button it will show the new image, the only way i can

    >achieve
    >>this
    >>>>efect is to Destroy() the button and recreate it in the same spot

    >but
    >>im
    >>>>having trouble getting it to place into the FlexGridSizer, it

    >doesnt
    >>seem
    >>>to
    >>>>be inside the sizer at all
    >>>>
    >>>>

    >
    >>>To unsubscribe, e-mail:

    >wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >>>For additional commands, e-mail:

    >>wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>>>
    >>>>
    >>>

    >>
    >>To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >>For additional commands, e-mail:

    >wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>>
    >>>

    >>

    >
    >To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    >For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
    >>
    >>


    To unsubscribe, e-mail: wxPython-users-unsubscribe (AT) lists (DOT) wxwidgets.org
    For additional commands, e-mail: wxPython-users-help (AT) lists (DOT) wxwidgets.org
  • No.9 | | 326 bytes | |

    justin mcguire wrote:

    unless im reading it wrong Robin told me:

    This:

    btn.SetBitmap(newBitmap)
    btn.Refresh()

    should do it. If not then it is a bug. Which platform and version are
    you using?

    Sorry, I was thinking about wx.StaticBitmap. SetBitmapLabel should work
    for wx.BitmapButton.
  • No.10 | | 426 bytes | |

    that did it thanks

    8/22/06, Robin Dunn <robin (AT) alldunn (DOT) comwrote:

    justin mcguire wrote:

    unless im reading it wrong Robin told me:
    --
    This:

    btn.SetBitmap(newBitmap)
    btn.Refresh()

    should do it. If not then it is a bug. Which platform and version
    are
    you using?
    --
    Sorry, I was thinking about wx.StaticBitmap. SetBitmapLabel should work
    for wx.BitmapButton.

Re: refresh a wxBitmapButton


max 4000 letters.
Your nickname that display:
In order to stop the spam: 1 + 0 =
QUESTION ON "Python"

EMSDN.COM