本文整理汇总了C++中GTK_ASSISTANT函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_ASSISTANT函数的具体用法?C++ GTK_ASSISTANT怎么用?C++ GTK_ASSISTANT使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GTK_ASSISTANT函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: on_druid_get_new_page
static void
on_druid_get_new_page (AnjutaAutogen* gen, gpointer data)
{
NPWDruid* druid = (NPWDruid *)data;
gint current;
NPWPage* page;
current = gtk_assistant_get_current_page (GTK_ASSISTANT (druid->window));
page = g_queue_peek_nth (druid->page_list, current - (druid->no_selection ? 0 : 1));
if (npw_page_get_name (page) == NULL)
{
/* no page, display finish page */
npw_druid_fill_summary_page (druid);
page = g_queue_pop_nth (druid->page_list, current - (druid->no_selection ? 0 : 1));
if (page != NULL) npw_page_free (page);
gtk_container_remove (GTK_CONTAINER (druid->window), gtk_assistant_get_nth_page (GTK_ASSISTANT (druid->window), current + 1));
gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), current + 1);
}
else
{
/* display property page */
npw_druid_fill_property_page (druid, page);
gtk_assistant_set_current_page (GTK_ASSISTANT (druid->window), current + 1);
}
}
示例2: glade_gtk_assistant_set_property
void
glade_gtk_assistant_set_property (GladeWidgetAdaptor * adaptor,
GObject * object,
const gchar * property_name,
const GValue * value)
{
if (strcmp (property_name, "n-pages") == 0)
{
GtkAssistant *assistant = GTK_ASSISTANT (object);
gint size, i;
for (i = gtk_assistant_get_n_pages (GTK_ASSISTANT (object)),
size = g_value_get_int (value); i < size; i++)
{
g_message ("aaaa %d %d", i,size);
gtk_assistant_append_page (assistant, glade_placeholder_new ());
}
glade_gtk_assistant_update_page_type (assistant);
return;
}
/* Chain Up */
GWA_GET_CLASS (GTK_TYPE_WINDOW)->set_property (adaptor,
object, property_name, value);
}
示例3: assistant_instert_book_options_page
static void
assistant_instert_book_options_page (hierarchy_data *data)
{
kvp_frame *slots = qof_book_get_slots (gnc_get_current_book ());
GtkWidget *vbox = gtk_vbox_new (FALSE, 0);
data->options = gnc_option_db_new_for_type (QOF_ID_BOOK);
gnc_option_db_load_from_kvp (data->options, slots);
gnc_option_db_clean (data->options);
data->optionwin = gnc_options_dialog_new_modal (TRUE, _("New Book Options"));
gnc_options_dialog_build_contents_full (data->optionwin, data->options, FALSE);
gnc_options_dialog_set_close_cb (data->optionwin,
book_options_dialog_close_cb,
(gpointer)data->options);
gnc_options_dialog_set_new_book_option_values (data->options);
gtk_widget_reparent (gnc_options_dialog_notebook (data->optionwin), vbox);
gtk_widget_show_all (vbox);
gtk_assistant_insert_page (GTK_ASSISTANT(data->dialog), vbox, 2);
gtk_assistant_set_page_title (GTK_ASSISTANT(data->dialog), vbox, _("New Book Options"));
gtk_assistant_set_page_complete (GTK_ASSISTANT(data->dialog), vbox, TRUE);
}
示例4: create_page1
static void
create_page1 (GtkWidget *assistant)
{
GtkWidget *box, *label, *entry;
GdkPixbuf *pixbuf;
box = gtk_box_new (GTK_ORIENTATION_HORIZONTAL, 12);
gtk_container_set_border_width (GTK_CONTAINER (box), 12);
label = gtk_label_new ("You must fill out this entry to continue:");
gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0);
entry = gtk_entry_new ();
gtk_box_pack_start (GTK_BOX (box), entry, TRUE, TRUE, 0);
g_signal_connect (G_OBJECT (entry), "changed",
G_CALLBACK (on_entry_changed), assistant);
gtk_widget_show_all (box);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), box);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), box, "Page 1");
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), box, GTK_ASSISTANT_PAGE_INTRO);
pixbuf = gtk_widget_render_icon_pixbuf (assistant, GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG);
gtk_assistant_set_page_header_image (GTK_ASSISTANT (assistant), box, pixbuf);
g_object_unref (pixbuf);
}
示例5: show_error_summary
static void show_error_summary(TyonXceleratorCalibrationAssistant *assistant, gchar const * text) {
TyonXceleratorCalibrationAssistantPrivate *priv = assistant->priv;
gtk_label_set_text(priv->summary_label, text);
gtk_assistant_set_current_page(GTK_ASSISTANT(assistant), priv->summary_page_index);
#if (GTK_CHECK_VERSION(2, 22, 0))
gtk_assistant_commit(GTK_ASSISTANT(assistant));
#endif
}
示例6: append_intro_page
static void append_intro_page(TyonXceleratorCalibrationAssistant *assistant) {
GtkWidget *label;
label = gtk_label_new(_("You can calibrate the X-Celerator analog thumb paddle after pressing next"));
gtk_assistant_append_page(GTK_ASSISTANT(assistant), label);
gtk_assistant_set_page_title(GTK_ASSISTANT(assistant), label, _("Start calibration"));
gtk_assistant_set_page_type(GTK_ASSISTANT(assistant), label, GTK_ASSISTANT_PAGE_INTRO);
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), label, TRUE);
}
示例7: append_confirm_page
static void append_confirm_page(TyonXceleratorCalibrationAssistant *assistant) {
TyonXceleratorCalibrationAssistantPrivate *priv = assistant->priv;
priv->confirm_page = gtk_label_new(_("Finished!"));
priv->confirm_page_index = gtk_assistant_append_page(GTK_ASSISTANT(assistant), priv->confirm_page);
gtk_assistant_set_page_title(GTK_ASSISTANT(assistant), priv->confirm_page, _("Finish"));
gtk_assistant_set_page_type(GTK_ASSISTANT(assistant), priv->confirm_page, GTK_ASSISTANT_PAGE_CONFIRM);
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), priv->confirm_page, TRUE);
}
示例8: append_summary_page
static void append_summary_page(TyonXceleratorCalibrationAssistant *assistant) {
TyonXceleratorCalibrationAssistantPrivate *priv = assistant->priv;
priv->summary_page = gtk_label_new(NULL);
priv->summary_label = GTK_LABEL(priv->summary_page);
priv->summary_page_index = gtk_assistant_append_page(GTK_ASSISTANT(assistant), priv->summary_page);
gtk_assistant_set_page_title(GTK_ASSISTANT(assistant), priv->summary_page, _("Summary"));
gtk_assistant_set_page_type(GTK_ASSISTANT(assistant), priv->summary_page, GTK_ASSISTANT_PAGE_SUMMARY);
gtk_assistant_set_page_complete(GTK_ASSISTANT(assistant), priv->summary_page, TRUE);
}
示例9: npw_druid_add_new_page
static NPWPage*
npw_druid_add_new_page (NPWDruid* druid)
{
gint current;
NPWPage* page;
/* Get page in cache */
current = gtk_assistant_get_current_page (GTK_ASSISTANT (druid->window));
page = g_queue_peek_nth (druid->page_list, current - (druid->no_selection ? 0 : 1) + 1);
if (page == NULL)
{
/* Page not found in cache, create */
GtkBuilder *builder;
GtkWidget *widget;
GtkAssistantPageType type;
GtkWidget *table;
GtkAssistant *assistant;
/* Build another complete wizard dialog from the gtk builder file
* but keep only the property assistant page */
builder = gtk_builder_new ();
if (!gtk_builder_add_from_file (builder, GTK_BUILDER_UI_FILE, NULL))
{
g_warn_if_reached ();
g_object_unref (builder);
return NULL;
}
assistant = GTK_ASSISTANT (gtk_builder_get_object (builder, NEW_PROJECT_DIALOG));
widget = GTK_WIDGET (gtk_builder_get_object (builder, PROPERTY_PAGE));
table = GTK_WIDGET (gtk_builder_get_object (builder, PROPERTY_TABLE));
type = gtk_assistant_get_page_type (assistant, widget);
gtk_container_remove (GTK_CONTAINER (assistant), widget);
gtk_assistant_insert_page (GTK_ASSISTANT (druid->window), widget, current + 1);
gtk_assistant_set_page_type (GTK_ASSISTANT (druid->window), widget, type);
gtk_assistant_set_page_complete (GTK_ASSISTANT (druid->window), widget, TRUE);
gtk_widget_destroy (GTK_WIDGET (assistant));
/* Builder get reference on all built widget, so unref it when all work is done */
g_object_unref (builder);
/* Create new page */
page = npw_page_new (druid->values);
npw_page_set_widget (page, table);
/* Add page in cache */
g_queue_push_tail (druid->page_list, page);
}
return page;
}
示例10: validAssistantNewCsuOne
/*!
* \fn G_MODULE_EXPORT void validAssistantNewCsuOne(GtkWidget *widget, gpointer data)
* Valid the first page of 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 validAssistantNewCsuOne(GtkWidget *widget, gpointer data)
{
globalData *user_data = (globalData*) data;
gchar name[SIZE_MAX_FILE_NAME];
gint index;
gchar *folder;
bool folder_ok;
bool filename_ok;
GtkWidget *grid_1 = getWidgetFromBuilder(user_data->ptr_builder,"grid_new_csu_file_assistant_1");
/* Get the filename, the index of the game configuration and the folder */
g_utf8_strncpy(name,gtk_entry_get_text(GTK_ENTRY(gtk_grid_get_child_at(GTK_GRID(grid_1),1,0))),SIZE_MAX_FILE_NAME/8);
index = gtk_combo_box_get_active(GTK_COMBO_BOX(gtk_grid_get_child_at(GTK_GRID(grid_1),1,3)));
folder = g_locale_from_utf8(gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(gtk_grid_get_child_at(GTK_GRID(grid_1),1,1))),-1,NULL,NULL,NULL);
#ifndef PORTABLE
folder_ok = changeSystemPath(folder);
#else
folder_ok = checkPath(folder);
#endif // PORTABLE
filename_ok = checkFilename(name,folder);
/* Test the filename */
if (strcmp(name,"") == 0 || filename_ok == false)
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,0)),0,TRUE,100,0,0,FALSE,0,0,0);
else
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,0)),0,FALSE,100,0,0,FALSE,0,0,0);
/* Test if a game configuration is selected */
if (index < 0 )
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,3)),0,TRUE,100,0,0,FALSE,0,0,0);
else
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,3)),0,FALSE,100,0,0,FALSE,0,0,0);
/* Test the folder */
if (folder_ok == false)
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,1)),0,TRUE,100,0,0,FALSE,0,0,0);
else
setGtkLabelAttributes(GTK_LABEL(gtk_grid_get_child_at(GTK_GRID(grid_1),0,1)),0,FALSE,100,0,0,FALSE,0,0,0);
/* Test if the page one is valid or not */
if (strcmp(name,"") != 0 && index >=0 && folder_ok != false && filename_ok == true)
{
gtk_assistant_set_page_complete(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_1,TRUE);
if (user_data->ptr_csu_struct_tmp != NULL)
closeCsuStruct(user_data->ptr_csu_struct_tmp);
user_data->ptr_csu_struct_tmp = newCsuStruct(gtk_spin_button_get_value_as_int(GTK_SPIN_BUTTON(gtk_grid_get_child_at(GTK_GRID(grid_1),1,2))),user_data->config);
}
else
gtk_assistant_set_page_complete(GTK_ASSISTANT(user_data->ptr_new_csu_file_assistant),grid_1,FALSE);
g_free(folder);
}
示例11: create_page3
static void
create_page3 (GtkWidget *assistant)
{
GtkWidget *label;
label = gtk_label_new ("This is a confirmation page, press 'Apply' to apply changes");
gtk_widget_show (label);
gtk_assistant_append_page (GTK_ASSISTANT (assistant), label);
gtk_assistant_set_page_type (GTK_ASSISTANT (assistant), label, GTK_ASSISTANT_PAGE_CONFIRM);
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), label, TRUE);
gtk_assistant_set_page_title (GTK_ASSISTANT (assistant), label, "Confirmation");
}
示例12: eee_account_wizard_page
GtkWidget* eee_account_wizard_page(EPlugin *epl, EConfigHookItemFactoryData *data)
{
GtkWidget *page, *panel, *section, *checkbutton_status, *label;
char *title = _("3e Calendar Account");
assistant = GTK_ASSISTANT(data->parent);
if (data->old)
return data->old;
page = gtk_vbox_new (FALSE, 12);
gtk_container_set_border_width (GTK_CONTAINER (page), 12);
// toplevel vbox contains frames that group 3E account settings into various
// groups
// Status group
section = add_section(page, _("Enable 3e calendar account"));
// char* note = g_strdup(_("3e calendar server has been found for your domain. You can enable\n"
// "calendar account if you have it. If you don't know ask your system\n"
// "administrator or provider of your email service. Go to email account\n"
// "preferences to change this setting later."));
label = GTK_WIDGET(g_object_new(GTK_TYPE_LABEL,
"label", "",
"use-markup", TRUE,
"justify", GTK_JUSTIFY_LEFT,
"xalign", 0,
"yalign", 0.5,
NULL));
// g_free(note);
lbl = (GtkLabel*)label;
gtk_box_pack_start(GTK_BOX(section), label, FALSE, FALSE, 0);
checkbutton_status = gtk_check_button_new_with_label(_("Enable 3e calendar account"));
gtk_widget_set_can_focus (checkbutton_status, FALSE);
gtk_box_pack_start(GTK_BOX(section), checkbutton_status, FALSE, FALSE, 0);
gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(checkbutton_status), TRUE);
g_signal_connect(checkbutton_status, "toggled", G_CALLBACK(wizard_chb_status_changed), (gpointer)title);
gtk_widget_show_all(page);
gtk_assistant_append_page(GTK_ASSISTANT(data->parent), page);
gtk_assistant_set_page_title (GTK_ASSISTANT(data->parent), page, title);
gtk_assistant_set_page_type (GTK_ASSISTANT(data->parent), page, GTK_ASSISTANT_PAGE_CONTENT);
// g_object_set_data((GObject *)data->parent, "restore", GINT_TO_POINTER(FALSE));
return GTK_WIDGET(page);
}
示例13: progresswindow
void RemoteRepositoryAssistant::entry_changed_timeout()
{
// Progress.
ProgressWindow progresswindow (_("Testing read access"), false);
progresswindow.set_fraction (0.5);
// Event done.
event_id_entry_repository = 0;
// Test read access to the repository.
GwSpawn spawn("git");
spawn.arg("ls-remote");
spawn.arg(repository_url_get());
spawn.read();
spawn.run();
bool access = spawn.exitstatus == 0;
ustring message;
if (access) {
message = _("Read access to the repository has been granted");
} else {
message = _("Cannot access the repository:");
for (unsigned int i = 0; i < spawn.standarderr.size(); i++) {
message.append("\n");
message.append(spawn.standarderr[i]);
}
}
gtk_label_set_text (GTK_LABEL (label_repository_accessible), message.c_str());
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant), vbox_repository, access);
}
示例14: dsn_name_changed_cb
static void
dsn_name_changed_cb (GtkEntry *entry, GdauiDsnAssistant *assistant)
{
const gchar *name;
gboolean page_complete = TRUE;
GdaDsnInfo *dsn_info;
/* check required fields have values */
name = gtk_entry_get_text (GTK_ENTRY (assistant->priv->general_name));
if (!name || strlen (name) < 1) {
gtk_widget_grab_focus (assistant->priv->general_name);
page_complete = FALSE;
}
dsn_info = gda_config_get_dsn_info (name);
if (dsn_info) {
gint i = 2;
gchar *str = NULL;
do {
g_free (str);
str = g_strdup_printf ("%s_%d", name, i);
dsn_info = gda_config_get_dsn_info (str);
} while (dsn_info);
gtk_entry_set_text (entry, str);
g_free (str);
/*gtk_widget_grab_focus (assistant->priv->general_name);*/
}
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant),
assistant->priv->general_page,
page_complete);
}
示例15: dsn_auth_changed_cb
static void
dsn_auth_changed_cb (GdauiProviderAuthEditor *auth, GdauiDsnAssistant *assistant)
{
gtk_assistant_set_page_complete (GTK_ASSISTANT (assistant),
assistant->priv->cnc_auth_page,
_gdaui_provider_auth_editor_is_valid (auth));
}