RE: Efficient use of GDK Graphic contexts



A reasonable chunk, but then by the time a GtkWidget gets all its signal bindings,
extra data, and other stuff, a GC probably isn't all that much extra.  ;)

Thanks for both of you that responded.  Sounds like I don't need to worry much based
on the fact that it sounds like I can't switch a GC between windows.  This pretty
much forces me to have one GC per window and if this is the case, I'm sure GCs are
designed  to have hundreds active at any given time.

I've already got a structure that holds all the data associated with each widget, so
adding a GC per widget isn't a big deal at all.  The designer part is a small part
of my application so I can just build the GCs only if in design mode and not worry
about memory or anything.

I was just worried about having thousands of GCs per form and looking like an idiot
when someone looked at the code.  I thought maybe they were like tooltips or pango
font objects where you build one then share it with everything on the form.  Just
seemed wasteful since each GC will be exactly the same.


Thanks






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