Are you running windows?? I've had problems on the few tests I've done
here.
No, I'm running Linux.
> This is a pretty good way to do zoom/pan/scroll. I have to think if that
> is something that would work well in my application. What I'm interested
> in is drawing graphical objects (like rectangles and lines) over an
> image. These graphics can be moved/resized with a mouse. If you zoom on
> the image, the graphics should grow as well and still be movable from
> their new locations.
>
> Last time I tried this, I didn't translate the coordinates properly and
> after a zoom and pan, when I moved the rectangle it popped up at a
> different part of the screen. At the time I gave up (there were other
> things more important) but now I'm thinking about it again.
I haven't made any way to deal with bitmapped images, though I may add
it in the future. If you have a way to zoom the image (I imagine wxImage
can do it) then the rest of my code should do fine for you.
I also haven't added the interactive abilities, but again, that's on my
list.
I'm having a couple of problems with toolbars on Windows. What I have
done works just great on Linux with GTK (at lest 2 versions of
wxPython), but doesn't work well on Windows.
What I am doing that is not in the demo is creating the toolbar, and
then placing it on a panel with a sizer, so that it can part of a
composite control.
On GTK, this all works fine, on MSW, the buttons dpon't get drawn
correctly. I've tried it on a couple of different wxPython and windows
versions, and most don't display the toos correctly, but do display the
button correctly, and one (Win2k, Python2.1 wxPython 2.3.0) displays
half of one button, and nothing else. The half button does work.
The exact saem toolbar code, when called with wxFrame.CreateToolBar(),
seems to work fine.
The other issue is that MSW seems to insist that the toolbar be a
certain hieght, even though the tools I'm trying to put on it are
larger. Is my only choice to make my bitmaps smaller? or can I make the
toolbar bigger?
I have attached some sample code that demonstrates the problem. Clicking
on the buttons prints to stdout, so start it from a console to see if
the buttons work.
What I am doing that is not in the demo is creating the toolbar, and
then placing it on a panel with a sizer, so that it can part of a
composite control.
On GTK, this all works fine, on MSW, the buttons dpon't get drawn
correctly. I've tried it on a couple of different wxPython and windows
versions, and most don't display the toos correctly, but do display the
button correctly, and one (Win2k, Python2.1 wxPython 2.3.0) displays
half of one button, and nothing else. The half button does work.
You need to use the wxEXAPND flag when you add the toolbar to the sizer.
That will tell the sizer to resize the toolbar to fill the width of your
panel and without it the toolbar will remain whatever its default size is.
The exact saem toolbar code, when called with wxFrame.CreateToolBar(),
seems to work fine.
Because the frame manages the size of the toolbar.
The other issue is that MSW seems to insist that the toolbar be a
certain hieght, even though the tools I'm trying to put on it are
larger. Is my only choice to make my bitmaps smaller? or can I make the
toolbar bigger?
Use the toolbar.SetToolBitmapSize method.
···
--
Robin Dunn
Software Craftsman
robin@AllDunn.com Java give you jitters? http://wxPython.org Relax with wxPython!
You need to use the wxEXAPND flag when you add the toolbar to the sizer.
That will tell the sizer to resize the toolbar to fill the width of your
panel and without it the toolbar will remain whatever its default size is.
Thanks, that did the trick
> or can I make the
> toolbar bigger?
Use the toolbar.SetToolBitmapSize method.
Thanks, that did the trick also.
Robin, you absolutely provide the best support anywhere, for any price.
-Chris
···
--
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