tags:

views:

65

answers:

1

I have a GtkVBox with some labels and some empty blocks in it ... I have created this window + vBox in Glade3... Working under C.

+----------------+
|Lable1          |  
+----------------+
|EMPTY           |  
+----------------+
|Label2          |  
+----------------+
|Lable3          |  
+----------------+

On some external events i want to add a label widget at the EMPTY place... How to do it?

Plus, how can i remove any of the label and add new widget at that place?

A: 

Wouldn't it be easier to just add an empty (or hidden) label initially, and then populate it or show it when needed?

To remove the label, use gtk_container_remove (vbox, label), where vbox is a pointer to the GtkVBox widget and label is a pointer the widget you want to remove.

axel_c
Actually requirement is such that ..... some times i need to place label or some times i need to place image and on top of the image i need to place label... so kept it empty... can we update displayed image to some other image.. suppose Empty place holds some invisible image then on some event i will replace this image with visible image.. can we do this and how to do this?
PP
You can add an empty GtkVBox in that place, and then call gtk_box_pack_start() to add the widget you want when needed. If you need to change it later, destroy the contents of the box and pack the new widgets.
axel_c