Re: Hard API freeze soon



Carl Nygard wrote:

a) I want to print out the value, just for debugging purposes.

I assume you're trying to establish identity for debugging - why not print the value of the underlying GTK object, which should share the lifetime of the gtkmm object?

Glib::RefPtr<Gdk::Screen> foo = // whatever
std::cout << foo->gobj() << "\n";

b) I want to pass the ref_ptr to a function taking the raw ptr

class MyScreen : public Gdk::Screen {}
class YourScreen : public Gdk::Screen {}

void FooFunction(Gdk::Screen* screen) {   //.... }

Define FooFunction() the way gtkmm would:

void FooFunction(Glib::RefPtr<Gdk::Screen>); // or ...
void FooFunction(Glib::RefPtr<Gdk::Screen>&);

Cheers,
Tim



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