0

I need to draw a image representing a network equipment (switch , router) the items on that image ( ethernet cards ) would need to be listening for "clickable" onOver events.

I managed to draw a basic idea to test with using the drawing area but will not be able to implement listening events on it.

Any sugestions?

Best regards, FR

PS: The test was drawn using a single context.

Edit: I'm using mono c# and it's a gtk# based application.

kalev
  • 1,925
  • 1
  • 15
  • 12
Fernando André
  • 1,213
  • 3
  • 19
  • 32

1 Answers1

0

Assuming that you're using .NET (you tagged C# on this question so I think that's safe) have you considered using an ImageButton for the clickable items? You would be able to define custom behavior for any event you care to wire up.

This is just a guess from what you've described, but it sounds like a user control would be a good repository for this project. You can define the layout graphically while keeping the code closely associated with what will be utilizing it.

Matt T
  • 511
  • 2
  • 8
  • Sorry, my fault I'm using mono c# and it's a gtk# based application. – Fernando André Feb 22 '12 at 00:12
  • 1
    It's been a while since I last worked in mono, but the concept should translate. If you need to handle mouseOver and Click events for a certain area of the screen, you can place a transparent control over that area (so that the background/lowest level image is visible) while gaining access to the desired events. Just make sure that the transparent control has a screen order higher than the background. – Matt T Feb 22 '12 at 00:17
  • http://stackoverflow.com/questions/650252/gtk-mouse-event-in-drawing-area Found a question like this :-( the method there works, didn't find a question before. Sorry. Thank you for the sugestion and help. – Fernando André Feb 22 '12 at 00:37