static void test_assistant_basic (void) { GtkWidget *widget; widget = gtk_assistant_new (); g_assert (GTK_IS_ASSISTANT (widget)); gtk_widget_destroy (widget); }
GtkWidget* do_assistant (GtkWidget *do_widget) { if (!assistant) { assistant = gtk_assistant_new (); gtk_window_set_default_size (GTK_WINDOW (assistant), -1, 300); gtk_window_set_screen (GTK_WINDOW (assistant), gtk_widget_get_screen (do_widget)); create_page1 (assistant); create_page2 (assistant); create_page3 (assistant); create_page4 (assistant); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (on_assistant_close_cancel), &assistant); g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (on_assistant_close_cancel), &assistant); g_signal_connect (G_OBJECT (assistant), "apply", G_CALLBACK (on_assistant_apply), NULL); g_signal_connect (G_OBJECT (assistant), "prepare", G_CALLBACK (on_assistant_prepare), NULL); } if (!gtk_widget_get_visible (assistant)) gtk_widget_show (assistant); else { gtk_widget_destroy (assistant); assistant = NULL; } return assistant; }
JNIEXPORT jlong JNICALL Java_org_gnome_gtk_GtkAssistant_gtk_1assistant_1new ( JNIEnv* env, jclass cls ) { GtkWidget* result; jlong _result; // call function result = gtk_assistant_new(); // translate return value to JNI type _result = (jlong) result; // cleanup return value if (result != NULL) { bindings_java_memory_cleanup((GObject*)result, FALSE); } // and finally return _result; }
/* main program */ int main( int argc, char **argv ) { gtk_init( &argc, &argv ); /* initialize each page */ PageInfo page[ PAGE_SIZE ] = { { NULL, -1, "Introduction", GTK_ASSISTANT_PAGE_INTRO, TRUE }, { NULL, -1, NULL, GTK_ASSISTANT_PAGE_CONTENT, FALSE }, { NULL, -1, "Click the Check Button", GTK_ASSISTANT_PAGE_CONTENT, FALSE }, { NULL, -1, "Click the Button", GTK_ASSISTANT_PAGE_PROGRESS, FALSE }, { NULL, -1, "Confirmation", GTK_ASSISTANT_PAGE_CONFIRM, TRUE }, }; /* create a new assistant widget with no pages */ GtkWidget *assistant = gtk_assistant_new(); gtk_widget_set_size_request( assistant, 450, 300 ); gtk_window_set_title( GTK_WINDOW( assistant ), "Assistant implements multiple page dialog" ); gtk_container_set_border_width( GTK_CONTAINER( assistant ), 10 ); g_signal_connect( G_OBJECT( assistant ), "destroy", G_CALLBACK( gtk_main_quit ), NULL ); /* initialize widgets for each page */ page[ 0 ].widget = gtk_label_new( "This is an example of a GtkAssistant. By\n" \ "clicking the forward button, you can continue\n" \ "to the next section, Good Luck, man!" ); page[ 1 ].widget = gtk_hbox_new( FALSE, 5 ); page[ 2 ].widget = gtk_check_button_new_with_label( "Click me to coninue" ); page[ 3 ].widget = gtk_alignment_new( 0.5f, .5f, .0f, .0f ); page[ 4 ].widget = gtk_label_new( "Text has been entered in the label and the\n" \ "combo box is clicked. If you are done, then\n" \ "it is time to leave!" ); /* create the necessary widgets for the second page */ GtkWidget *label = gtk_label_new( "Your name: " ); GtkWidget *entry = gtk_entry_new(); gtk_box_pack_start( GTK_BOX( page[1].widget ), label, FALSE, FALSE, 5 ); gtk_box_pack_start( GTK_BOX( page[1].widget ), entry, FALSE, FALSE, 5 ); /* * create the necessary widgets for the fourth page. The, attach the progress bar * to the GtkAlignment widget for later access */ GtkWidget *button = gtk_button_new_with_label( "click me!" ); GtkWidget *progress = gtk_progress_bar_new(); GtkWidget *hbox = gtk_hbox_new( FALSE, 5 ); gtk_box_pack_start( GTK_BOX( hbox ), progress, TRUE, FALSE, 5 ); gtk_box_pack_start( GTK_BOX( hbox ), button, FALSE, FALSE, 5 ); gtk_container_add( GTK_CONTAINER( page[3].widget ), hbox ); g_object_set_data( G_OBJECT( page[3].widget ), "pbar", (gpointer) progress ); /* add five pages to assistant */ int i; for ( i = 0; i < PAGE_SIZE; i++ ) { /* first, append page onto assistant */ page[ i ].index = gtk_assistant_append_page( GTK_ASSISTANT( assistant ), page[i].widget ); /* set attributes */ gtk_assistant_set_page_title( GTK_ASSISTANT( assistant ), page[i].widget, page[i].title ); gtk_assistant_set_page_type( GTK_ASSISTANT( assistant ), page[i].widget, page[i].type ); gtk_assistant_set_page_complete( GTK_ASSISTANT( assistant ), page[i].widget, page[i].complete ); } /* * set event handler for page 2 and page 4. * the handlers will update page2 and page 4 as complete if the pre-conditions * are set. */ g_signal_connect( G_OBJECT( entry ), "changed", G_CALLBACK( entry_changed ), (gpointer) assistant ); g_signal_connect( G_OBJECT( page[2].widget ), "toggled", G_CALLBACK( button_toggled ), (gpointer) assistant ); g_signal_connect( G_OBJECT( button ), "clicked", G_CALLBACK( button_clicked ), (gpointer) assistant ); g_signal_connect( G_OBJECT( assistant ), "cancel", G_CALLBACK( assistant_cancel ), NULL ); g_signal_connect( G_OBJECT( assistant ), "close", G_CALLBACK( assistant_close ), NULL ); gtk_widget_show_all( assistant ); gtk_main(); return 0; }
static VALUE rg_initialize(VALUE self) { RBGTK_INITIALIZE(self, gtk_assistant_new()); return Qnil; }
/*! * \fn G_MODULE_EXPORT void openAssistantNewCsu(GtkWidget *widget, gpointer data) * Open the assistant for a new csu file * \param[in] widget the widget which send the signal * \param[in] data the globalData */ G_MODULE_EXPORT void openAssistantNewCsu(GtkWidget *widget, gpointer data) { globalData *user_data = (globalData*) data; char home_path[SIZE_MAX_FILE_NAME]=""; gchar system_path[SIZE_MAX_FILE_NAME]=""; list_game_config *ptr_list_config; gint i; #ifndef PORTABLE readHomePathSlash(home_path); readSystemPath(system_path); #else readHomePath(system_path); #endif // PORTABLE /* creating of the assistant */ user_data->ptr_new_csu_file_assistant = gtk_assistant_new(); /* Set the assistant windows */ gtk_window_set_transient_for(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),GTK_WINDOW(user_data->ptr_main_window)); gtk_window_set_gravity(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),GDK_GRAVITY_CENTER); gtk_window_set_position(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),GTK_WIN_POS_CENTER_ON_PARENT); gtk_window_set_modal(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),TRUE); gtk_window_set_type_hint(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),GDK_WINDOW_TYPE_HINT_DIALOG); gtk_window_resize(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),700,400); gtk_window_set_title(GTK_WINDOW(user_data->ptr_new_csu_file_assistant),_("New csu file assistant")); /*Set the signal of the assistant */ g_signal_connect(user_data->ptr_new_csu_file_assistant,"delete-event", G_CALLBACK(deleteEventAssistantNewCsu),user_data); g_signal_connect(user_data->ptr_new_csu_file_assistant,"cancel", G_CALLBACK(deleteAssistantNewCsu),user_data); g_signal_connect(user_data->ptr_new_csu_file_assistant,"prepare", G_CALLBACK(preparePageAssistantNewCsu),user_data); g_signal_connect(user_data->ptr_new_csu_file_assistant,"close", G_CALLBACK(endAssistantNewCsu),user_data); /* Set the first page */ GtkWidget *grid_1 = getWidgetFromBuilder(user_data->ptr_builder,"grid_new_csu_file_assistant_1"); gtk_assistant_append_page(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_1); gtk_assistant_set_page_type(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_1,GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_title(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_1,_("General information")); /* Configure the file chooser */ gtk_entry_set_max_length(GTK_ENTRY(gtk_grid_get_child_at(GTK_GRID(grid_1),1,0)),SIZE_MAX_FILE_NAME/8); gtk_file_chooser_set_current_folder_file(GTK_FILE_CHOOSER(gtk_grid_get_child_at(GTK_GRID(grid_1),1,1)),g_file_new_for_path(g_locale_to_utf8(system_path,-1,NULL,NULL,NULL)),NULL); /* Set the combo box of the game configuration */ GtkWidget *combo_config = gtk_combo_box_text_new(); ptr_list_config = readConfigListFile(home_path); for (i=0 ; i<ptr_list_config->nb_config ; i++) gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(combo_config),i,NULL,ptr_list_config->name_game_config[i]); gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(combo_config),ptr_list_config->nb_config,NULL,_("Add a new game configuration")); gtk_combo_box_text_insert(GTK_COMBO_BOX_TEXT(combo_config),ptr_list_config->nb_config +1,NULL,_("Use an other game configuration")); gtk_grid_attach(GTK_GRID(grid_1),combo_config,1,3,1,1); g_signal_connect(combo_config,"changed", G_CALLBACK(chooseGameConfigurationNewAssistant),user_data); closeListGameConfig(ptr_list_config); /* Set the second page */ GtkWidget *scrolled_window_name = getWidgetFromBuilder(user_data->ptr_builder,"scrolled_window_new_csu_file_assistant_2"); gtk_assistant_append_page(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),scrolled_window_name); gtk_assistant_set_page_type(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),scrolled_window_name,GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_title(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),scrolled_window_name,_("Player's names")); /* Set the grid */ GtkWidget *grid_name = gtk_grid_new(); gtk_grid_set_column_spacing(GTK_GRID(grid_name),10); gtk_grid_set_row_spacing(GTK_GRID(grid_name),10); gtk_grid_set_column_homogeneous(GTK_GRID(grid_name),TRUE); #if GTK_MINOR_VERSION >= 12 gtk_widget_set_margin_end(grid_name,10); gtk_widget_set_margin_start(grid_name,10); #else gtk_widget_set_margin_right(grid_name,10); gtk_widget_set_margin_left(grid_name,10); #endif // GTK_MINOR_VERSION gtk_widget_set_margin_top(grid_name,10); gtk_widget_set_margin_bottom(grid_name,10); gtk_container_add(GTK_CONTAINER(gtk_bin_get_child(GTK_BIN(scrolled_window_name))),grid_name); /* Set the third page */ GtkWidget *grid_3 = getWidgetFromBuilder(user_data->ptr_builder,"grid_new_csu_file_assistant_3"); gtk_assistant_append_page(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_3); gtk_assistant_set_page_type(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_3,GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_title(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_3,_("Distributor and validation")); GtkWidget *combo_distributor = gtk_combo_box_text_new(); gtk_grid_attach(GTK_GRID(grid_3),combo_distributor,1,0,1,1); g_signal_connect(combo_distributor,"changed", G_CALLBACK(validAssistantNewCsuThree),user_data); cleanAssistantNewCsu(user_data); gtk_widget_show_all(user_data->ptr_new_csu_file_assistant); }
int main (int argc, char *argv[]) { GtkWidget *assistant, *entry, *label, *button, *progress, *hbox; guint i; PageInfo page[5] = { { NULL, -1, "Introduction", GTK_ASSISTANT_PAGE_INTRO, TRUE}, { NULL, -1, NULL, GTK_ASSISTANT_PAGE_CONTENT, FALSE}, { NULL, -1, "Click the Check Button", GTK_ASSISTANT_PAGE_CONTENT, FALSE}, { NULL, -1, "Click the Button", GTK_ASSISTANT_PAGE_PROGRESS, FALSE}, { NULL, -1, "Confirmation", GTK_ASSISTANT_PAGE_CONFIRM, TRUE}, }; gtk_init (&argc, &argv); /* Create a new assistant widget with no pages. */ assistant = gtk_assistant_new (); gtk_widget_set_size_request (assistant, 450, 300); gtk_window_set_title (GTK_WINDOW (assistant), "GtkAssistant Example"); g_signal_connect (G_OBJECT (assistant), "destroy", G_CALLBACK (gtk_main_quit), NULL); page[0].widget = gtk_label_new ("This is an example of a GtkAssistant. By\n"\ "clicking the forward button, you can continue\n"\ "to the next section!"); page[1].widget = gtk_hbox_new (FALSE, 5); page[2].widget = gtk_check_button_new_with_label ("Click Me To Continue!"); page[3].widget = gtk_alignment_new (0.5, 0.5, 0.0, 0.0); page[4].widget = gtk_label_new ("Text has been entered in the label and the\n"\ "combo box is clicked. If you are done, then\n"\ "it is time to leave!"); /* Create the necessary widgets for the second page. */ label = gtk_label_new ("Your Name: "); entry = gtk_entry_new (); gtk_box_pack_start (GTK_BOX (page[1].widget), label, FALSE, FALSE, 5); gtk_box_pack_start (GTK_BOX (page[1].widget), entry, FALSE, FALSE, 5); /* Create the necessary widgets for the fourth page. The, Attach the progress bar * to the GtkAlignment widget for later access.*/ button = gtk_button_new_with_label ("Click me!"); progress = gtk_progress_bar_new (); hbox = gtk_hbox_new (FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox), progress, TRUE, FALSE, 5); gtk_box_pack_start (GTK_BOX (hbox), button, FALSE, FALSE, 5); gtk_container_add (GTK_CONTAINER (page[3].widget), hbox); g_object_set_data (G_OBJECT (page[3].widget), "pbar", (gpointer) progress); /* Add five pages to the GtkAssistant dialog. */ for (i = 0; i < 5; i++) { page[i].index = gtk_assistant_append_page (GTK_ASSISTANT (assistant), page[i].widget); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), page[i].widget, page[i].title); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), page[i].widget, page[i].type); /* Set the introduction and conclusion pages as complete so they can be * incremented or closed. */ gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), page[i].widget, page[i].complete); } /* Update whether pages 2 through 4 are complete based upon whether there is * text in the GtkEntry, the check button is active, or the progress bar * is completely filled. */ g_signal_connect (G_OBJECT (entry), "changed", G_CALLBACK (entry_changed), (gpointer) assistant); g_signal_connect (G_OBJECT (page[2].widget), "toggled", G_CALLBACK (button_toggled), (gpointer) assistant); g_signal_connect (G_OBJECT (button), "clicked", G_CALLBACK (button_clicked), (gpointer) assistant); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (assistant_cancel), NULL); g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (assistant_close), NULL); gtk_widget_show_all (assistant); gtk_main (); return 0; }
AssistantBase::AssistantBase(const ustring& title, const gchar * helptopic) // Base class for each assistant. { // Variables. process_id = 0; topic = helptopic; // If no help is given, take a default one. if (!topic) { topic = _("none"); } // Signalling button. signal_button = gtk_button_new (); // Create the assistant. assistant = gtk_assistant_new(); gtk_widget_show (assistant); gtk_window_set_modal (GTK_WINDOW (assistant), true); gtk_window_set_title (GTK_WINDOW (assistant), title.c_str()); // Let it remain above other windows. gdk_window_set_keep_above (gtk_widget_get_root_window (assistant), true); // Introduction. label_intro = gtk_label_new (title.c_str()); gtk_widget_show (label_intro); gtk_assistant_append_page (GTK_ASSISTANT (assistant), label_intro); gtk_label_set_line_wrap (GTK_LABEL (label_intro), TRUE); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label_intro, _("Introduction")); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label_intro, GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label_intro, true); // Help button. //button_help = gtk_button_new(); //gtk_widget_show(button_help); //gtk_assistant_add_action_widget (GTK_ASSISTANT (assistant), button_help); //GtkWidget *alignment = gtk_alignment_new(0.5, 0.5, 0, 0); //gtk_widget_show(alignment); //gtk_container_add(GTK_CONTAINER(button_help), alignment); //GtkWidget *hbox = gtk_hbox_new(FALSE, 2); //gtk_widget_show(hbox); //gtk_container_add(GTK_CONTAINER(alignment), hbox); //GtkWidget *image = gtk_image_new_from_stock("gtk-help", GTK_ICON_SIZE_BUTTON); //gtk_widget_show(image); //gtk_box_pack_start(GTK_BOX(hbox), image, FALSE, FALSE, 0); //GtkWidget *label = gtk_label_new_with_mnemonic(_("_Help")); //gtk_widget_show(label); //gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0); // Signal handlers. //g_signal_connect((gpointer) button_help, "clicked", G_CALLBACK(on_button_help_activated), gpointer(this)); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (on_assistant_cancel_signal), gpointer(this)); g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (on_assistant_close_signal), gpointer(this)); // g_signal_connect (G_OBJECT (assistant), "delete_event", G_CALLBACK(on_assistant_delete_event), gpointer(this)); }
/** * new_document: * @parent_window: * * TODO: Write me */ void new_document(GtkWindow *parent_window) { CongNewFileAssistant *assistant; assistant = g_new0(CongNewFileAssistant,1); /* FIXME: what if no document factories found? */ assistant->druid = GTK_ASSISTANT(gtk_assistant_new()); gtk_widget_show (GTK_WIDGET (assistant->druid)); g_printerr("Number of pages: %d\n", gtk_assistant_get_n_pages(assistant->druid)); gtk_window_set_title (GTK_WINDOW (assistant->druid), _("Creating a new file")); if (parent_window != NULL) { gtk_window_set_transient_for (GTK_WINDOW (assistant->druid), parent_window); } g_signal_connect_object (assistant->druid, "cancel", G_CALLBACK (gtk_widget_destroy), assistant->druid, G_CONNECT_SWAPPED); g_signal_connect (assistant->druid, "apply", G_CALLBACK (on_apply), assistant); g_signal_connect (assistant->druid, "close", G_CALLBACK (gtk_widget_destroy), NULL); assistant->first_page = add_new_page(assistant, _("This assistant will " "guide you through creating a new file.\n\n" "Various types of file are available, and Conglomerate may be " "able to supply some of the \"boilerplate\" content for you.\n\n" "We hope that in future versions of Conglomerate you will be " "able to create \"template documents\" to add to this system."), GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete(assistant->druid, assistant->first_page, TRUE); assistant->type_selection_widget = make_type_selection_widget(assistant); assistant->second_page = add_new_page_with_widget(assistant, _("Creating a new file"), _("What type of file would you like to create?"), _("Highlight one of the items in the list and select \"Forward\" to continue"), assistant->type_selection_widget); gtk_widget_show_all(assistant->second_page); /* There doesn't seem to be a way to delete pages from a druid. Hence we have to create the GUI for all of the factories at the creation of the druid, rather than "on-demand". FIXME: With GtkAssistant, gtk_container_remove() should work. */ assistant->hash_table_of_factory_to_page = g_hash_table_new(g_direct_hash, g_direct_equal); assistant->hash_table_of_factory_to_last_page = g_hash_table_new(g_direct_hash, g_direct_equal); assistant->hash_table_of_factory_to_data = g_hash_table_new (g_direct_hash, g_direct_equal); cong_plugin_manager_for_each_document_factory (cong_app_get_plugin_manager (cong_app_singleton()), add_pages_for_factory_callback, assistant); assistant->final_page = add_new_page(assistant, _("Conglomerate now has the " "information it needs to create the document. Press \"Apply\" " "to create it. You will need to save the document if you wish " "to keep it."), GTK_ASSISTANT_PAGE_CONFIRM); gtk_assistant_set_page_complete(assistant->druid, assistant->final_page, TRUE); gtk_assistant_set_current_page(assistant->druid, 0); gtk_widget_show(GTK_WIDGET(assistant->druid)); #if 0 CONG_DO_UNIMPLEMENTED_DIALOG("The selected menu item has not yet been implemented."); #endif /* FIXME: need to sort out memory leaks */ }
int main (int argc, char *argv[]) { int i; GError *gerror = NULL; GdkColor color; plugin_t *plugin; gtk_init (&argc, &argv); ask_language(); /* Create a new assistant widget with no pages. */ assistant = gtk_assistant_new (); gtk_widget_set_size_request (assistant, 800, 600); //gtk_window_unfullscreen (GTK_WINDOW (assistant)); gtk_window_set_title (GTK_WINDOW (assistant), _("Fwife : Frugalware Installer Front-End")); /* Connect signals with functions */ g_signal_connect (G_OBJECT (assistant), "destroy", G_CALLBACK (cancel_install), NULL); g_signal_connect (G_OBJECT (assistant), "cancel", G_CALLBACK (cancel_install), NULL); g_signal_connect (G_OBJECT (assistant), "close", G_CALLBACK (close_install), NULL); /* Some trick to connect buttons with plugin move functions */ g_signal_connect(G_OBJECT(((GtkAssistant *) assistant)->forward), "clicked", G_CALLBACK(plugin_next), NULL); g_signal_connect(G_OBJECT(((GtkAssistant *) assistant)->back), "clicked", G_CALLBACK(plugin_previous), NULL); // Remove useless button and add usefull one gtk_assistant_remove_action_widget(GTK_ASSISTANT(assistant), (GtkWidget*)(((GtkAssistant *) assistant)->last)); GtkWidget *help = gtk_button_new_from_stock(GTK_STOCK_HELP); gtk_widget_show(help); g_signal_connect (G_OBJECT (help), "clicked", G_CALLBACK (show_help), NULL); gtk_assistant_add_action_widget(GTK_ASSISTANT(assistant), help); /* Load a nice image */ GdkPixbuf *pixbuf = gdk_pixbuf_new_from_file (g_strdup_printf("%s/headlogo.png", IMAGEDIR), &gerror); if(!pixbuf) { fprintf(stdout, "error message: %s\n", gerror->message); } /* Set it as icon window */ gtk_window_set_icon(GTK_WINDOW (assistant),pixbuf); /* Make ugly colors ;) */ gdk_color_parse ("#94b6db", &color); gtk_widget_modify_bg (assistant, GTK_STATE_SELECTED, &color); /*gdk_color_parse ("black", &color); gtk_widget_modify_fg (assistant, GTK_STATE_SELECTED, &color);*/ /* Load plugins.... */ fwife_load_plugins(PLUGINDIR); plugin_list = g_list_sort(plugin_list, sort_plugins); /*Allocate memory for stocking pages */ MALLOC(pages, sizeof(PageInfo)*g_list_length(plugin_list)); //* Initializing pages... *// for(i=0; i<g_list_length(plugin_list); i++) { if ((plugin = g_list_nth_data(plugin_list, i)) == NULL) LOG("Error when loading plugins...\n"); else LOG("Loading plugin : %s\n", plugin->name); pages[i] = (PageInfo) {NULL, -1, GET_UTF8(plugin->desc()), plugin->type, plugin->complete}; if ((pages[i].widget = plugin->load_gtk_widget()) == NULL) { LOG("Error when loading plugin's widget @ %s\n", plugin->name); } pages[i].index = gtk_assistant_append_page (GTK_ASSISTANT (assistant), pages[i].widget); gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), pages[i].widget, pages[i].title); gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), pages[i].widget, pages[i].type); gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), pages[i].widget, pages[i].complete); gtk_assistant_set_page_header_image(GTK_ASSISTANT (assistant), pages[i].widget,pixbuf); } //* Begin with first plugin *// plugin_active = g_list_nth_data(plugin_list, 0); gtk_widget_show_all (assistant); // begin event loop gtk_main (); return 0; }