(no subject)



Hi All,

I'm new to gnomemm programming
and have been trying to get some simple tutorials to work.
Unfortunatly all of the documentation I have found is for palin C bingings 
so I am translating as I go.

I'm trying to get dynamivally generated canvas items to respond to various 
events But have looked through the Documentation (and the canvas_event example
I am still stumped)

I am working with ellipses only in the following.

The behaviour I am trying to achive is
1) Thiken the outline of an item when the mouse pointer enters it
2) Return the outline to normal when the mouse leaves the Item
3) Change item color on a double click
4) Allow items to be draged around the canvas (hold down left mouse button and drag).

My questions:
1) what is the difference between connect & connect_notify
I can't find this anywhere in the documentation
2) Is the canvas_event example up to date. I havn't see nthe sigc::mem_fun function used elsewhere in the Gtkmm docs (the seem to use plain sigc:;slot for the same purpose.
3) Where is GdkEvent defined (why isn't it Gdk::Event)
4) How do I get at the Item that generate the signal so that I can change it's properties, do I need to use bind and pass an addional pointer to the object.

Curently I am trying this

1) I have a member funciton defined void CanvasApp::item_event(GdkEvent* event, Gnome::Canvas::Item* item);
3) I have a newly created & initilized pointer to an ellipse e PS (NOT the initilization code is working as before I started on the signal code I was succesfully displaying ellipses at the push of a button). 

Now I am trying:

*e->signal_event().connect( bind<Gnome::Canvas::Item*>(SigC::Slot(*this, &CanvasApp::item_event),e));

In the Signal Handler I have

switch(event->type){
	case GDK_ENTRY_NOTIFY:
		//handle event
	break
	.	// handle other event types
}

I am yet to get this to compile, let alone acutlaly do something.


Kind Regards

Konrad Zielinski



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]