Re: How to create a new Window?



[snip]

>You either need to make use of
> Glib::RefPtr
> or do all memory management directly,

Glib::RefPtr is only meant for use with objects that have no public
constructors. Using it for widgets is not recommended.

Otherwise, your advice is good.

[snip]
> No, you should delete them from within your own code, as per explanation
> above.
> You may want, however, to explore the Gtk::manage(Gtk::Widget*) feature.
> See
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/FAQ/html/index.html#id2511146.
> Unfortunately,
> you can't pass Gtk::Window* to Gtk::manage, as windows are not
> hierarchically organized,
> as far as GTK is concerned.
[snip]
>> Also, how can I capture the quit signal event when quit
>> button is clicked?
>
> ... by overriding the 'virtual bool
> Window::on_delete_event(GdkEventAny*);'
> callback in your own Window class (most likely TopLevelWindow, in your
> particular
> case).


Murray Cumming
murrayc murrayc com
www.murrayc.com
www.openismus.com




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