Clearing a Window with widgets

Hi,
A beginners Q:

When starting a GTK app, the widgets like gtkentry and gtklabels are all cleared/filled with nulls.

I have a litte GTK app filling some entry and label filelds with inventory data.

Is it possible to call a command to clear all these fields at one time?

Instead of calling set-label-text for every fileld.

BR Thomas

Hi,

If your inventory data are stored in a GObject (or derived), then there is a possibility to use bindings or expressions to automatically bind the Entries text to the Object’s properties, i.e. clearing the inventory object will clear the entries too.

But that requires some careful design on the “inventory” itself.

Thanks for the tip :slight_smile:

I will move spaces to the data record and then call my display routine again, that should then clear the fields.

BR Thomas

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.