Re: Re: GtkSheet style
| From: | Ivan Rodriguez | Date: | Tue, 11 Jan 2005 18:06:32 +0000 |
| Subject: | Re: Re: GtkSheet style | ||
| References: | 1 2 3 | Groups: | php.gtk.general |
| Request: | Send a blank email to php-gtk-general+get-5428@lists.php.net to get a copy of this message | ||
Hi Alan
I edit the gen_extra.c file and I wirte this:
PHP_FUNCTION(gtk_sheet_range_set_background)
{
int row0, col0, rowi, coli;
GtkSheetRange *range;
zval *php_color;
GdkColor *color;
NOT_STATIC_METHOD();
if (!php_gtk_parse_args(ZEND_NUM_ARGS(), "iiiiO", &row0, &col0, &rowi,
&coli, &php_color, gdk_color_ce))
return;
range->row0 = (gint)row0;
range->col0 = (gint)col0;
range->rowi = (gint)rowi;
range->coli = (gint)coli;
color = PHP_GDK_COLOR_GET(php_color);
gtk_sheet_range_set_background(GTK_SHEET(PHP_GTK_GET(this_ptr)),
(GtkSheetRange *) range, color);
RETURN_NULL();
}
....
{"range_set_background", PHP_FN(gtk_sheet_range_set_background), NULL},
The code works fine, but I have one problem, the color is not the
orignal color, for example:
$bgcolor = &new GdkColor("yellow");
$sheet->range_set_background(0, 0, 0, 2, $bgcolor);
This code colorize the first 3 colums of the first row, but the
background color is not yellow, the color change when I start the
script, and puts green, red or other colors, why this?
Any sugestion?
El mar, 11-01-2005 a las 05:40, Alan Knowles escribió:
> I suspect I never wrote bindings for GtkSheetRange.. or that method is
> not generated due to the const-GtkSheetRange, It's been a long while
> since I looked at it..
>
> Regards
> Alan
>
> Ivan Rodriguez wrote:
>
> >Hi
> >
> >I read the file extra.defs and here the methods are defined
> >
> >....
> >(method range_set_background
> > (of-object Sheet (Gtk))
> > (c-name gtk_sheet_range_set_background)
> > (return-type none)
> > (parameter (type-and-name const-GtkSheetRange* range))
> > (parameter (type-and-name const-GdkColor* color))
> >)
> >
> >(method range_set_foreground
> > (of-object Sheet (Gtk))
> > (c-name gtk_sheet_range_set_foreground)
> > (return-type none)
> > (parameter (type-and-name const-GtkSheetRange* range))
> > (parameter (type-and-name const-GdkColor* color))
> >)
> >...
> >
> >But the GtkSheet object don't have the methods to use in PHP, why this?
> >I don't understand because other methods works fine.
> >
> >Any sugestion?
> >
> >Regards
> >
> >El lun, 10-01-2005 a las 17:44, Ivan Rodriguez escribió:
> >
> >
> >>Hi
> >>
> >>Iôm trying to set a backgorund color to cell of GtkSheet, but I donôt
> >>know how to set, I believe that the object does not support all the
> >>metodos of the real object, since they do not appear many methods in
> >>the manual, i.e: range_set_background, range_set_border,
> >>range_set_font ... and many more
> >>
> >>My question is, is posible to set a background color to cell?
> >>
> >>Regards
> >>
> >>
--
Ivan Rodriguez <epplestun@gmail.com>