473,378 Members | 1,364 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

PythonWin dynamic toolbar

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

Jul 18 '05 #1
0 1463

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Martin Bless | last post by:
IMHO PythonWin is great help in developing. How can I do something like: if detect("running on PythonWin"): pass # fake arguments ... else: "proceed normal"
14
by: Jive | last post by:
I've un-installed Python 2.4, re-installed Python 2.3 and PythonWin for 2.3, but it's still broke. When I start PythonWin, sometimes it looks like it is going to be okay. But as soon as I open...
4
by: Chris P. | last post by:
I've been having a problem with PythonWin that seemed to start completely spontaneously and I don't even know where to START to find the answer. The only thing I can think of that marks the point...
1
by: jean-marc | last post by:
I read that Tkinter and Python IDEs (PythonWin and Idle at least) makes for a bad mix in execution mode because they're fighting for the event loop, but this mode is usefull to use the debugger. ...
3
by: Nancy | last post by:
Hi, I am working on a project where I have to make a form list static, i.e. put in links so that users can choose a local file. As it stands, it's looking for a php file. Here's an example of the...
0
by: Hertha Steck | last post by:
Using Python 2.5 with pywin32 build 210 on Windows XP Home, first try with PythonWin after installation of this version. Here are the header lines from the interactive window: PythonWin 2.5...
3
by: archaegeo | last post by:
I am getting started in Python, and I have looked on both the stackless page and python.org and cannot find the answer to what I think is a simple problem. If I start the python command line or...
0
by: nbancajas | last post by:
hello everyone, i need some help regarding my python code. it is a medical plotter/display program with wxagg backend. it reads 3 kinds of data from a text file: ecg, heart rate, and oxygen...
4
by: sterling | last post by:
I'm curious as to why the difference between IDLE and pythonWin when using win32com. opening an excel file, i've attempted to grab the chart information out of the file. commands like co =...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.