List Info

Thread: widget reuse




widget reuse
user name
2005-12-31 05:36:56
Just curious, why reuse widget is not works:

    my $spacer = Gtk2::Label->new();
    $spacer->set_size_request(30,0);

    $hbox->pack_start($spacer,FALSE,FALSE,0);
    $hbox->pack_start($vbbox,FALSE,FALSE,0);
    $hbox->pack_start($spacer,FALSE,FALSE,0);

error:

Gtk-CRITICAL **: file gtktable.c: line 598
(gtk_table_attach): assertion 
`child->parent == NULL' failed at

TIA

-- 

--beast

_______________________________________________
gtk-perl-list mailing list
gtk-perl-listgnome.org

http://mail.gnome.org/mailman/listinfo/gtk-perl-list
widget reuse
user name
2005-12-31 05:58:19
On Dec 31, 2005, at 12:36 AM, Beast wrote:

> Just curious, why reuse widget is not works:
>
>    my $spacer = Gtk2::Label->new();
>    $spacer->set_size_request(30,0);
>
>    $hbox->pack_start($spacer,FALSE,FALSE,0);
>    $hbox->pack_start($vbbox,FALSE,FALSE,0);
>    $hbox->pack_start($spacer,FALSE,FALSE,0);
>
> error:
>
> Gtk-CRITICAL **: file gtktable.c: line 598
(gtk_table_attach):  
> assertion `child->parent == NULL' failed at

Widgets can have only one parent.

Creating an empty label set to 30 pixels wide to separate
elements in  
an HBox is completely unnecessary, however, as you can
specify  
padding (that's the last parameter to pack()) and spacing
between  
children (e.g., $hbox->set_spacing(30)).


--
That's it!  It's one thing for a ghost to scare my children,
but it's  
another to play my theremin!
   - Homer Simpson

_______________________________________________
gtk-perl-list mailing list
gtk-perl-listgnome.org

http://mail.gnome.org/mailman/listinfo/gtk-perl-list
[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )