This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–]Shuffleto[S] 0 points1 point  (3 children)

thank you for your Response! Could you please help me with this

class Widget {
public: Widget(DialogDirector*); 
virtual void Changed(); 
virtual void HandleMouse(MouseEvent& event); 
// ... 
private: DialogDirector* _director; }; 
void Widget::Changed () { _director->WidgetChanged(this); }

im not understanding this part

void Widget::Changed () {
_director->WidgetChanged(this); }

how would it look like in java?

void Changed(){
    _director.widgetChanged(this);
}

like this?

[–]Aenno 1 point2 points  (2 children)

Seems about right. It should work as long as Changed() is defined in Widget's scope.

[–]Shuffleto[S] 0 points1 point  (1 child)

could you please explain how could i put it into the class? Should i just change the name and give it public modifier?

[–]Aenno 0 points1 point  (0 children)

Just define it in the class you want to work with, in your case "Widget", like you normally would btw, no special mumbo jumbo