Re: Gtk_Fixed



Kasper Peeters <K.Peeters@damtp.cam.ac.uk> writes:

> Can anyone explain how Gtk_Fixed of gtk-- is supposed to work? I tried
> something along the lines of

...

>    mywindow.add(&myfixed);
>    myfixed.add(&mybutton);
>    myfixed.put(mybutton,100,50);
>    
> but, depending on where I put the 'show' calls, this always seems to
> yield a working example but runtime errors (complaining about null
> children/parents) or nothing at all.

I think that, in this case, you don't want to use the add() call on
mybutton.  A fixed::add() just calls a fixed::put() at position 0,0.
Your code above adds mybutton twice, and the fixed widget doesn't
like that. So the right thing to do would be to omit the
myfixed::add() call.

    mywindow.add(&myfixed);
    myfixed.put(mybutton,100,50);

If you use fixed::add() then you can't use fixed::put(); you should
use fixed::move() once the widget is added.

-Jim



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