where is alloc_color called



Hi,

I am struggling to understand the (deprecated) but still useful parts of Gdk.

Thus I read in the books (Havoc and Martin books) and tutorials about Gtk+ that I need to 
0) get a graphics context
1) create a color object
2) assign it a color by filling in rgb values or using common name as per rgb.txt
3) then allocate it on the X server (ie fill in the internal X representation of the color)
 this is done using the visual from the X server which identifies the internal representation
of the color done with alloc_color function
4) then when i am done using it i will unref the color, just as i might unref the graphics context

Then I see in gtkmm code, as I expect to, RefPtrs for Gdk::GC graphics contexts, because gtkmm
will handle the unref of the graphics context itself.

however Gdk::Colors are created without using a RefPtr, and for instance in the 
example file demos/gtk-demo/example_drawingarea.cc
(which works :) I see no use at all of the alloc_color member function which exists in gtkmm, 
so How does the gulong pixel element of the Gtk+ _GdkColor struct get assigned a value? 
moreover I see no way that the server side resource "Gdk::Color" will be unrefed by gtkmm...

I am a puzzled newbee struggling to understand :(

Mitchell



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]