Setting background color on gnomecanvas widget

Hi,

How does one set the background color on a gnomecanvas widget?

http://developer.gnome.org/doc/API/2.0/libgnomecanvas/GnomeCanvas.html
makes reference to a bg_color field, but I don't see that referenced
in the source for ruby-gnome2. (and there's no documentation for
gnomecanvas yet apparently)

Thanks,
Joe

For now, I'm just putting a colored Gnome::CanvasRect as the
background and resizing it when the canvas gets resized.

Couple more questions:

1) Can someone point me to any programs that use ruby's gnomecanvas?
(besides Sokoban and that one Chess Clock one)

2) I'm drawing a bunch of lines on a GnomeCanvas that's supposed to
be a grid. The user can specify the grid spacing (in pixels), and can
also resize the Canvas (so more grid lines need to be drawn). What is
the standard way to redraw all those lines when the user specifies a
different grid spacing frequency or when the user resizes the canvas?
Put them all in a CanvasGroup and then delete and recreate all the
lines in that group on every resize and redraw?

Thanks,
Joe

···

On 7/18/05, Joe Van Dyk <joevandyk@gmail.com> wrote:

Hi,

How does one set the background color on a gnomecanvas widget?

http://developer.gnome.org/doc/API/2.0/libgnomecanvas/GnomeCanvas.html
makes reference to a bg_color field, but I don't see that referenced
in the source for ruby-gnome2. (and there's no documentation for
gnomecanvas yet apparently)

Thanks,
Joe

I recently asked about modifying Gtk widget backgrounds (on the
ruby-gnome mailing list) and was pointed towards Widget#modify_bg(state,
color) and Widget#modify_base(state, color) for certain widgets
(Gtk::Entry, Gtk::TreeView). Not sure if GnomeCanvas supports those but
it's worth a try.

martin

···

Joe Van Dyk <joevandyk@gmail.com> wrote:

Hi,

How does one set the background color on a gnomecanvas widget?

http://developer.gnome.org/doc/API/2.0/libgnomecanvas/GnomeCanvas.html
makes reference to a bg_color field, but I don't see that referenced
in the source for ruby-gnome2. (and there's no documentation for
gnomecanvas yet apparently)