I have a problem with the GTK + C application. I have a container that contains a button when the application starts. During operation, user intervention should make this widget contain more of them.
I need to write a function that removes all the "old" internal buttons, and then adds everything from the list and finally updates the view. This is what I am writing, but some parts are missing (TODO)
void refresh_sequence_panel()
{
GSList* iterator = NULL;
GtkWidget* button;
for (iterator = steps; iterator; iterator = iterator->next) {
button = gtk_button_new_from_stock(GTK_STOCK_ADD);
gtk_widget_set_size_request(button, SEQ_BUTTON_W, SEQ_BUTTON_H);
gtk_box_pack_start(GTK_BOX(sequence_panel), button, FALSE, FALSE, 5);
handler_id = g_signal_connect(G_OBJECT(button), "clicked", G_CALLBACK(seq_popup), GTK_BOX(sequence_panel));
}
}
Hope someone can help, thanks!
source
share