ASPN ActiveState Programmer Network
ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups


Recent Messages
List Archives
About the List
List Leaders
Subscription Options

View Subscriptions
Help

View by Topic
ActiveState
.NET Framework
Open Source
Perl
PHP
Python
Tcl
Web Services
XML & XSLT

View by Category
Database
General
SOAP
System Administration
Tools
User Interfaces
Web Programming
XML Programming


MyASPN >> Mail Archive >> wxPython-users
wxPython-users
Re: [wxPython] wxToolBar and wxBitmaps
by Chris Barker other posts by this author
Apr 29 2002 6:20PM messages near this date
Re: [wxPython] wxToolBar and wxBitmaps | [wxPython] Hooking into the window destruction sequence
M Russo wrote:
>  Is there no way to:
>  
>  1. dynamically change the bitmap of a toolbar button at runtime?

I'm not sure about this one

>  2. assign a bitmap to a toolbar button from data in code (as opposed to
>  loading from a file) using that generated by img2py.py?

sure is. Below is the relevant code cut and pasted from something of
mine:


def GetHandData():
    return cPickle.loads(zlib.decompress(
'x\xda\xd3\xc8)0\xe4\nV72T\x00!\x05Cu\xae\xc4`u=\x85d\x05\xa7\x9c\xc4\xe4l0O\x01\xc8S\xb6t\x
06A(\x1f\x0b\xa0\xa9\x8c\x9e\x1e6\x19\xa0\xa8\x1e\x88\xd4C\x97\xd1\x83\xe8\x80
\x9c2zh\xa6\xc1\x11X\n\xab\x8c\x02\x8a\x0cD!\x92\x12\x98\x8c\x1e\x8a\x8b\xd1d\x14\xf4\x90%\x
90LC\xf6\xbf\x1e\xba\xab\x91%\xd0\xdc\x86C\x06\xd9m\xe8!\xaa\x87S\x86\x1a1\xa7\x07\x00v\x0f[
\x17' ))

def GetHandBitmap():
    return wxBitmapFromXPMData(GetHandData())


tb.AddTool(ID_MOVE_MODE_BUTTON,
GetHandBitmap(),isToggle=true,shortHelpString = "Move")

-CHB




-- 
Christopher Barker, Ph.D.
Oceanographer
                                    		
NOAA/OR&R/HAZMAT         (206) 526-6959   voice
7600 Sand Point Way NE   (206) 526-6329   fax
Seattle, WA  98115       (206) 526-6317   main reception

Chris.Barker@[...].gov

_______________________________________________
wxpython-users mailing list
wxpython-users@[...].org
http://lists.wxwindows.org/mailman/listinfo/wxpython-users

Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState Software Inc. All rights reserved