Creating Image Maps

A

Aaron

I know this is a thing used primarily on websites..but since python can do
anything ;)

I'm trying to make a clickable image map for my wxPython program.
Basically, I know how to organize the images into one large image in a
panel, but how do I make the individual pieces clickable like webpage
links(in wxPython)? The goal is to add an event handler that displays the
image piece in a different panel, along with attributes. Which I could do
if only I could make the pieces clickable

Any ideas?

Also, if you have any hard to find links on the general area I'm talking
about, I'd like to learn as much as possible.

-thanks
 
M

M.E.Farmer

Hello Aaron,
You need to check the demo that comes with wxPython if you don't
have it get it. Look under wxHtmlWindow and click the demo tab then
just scroll down and there is a link to it that says IMAGEMAP.
Or in other words RTFD ;)
M.E.Farmer
 
S

Steve Holden

Aaron said:
I know this is a thing used primarily on websites..but since python can do
anything ;)

I'm trying to make a clickable image map for my wxPython program.
Basically, I know how to organize the images into one large image in a
panel, but how do I make the individual pieces clickable like webpage
links(in wxPython)? The goal is to add an event handler that displays the
image piece in a different panel, along with attributes. Which I could do
if only I could make the pieces clickable

Any ideas?

Also, if you have any hard to find links on the general area I'm talking
about, I'd like to learn as much as possible.
Basically, your approach can be completely different under wxPython -
you can use a single image, and then query the mouse click events to
determine which location (and therefore which portion of the image) was
clicked.

You *could* use separate images as well, in which case you would need to
provide callback functions to be called for clicks on the various
sub-portions.

Take a look at the docs for wxEvent, and see if that leads you to
something you can understand.

regards
Steve
 
A

Aaron

Thanks for the responses guys!

The first option you provided sounds great, Steve. I think I'm gonna try
it that way.
 
S

Steve Holden

Aaron said:
Thanks for the responses guys!

The first option you provided sounds great, Steve. I think I'm gonna try
it that way.
OK. It's usually the easiest way if the subsections are at all regular.
If they are irregular it's often the *only* way!

This is a technique that can also be used on the web (Google for
"client-side image map"), but it's very little-used there.

regards
Steve
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top