Re: [gtkmm] Gdk::GC doesn't work as described
- From: Juan Linietsky <coding reduz com ar>
- To: gtkmm-list gnome org
- Subject: Re: [gtkmm] Gdk::GC doesn't work as described
- Date: Thu, 5 Dec 2002 22:23:54 -0300
On Thu, 5 Dec 2002 22:12:08 +0100 (CET)
Torsten Sievers <tsievers rhrk uni-kl de> wrote:
> Hello List,
>
> i need to create a GC for a DrawingArea,
> following the examples in the tutorial, i can't get any result,
> it seems that the tutorial-code is not up-to-date.
> here is a code-snippet:
> (from the tutorial)
>
> Gdk::GC some_gc;
> some_gc.create(get_window());
> Gdk::Color some_color;
> Gdk::Colormap some_colormap(Gdk::Colormap::get_system());
> some_color.set_red(65535);
> some_color.set_green(65535);
> some_color.set_blue(0);
> some_colormap.alloc(some_color);
> some_gc.set_foreground(some_color);
>
> i create all necessary things (i think)
>
> but the compiler says that Gdk::GC is protected (which is correct
> according to the includes and the API-Reference)
>
> it says also, that Gdk::Colormap::get_system() is undefined.
>
> can somebody please give me a correct version of the code-snippet
> so i can work on?
>
> TIA
> --
> Greetings
> Torsten
I got that kind of figured out, but i dont think it's the right way since it's all messy.
Most functions are now refptrs it seems, so you have to use the -> operator to get the data,
instead of ".". However I dont understand what to do in case of having to pass those
as argument, since it begs me for a refptr instead of creating one from the object i pass
using a copyconstructor.
Juan Linietsky
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]