lib/Context/Widget.rb in context-0.0.16 vs lib/Context/Widget.rb in context-0.0.22
- old
+ new
@@ -1,40 +1,31 @@
module Context
+ # This is the Widget mixin for Context. If you wish to be able
+ # to add to, add, or remove a widget inside a View using context,
+ # this mixin must be included. This is an abstract mixin. The
+ # methods do nothing. They should be overriden in the concrete
+ # mixins. Please see Context::Gtk::Widget for an example.
+ module Widget
- class Widget
+ # This method creates any instance variables that you might have.
+ def setupWidget
+ end
- attr_reader :delegate
-
- def initialize(delegate)
- @delegate = delegate
+ # Use this widget as a container for the passed widget
+ def addToThisWidget(widget)
end
-
+
+ # Remove the passed widget from this object.
+ def removeFromThisWidget(widget)
+ end
+
# This method is called after the widget has been
# successfully added to another widget
- def addedTo(widget)
- # This is an abstract method, the child classes should
- # implement this
+ def widgetWasAddedTo(widget)
end
# This method is called after the widget has been
# successfully removed from another widget
- def removedFrom(widget)
- # This is an abstract method, the child classes should
- # implement this
- end
-
- # Use this widget as a container for the passed widget
- def add(widget)
- # This is an abstract method, the child classes should
- # implement this
- end
-
- def remove(widget)
- # This is an abstract method, the child classes should
- # implement this
- end
-
- def eql?(widget)
- @delegate.eql?(widget.delegate)
+ def widgetWasRemovedFrom(widget)
end
end
end