[prev in list] [next in list] [prev in thread] [next in thread]
List: gtkmm
Subject: [gtkmm] How to notify the parent?
From: "Chan Siu On" <siuonchan () hotmail ! com>
Date: 2001-06-23 9:58:40
[Download RAW message or body]
Hello,
Assume that there is a class MyDrawingArea inherited from Gtk::DrawingArea,
and a class MyWindow inherited from Gtk::Window.
If MyWindow has a child of class MyDrawingArea and the child has received
certain signals, says the user has pressed and then released a mouse
button, how can the child notify the parent that it has received such a
signal?
Sometimes I have to do some processing in
MyDrawingArea::button_release_event_impl(). It would be nice if I do not
connect MyDrawingArea::button_release_event directly to a method of
MyWindow, but instead I create a new signal member field for MyDrawingArea,
says MyDrawingArea::special_event, and connect this field to a method of
MyWindow.
I've tried to do so with SigC++ but failed. When the program is running,
error messages appear saying something like 'cannot find a name "null"' or
'cannot find <handle_id>'.
Here is part of my source code:
void mydrawingarea_special_event(GtkDrawingArea *drawingarea);
class MyDrawingArea : public Gtk::DrawingArea
{
...
public:
union
{
// I've tried to set this field to 'this' in the constructor
CppObjectType *drawingarea_self;
// In the line below, the fourth field in <void, ...> may be the
cause of the error - I don't know how to fill this field properly or what
should be done if it is filled with 0
EmitProxySignal0<void, CppObjectType, BaseObjectType, 0,
&mydrawingarea_special_event> special_event;
};
};
What's wrong with the class MyDrawingArea? Or is there any simpler method
to notify the parent?
_________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.com.
_______________________________________________
to unsubscribe or change your subscription parameters :
http://lists.sourceforge.net/lists/listinfo/gtkmm-main
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic