Re: Checking for the type of a CellRenderer
- From: "Joost Ellerbroek" <j ellerbroek gmail com>
- To: "Murray Cumming" <murrayc murrayc com>
- Cc: gtkmm-list gnome org
- Subject: Re: Checking for the type of a CellRenderer
- Date: Fri, 29 Sep 2006 12:33:11 +0200
Hi Murray,
Thanks, that works. I thought that maybe you could get something like a G_TYPE, but this is also fine..
cheers,
Joost
On 9/29/06, Murray Cumming <murrayc murrayc com> wrote:
> Hi all,
>
>
> I've been trying to set some properties of Cellrenderer's in a TreeView,
> such as foreground color, sensitivity, ea.
> What I do now is that I iterate over the TreeView's columns, get the first
> cellrenderer, cast it to CellRendererText (because of the foreground
> color)
> and set the properties. This worked fine, until I started adding non-text
> cells (because of the cast, and setting foreground color).
>
> What I'm trying to find now is if there's a way of checking for the type
> of
> a CellRenderer, but I couldn't find anything that looked like it in the
> api
> reference.
> Any suggestions?
You can use dynamic_cast<> for this, with if/else blocks. It's not
particularly pretty, but it's how it's done in C++. You'll find some
examples of this in Glom's source code (though that's not always the
cleanest example code).
Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]