1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
|
void GoToStep1(GtkBuilder *pBuildMainWindow, gpointer Data)
{
GtkWidget *pStepHorizontalBox;
pStepHorizontalBox = GTK_WIDGET(gtk_builder_get_object(pBuildMainWindow, "hbox2"));
GError *GtkBuildError = NULL;
GtkBuilder *pBuildStep;
pBuildStep = gtk_builder_new();
if(pBuildStep)
{
if(!gtk_builder_add_from_file(pBuildStep, "ui/Step1.xml", &GtkBuildError))
{
if(GtkBuildError)
{
printf("Error: %s", GtkBuildError -> message);
}
}
}
/* Declare widgets from GtkBuilder to handle signals */
GtkWidget *pMainProgressBar;
pMainProgressBar = GTK_WIDGET(gtk_builder_get_object(pBuildMainWindow, "progressbar1"));
GtkWidget *pMainNextButton;
pMainNextButton = GTK_WIDGET(gtk_builder_get_object(pBuildMainWindow, "button2"));
g_signal_connect_swapped(GTK_BUTTON(pMainNextButton), "clicked", G_CALLBACK(Progress10), pMainProgressBar);
GtkWidget *pAboutButton;
pAboutButton = GTK_WIDGET(gtk_builder_get_object(pBuildMainWindow, "button3"));
g_signal_connect(GTK_BUTTON(pAboutButton), "clicked", G_CALLBACK(AboutProgram), NULL);
GtkWidget *pSaveAsButton;
pSaveAsButton = GTK_WIDGET(gtk_builder_get_object(pBuildMainWindow, "button1"));
gtk_widget_set_sensitive(GTK_WIDGET(pSaveAsButton), FALSE);
/* Show step 1 */
GtkWidget *pStepFrame;
pStepFrame = GTK_WIDGET(gtk_builder_get_object(pBuildStep, "frame1"));
gtk_box_pack_start_defaults(GTK_BOX(pStepHorizontalBox), pStepFrame);
g_signal_connect_swapped(GTK_BUTTON(pMainNextButton), "clicked", G_CALLBACK(GoToStep2Destroy), pBuildMainWindow);
}
void GoToStep2Destroy(GtkBuilder *pBuildMainWindow, gpointer Data)
{
/* Ici j'ai bien récupéré le GtkWidget pBuildMainWindow, mais comment je détruis un widget enfant? \
* Sachant que je ne passe qu'un argument, c.a.d. le fenêtre principale du programme. Comment???? */
} |
Partager