Re: Setting color of a cell
- From: Ser Nam Lim <sernam cs umd edu>
- To: Jody Goldberg <jgoldberg home com>
- Cc: <gnumeric-list gnome org>
- Subject: Re: Setting color of a cell
- Date: Thu, 5 Jul 2001 13:59:47 -0400 (EDT)
But since I can set the cell background via the "Format Cells" feature
given, there shld be a way to do it, aint that right or am i missing
-- ser nam
On Tue, 3 Jul 2001, Jody Goldberg wrote:
On Tue, Jul 03, 2001 at 11:02:56PM -0400, Ser Nam Lim wrote:
I was trying to add on certain features to gnumeric by adding a component
to GNumeric source code itself. I was trying to use the following way to
set the color of a range of cells but it did not seem to set the color
at all although these statements are executed. If anyone knows what more
needs to be done let me know. Thanks.
MStyle *style = mstyle_new ();
StyleColor *color = style_color_new (1, 0, 0);
mstyle_set_color (style, MSTYLE_COLOR_BACK, color);
sheet_range_apply_style (sheet, Range *, style);
I can not easily comment on this because it is for an older version.
However, if you pass a valid range to sheet_range_apply_style (or
its modern counterpart sheet_apply_style) things should work.
A possible problem would be that you have not redrawn the canvas.
The new version handles this, I don't recall the behavior of the old
version. you can test by iconifying or scrolling the region.
You are aware that style_color_new (1,0,0) is basicly black ?
Either way I would reccomend you get more current source.
] [Thread Prev