[prev in list] [next in list] [prev in thread] [next in thread]
List: gtkmm
Subject: Re: creatring Glib::RefPtr from plain pointer
From: Murray Cumming <murrayc () murrayc ! com>
Date: 2015-01-22 11:13:00
Message-ID: 1421925180.26911.2.camel () murrayc ! com
[Download RAW message or body]
On Thu, 2015-01-22 at 00:25 +0000, test_account@tutanota.de wrote:
> Hi, I need someone to explain this:
>
> this is correct:
> Glib::RefPtr<Gtk::Menu> pMenuPopup = Gtk::manage(new Gtk::Menu(menu));
No, and I doubt it would compile.
> it this correct to? if not why not?
> Glib::RefPtr<Gtk::Menu> pMenuPopup = Glib::RefPtr<Gtk::Menu>(new
> Gtk::Menu(menu));
You shouldn't use RefPtr<> with widgets (such as Gtk::Menu). If
something needs to use RefPtr<> then you'd generally get the RefPtr<>
from a method such as create(), get_something(), or get_default().
--
Murray Cumming
murrayc@murrayc.com
www.murrayc.com
_______________________________________________
gtkmm-list mailing list
gtkmm-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtkmm-list
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic