List Info

Thread: replacing widgets in packing boxes




replacing widgets in packing boxes
user name
2006-08-07 18:32:07
I have some container or other, say a packing vbox, in the
middle of a
huge screen and I have done $vbox->pack_start($widget, 0,
1, 5);

I now want, without rebuilding the whole screen from
scratch, to replace
$widget with another, possibly completely different,
$newwidget.

Is this possible?

I have the reference "$widget" available to me
as well as its parent's.

Dirk

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

http://mail.gnome.org/mailman/listinfo/gtk-perl-list
replacing widgets in packing boxes
user name
2006-08-07 22:41:52
On Mon, 2006-08-07 at 19:32 +0100, Dirk Koopman wrote:
> I have some container or other, say a packing vbox, in
the middle of a
> huge screen and I have done
$vbox->pack_start($widget, 0, 1, 5);
> 
> I now want, without rebuilding the whole screen from
scratch, to replace
> $widget with another, possibly completely different,
$newwidget.
> 
> Is this possible?
> 
> I have the reference "$widget" available to
me as well as its parent's.

So to answer my own question for now: I create an empty
vbox() and
remember its reference (a palaver in itself) and then remove
any old
widget (maybe none) and (re-)pack_start the new one. The
vbox() will
only have one item in it which will fill it to the maximum
space
allowed.



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

http://mail.gnome.org/mailman/listinfo/gtk-perl-list
replacing widgets in packing boxes
user name
2006-08-08 00:38:37
On Aug 7, 2006, at 6:41 PM, Dirk Koopman wrote:

>> I have the reference "$widget"
available to me as well as its  
>> parent's.
>
> So to answer my own question for now: I create an empty
vbox() and
> remember its reference (a palaver in itself) and then
remove any old
> widget (maybe none) and (re-)pack_start the new one.
The vbox() will
> only have one item in it which will fill it to the
maximum space
> allowed.

If you have the child of the vbox, you can avoid keeping the
 
reference tothe vbox itself by doing  $vbox =
$widget->get_parent.   
Depends on how much bookkeeping overhead it is.


--
"the ternary operator makes it a bit less ugly."
     -- kaffee

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

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

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