J
Joe Van Dyk
So, I have a bunch of objects that are responsible for drawing on something
on the screen (in this case, a GnomeCanvas object).
Say I need to have a grid drawn on this canvas. In order to draw a line, I
need to call Gnome::CanvasLine with a reference to the GnomeCanvas I want to
draw on (and various other details about the line).
If I have a Grid class
class Grid
def draw_grid
...
end
end
How should I tell Grid what GnomeCanvas to draw on? Pass it in when it's
initialized? For some reason, that doesn't seem like the best thing to do.
Any ideas?
on the screen (in this case, a GnomeCanvas object).
Say I need to have a grid drawn on this canvas. In order to draw a line, I
need to call Gnome::CanvasLine with a reference to the GnomeCanvas I want to
draw on (and various other details about the line).
If I have a Grid class
class Grid
def draw_grid
...
end
end
How should I tell Grid what GnomeCanvas to draw on? Pass it in when it's
initialized? For some reason, that doesn't seem like the best thing to do.
Any ideas?