Re: Troubles with containers



Hi guys,
sorry but I'm not yet used to mailing lists :)
Now I'm reporting here what Michael Hasselmann sent me and what I
answered and asked ( I added the mailing list as cc. so that you can
read it ).


Well at the moment I solved it by getting all these variables as static.
Is it sick to get them as static variables? Should I get them as class-members?
Currently I've chosen for the first one since anything is
event-driven, hence, currently, I don't need to directly handle these
objects; anyway I'm just a beginner with gtkmm and then I'd like to be
advised.
Last, I've downloaded a simple gtkmm project from the ubuntu
repository, is called gip, here is the situation I found in all the
window's constructors :

GUIMainwindow::GUIMainwindow()
{
 VBox*     vbox     = new VBox;
 Notebook* notebook = new Notebook;
 /* using vbox and notebook withoute deleting */
}

He is not deleting vbox and notebook in this constructor since this
would lead to my same problem.
Anyway isn't this leading to memory leaks ? Or is gtkmm deleting them
( I don't think so ) ?



2009/5/31 Michael Hasselmann <michael taschenorakel de>:
> Hi,
>
> you should probably read the Gtkmm tutorial's chapter about memory
> management.
>
> http://www.gtkmm.org/docs/gtkmm-2.4/docs/tutorial/html/chapter-memory.html
>
> You'll find out very quickly why your dialog is empty =) (hint: it's
> about the scope of variables).
>
> regards,
> Michal
>
> Am Sonntag, den 31.05.2009, 14:13 +0200 schrieb Denis Micolani:
>> Hi,
>> I'm trying to build a small dialog for an othello / reversi game using
>> gtkmm, here is the constructor of my Gtk::Dialog :
>>
>> [code snippet]
>>
>> currently the dialog is showing up with its correct size, but there's
>> nothing in it.
>> Can anyone help me with this ?
>
>


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