Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Python > PythonWin dynamic toolbar

Reply
Thread Tools

PythonWin dynamic toolbar

 
 
Ilariu Raducan
Guest
Posts: n/a
 
      07-07-2003
Hi All,
I'm trying to create a dynamic toolbar.
This function tries to create the toolbar and add a button to it.
It craches at tbctrl.SteBitmapSize(32,32)

What is wrong with it?

Thank you,
Lale


def OnCreateClient(self,context,obj):
window.MDIChildWnd.OnCreateClient(self,context,obj )
parent = self
style = win32con.WS_CHILD | win32con.WS_VISIBLE |
afxres.CBRS_SIZE_DYNAMIC | afxres.CBRS_TOP | \
afxres.CBRS_TOOLTIPS | afxres.CBRS_FLYBY
self.toolbar = tb = win32ui.CreateToolBar (parent, style)
tbctrl = tb.GetToolBarCtrl()
tbctrl.SetBitmapSize(32,32)
bmp = win32ui.CreateBitmap()
bmp.LoadBitmapFile(open('importimages.bmp','r'))
bmpIndex = tbctrl.AddBitmap(1,bmp)
tbctrl.AddStrings('rect\0point\0poligon\0')
tbutton = tbctrl.TBUTTON
tbutton[0]=(bmpIndex,868,win32con.TBSTATE_ENABLED,
win32con.TBSTYLE_BUTTON,None,0)
tbctrl.AddButtons(1,tbutton)
tb.EnableDocking(afxres.CBRS_ALIGN_ANY)
tb.SetWindowText("Test")
parent.EnableDocking(afxres.CBRS_ALIGN_ANY)
parent.DockControlBar(tb)
print tbctrl.GetButtonCount()
return 1

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
window.open with toolbar=1 and without google toolbar ? pcouas Javascript 0 02-19-2007 08:28 AM
Toolbar behind toolbar help pls? Dribbler Computer Support 4 05-01-2005 11:10 AM
pythonwin and german chars, does anybody use pythonwin in non-us stephan Python 0 07-30-2003 09:26 AM
Retrieving commands history on Pythonwin Adam Python 0 07-25-2003 10:12 PM
Where can one get Python 1.4 and Pythonwin 1.0? Richard Lee Python 2 07-22-2003 01:39 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57