• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GTK_INFO_BAR函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GTK_INFO_BAR函数的典型用法代码示例。如果您正苦于以下问题:C++ GTK_INFO_BAR函数的具体用法?C++ GTK_INFO_BAR怎么用?C++ GTK_INFO_BAR使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GTK_INFO_BAR函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: report_error

static void report_error(struct gui_entry *ge, GError *error)
{
	struct gui *ui = ge->ui;

	if (ui->error_info_bar == NULL) {
		GtkWidget *container;

		ui->error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK,
						GTK_RESPONSE_OK, NULL);
		g_signal_connect(ui->error_info_bar, "response", G_CALLBACK(on_info_bar_response), ui);
		gtk_info_bar_set_message_type(GTK_INFO_BAR(ui->error_info_bar),
						GTK_MESSAGE_ERROR);

		ui->error_label = gtk_label_new(error->message);
		container = gtk_info_bar_get_content_area(GTK_INFO_BAR(ui->error_info_bar));
		gtk_container_add(GTK_CONTAINER(container), ui->error_label);

		gtk_box_pack_start(GTK_BOX(ui->vbox), ui->error_info_bar, FALSE, FALSE, 0);
		gtk_widget_show_all(ui->vbox);
	} else {
		char buffer[256];
		snprintf(buffer, sizeof(buffer), "Failed to open file.");
		gtk_label_set_text(GTK_LABEL(ui->error_label), buffer);
	}
}
开发者ID:Andiry,项目名称:fio,代码行数:25,代码来源:gerror.c


示例2: report_error

void report_error(GError* error)
{
	if (error == NULL)
	{
		return;
	}
	
	if (error_info_bar == NULL)
	{
		error_count = 1;
		error_info_bar = gtk_info_bar_new_with_buttons(GTK_STOCK_OK,
		                                               GTK_RESPONSE_OK,
		                                               NULL);
		g_signal_connect(error_info_bar, "response", G_CALLBACK(on_info_bar_response), NULL);
		gtk_info_bar_set_message_type(GTK_INFO_BAR(error_info_bar),
		                              GTK_MESSAGE_ERROR);
		
		error_label = gtk_label_new(error->message);
		GtkWidget *container = gtk_info_bar_get_content_area(GTK_INFO_BAR(error_info_bar));
		gtk_container_add(GTK_CONTAINER(container), error_label);
		
		gtk_box_pack_start(GTK_BOX(main_vbox), error_info_bar, FALSE, FALSE, 0);
		gtk_widget_show_all(main_vbox);
	}
	else
	{
		error_count++;
		char buffer[256];
		snprintf(buffer, sizeof(buffer), "Failed to open %i files.", error_count);
		gtk_label_set(GTK_LABEL(error_label), buffer);
	}
}
开发者ID:leaonfm,项目名称:subsurface,代码行数:32,代码来源:gtk-gui.c


示例3: spice_usb_device_widget_show_info_bar

static void
spice_usb_device_widget_show_info_bar(SpiceUsbDeviceWidget *self,
                                      const gchar          *message,
                                      GtkMessageType        message_type,
                                      const gchar          *stock_icon_id)
{
    SpiceUsbDeviceWidgetPrivate *priv = self->priv;
    GtkWidget *info_bar, *content_area, *hbox, *widget;

    spice_usb_device_widget_hide_info_bar(self);

    info_bar = gtk_info_bar_new();
    gtk_info_bar_set_message_type(GTK_INFO_BAR(info_bar), message_type);

    content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar));
#if GTK_CHECK_VERSION(3,0,0)
    hbox = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 12);
#else
    hbox = gtk_hbox_new(FALSE, 12);
#endif
    gtk_container_add(GTK_CONTAINER(content_area), hbox);

    widget = gtk_image_new_from_stock(stock_icon_id,
                                      GTK_ICON_SIZE_SMALL_TOOLBAR);
    gtk_box_pack_start(GTK_BOX(hbox), widget, FALSE, FALSE, 0);

    widget = gtk_label_new(message);
    gtk_box_pack_start(GTK_BOX(hbox), widget, TRUE, TRUE, 0);

    priv->info_bar = gtk_alignment_new(0.0, 0.0, 1.0, 0.0);
    gtk_alignment_set_padding(GTK_ALIGNMENT(priv->info_bar), 0, 0, 12, 0);
    gtk_container_add(GTK_CONTAINER(priv->info_bar), info_bar);
    gtk_box_pack_start(GTK_BOX(self), priv->info_bar, FALSE, FALSE, 0);
    gtk_widget_show_all(priv->info_bar);
}
开发者ID:dezelin,项目名称:spice-gtk,代码行数:35,代码来源:usb-device-widget.c


示例4: create_info_bar_import_music

GtkWidget * create_info_bar_import_music(struct con_win *cwin)
{
	const gchar *dir = g_get_user_special_dir(G_USER_DIRECTORY_MUSIC);

	GtkWidget *info_bar = gtk_info_bar_new();
	GtkWidget *action_area = gtk_info_bar_get_action_area(GTK_INFO_BAR (info_bar));
	GtkWidget *content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar));

	gtk_orientable_set_orientation(GTK_ORIENTABLE(action_area), GTK_ORIENTATION_HORIZONTAL);

	//GtkInfoBar has undocumented behavior for GTK_RESPONSE_CANCEL
	gtk_info_bar_add_button(GTK_INFO_BAR(info_bar), GTK_STOCK_NO, GTK_RESPONSE_CANCEL);
	gtk_info_bar_add_button(GTK_INFO_BAR(info_bar), GTK_STOCK_YES, GTK_RESPONSE_YES);

	gchar *content = g_strdup_printf(_("Would you like to import %s to library?"), dir);

	GtkWidget *label = gtk_label_new(content);
	gtk_box_pack_start(GTK_BOX(content_area), label, FALSE, FALSE, 0);

	g_signal_connect(info_bar, "response", G_CALLBACK(info_bar_response_cb), cwin);

	gtk_widget_show_all(info_bar);

	g_free(content);

	return info_bar;
}
开发者ID:pingax,项目名称:pragha,代码行数:27,代码来源:info-bar-import-music.c


示例5: tabmanagergui_create_infobar

void tabmanagergui_create_infobar (GuTabPage* tp) {
    // we will probably want to make a separate file for infobar 
    // procedures that we can attach to hboxes in both the editor 
    // and the preview window, TODO for 0.7.0 -Alex
    GtkWidget* infobar = NULL;
    GtkWidget* message = NULL;
    GtkWidget* area = NULL;
    
    infobar = gtk_info_bar_new ();
    gtk_widget_set_no_show_all (infobar, TRUE);
    message = gtk_label_new ("");
    gtk_label_set_line_wrap (GTK_LABEL(message), TRUE);
    
    gtk_widget_show (message);
    area = gtk_info_bar_get_content_area (GTK_INFO_BAR (infobar));
    gtk_container_add (GTK_CONTAINER (area), message);
    
    gtk_info_bar_add_button (GTK_INFO_BAR (infobar),
                            GTK_STOCK_YES, GTK_RESPONSE_YES);
    gtk_info_bar_add_button (GTK_INFO_BAR (infobar),
                            GTK_STOCK_NO, GTK_RESPONSE_NO);
                  
    gtk_info_bar_set_message_type (GTK_INFO_BAR (infobar),
                                  GTK_MESSAGE_WARNING);
                                  
    tp->barlabel = message;
    tp->infobar = infobar;
}
开发者ID:JasonGross,项目名称:gummi,代码行数:28,代码来源:gui-tabmanager.c


示例6: show_info_bar

static void
show_info_bar(GtWin* self)
{
    GtWinPrivate* priv = gt_win_get_instance_private(self);
    QueuedInfoData* data = g_queue_pop_head(priv->info_queue);

    if (data)
    {
        if (data->cb)
        {
            if (data->cb == G_CALLBACK(show_error_dialogue_cb))
            {
                gtk_widget_set_visible(priv->info_bar_ok_button, FALSE);
                gtk_widget_set_visible(priv->info_bar_yes_button, FALSE);
                gtk_widget_set_visible(priv->info_bar_no_button, FALSE);
                gtk_widget_set_visible(priv->info_bar_details_button, TRUE);
                gtk_widget_set_visible(priv->info_bar_close_button, TRUE);
                gtk_label_set_markup(GTK_LABEL(priv->info_label), data->msg);
                gtk_info_bar_set_message_type(GTK_INFO_BAR(priv->info_bar), GTK_MESSAGE_ERROR);

                g_signal_connect(priv->info_bar, "response", G_CALLBACK(data->cb), data->udata);
            }
            else
            {

                g_signal_connect(priv->info_bar, "response", G_CALLBACK(data->cb), data->udata);

                gtk_widget_set_visible(priv->info_bar_ok_button, FALSE);
                gtk_widget_set_visible(priv->info_bar_yes_button, TRUE);
                gtk_widget_set_visible(priv->info_bar_no_button, TRUE);
                gtk_widget_set_visible(priv->info_bar_details_button, FALSE);
                gtk_widget_set_visible(priv->info_bar_close_button, FALSE);
                gtk_label_set_markup(GTK_LABEL(priv->info_label), data->msg);
                gtk_info_bar_set_message_type(GTK_INFO_BAR(priv->info_bar), GTK_MESSAGE_QUESTION);
            }
        }
        else
        {
            gtk_widget_set_visible(priv->info_bar_yes_button, FALSE);
            gtk_widget_set_visible(priv->info_bar_no_button, FALSE);
            gtk_widget_set_visible(priv->info_bar_ok_button, TRUE);
            gtk_widget_set_visible(priv->info_bar_details_button, FALSE);
            gtk_widget_set_visible(priv->info_bar_close_button, FALSE);
            gtk_label_set_markup(GTK_LABEL(priv->info_label), data->msg);
            gtk_info_bar_set_message_type(GTK_INFO_BAR(priv->info_bar), GTK_MESSAGE_INFO);
        }

        priv->cur_info_data = data;

        gtk_revealer_set_reveal_child(GTK_REVEALER(priv->info_revealer), TRUE);
    }
    else
    {
        priv->cur_info_data = NULL;

        gtk_revealer_set_reveal_child(GTK_REVEALER(priv->info_revealer), FALSE);
    }
}
开发者ID:AlejandroC90,项目名称:gnome-twitch,代码行数:58,代码来源:gt-win.c


示例7: create_top_bar

static GtkWidget *
create_top_bar (EmpathyAppPluginWidget *self)
{
  GtkWidget *bar, *content, *action, *label;
  GtkCssProvider *css;
  AgProvider *provider;
  gchar *str;
  GError *error = NULL;

  bar = gtk_info_bar_new_with_buttons (
      GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
      _("Done"), GTK_RESPONSE_OK,
      NULL);
  gtk_widget_set_hexpand (bar, TRUE);
  gtk_info_bar_set_message_type (GTK_INFO_BAR (bar), GTK_MESSAGE_QUESTION);
  action = gtk_info_bar_get_action_area (GTK_INFO_BAR (bar));
  gtk_orientable_set_orientation (GTK_ORIENTABLE (action),
      GTK_ORIENTATION_HORIZONTAL);
  gtk_widget_set_name (bar, "authorization-infobar");
  css = gtk_css_provider_new ();
  if (gtk_css_provider_load_from_data (css,
          "@define-color question_bg_color rgb (222, 222, 222);"
          "GtkInfoBar#authorization-infobar"
          "{"
          "  color: @fg_color;"
          "}",
          -1, &error))
    {
      GtkStyleContext *context = gtk_widget_get_style_context (bar);

      gtk_style_context_add_provider (context, (GtkStyleProvider *) css,
          GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
    }
  else
    {
      g_warning ("Error processing CSS theme override: %s", error->message);
      g_clear_error (&error);
    }
  g_object_unref (css);

  content = gtk_info_bar_get_content_area (GTK_INFO_BAR (bar));

  provider = ag_manager_get_provider (
      ag_account_get_manager (self->priv->account),
      ag_account_get_provider_name (self->priv->account));
  str = g_strdup_printf (_("Edit %s account options"),
      ag_provider_get_display_name (provider));
  label = gtk_label_new (str);
  gtk_container_add (GTK_CONTAINER (content), label);
  gtk_widget_show (label);
  ag_provider_unref (provider);
  g_free (str);

  g_signal_connect (bar, "response",
      G_CALLBACK (response_cb), self);

  return bar;
}
开发者ID:Evnsan,项目名称:empathy,代码行数:58,代码来源:empathy-app-plugin-widget.c


示例8: instance_init

/*! \private
 *  \brief Initialize GschemTranslateWidget instance
 *
 *  \param [in,out] widget the GschemTranslateWidget
 */
static void
instance_init (GschemTranslateWidget *widget)
{
  GtkWidget *action = gtk_info_bar_get_action_area (GTK_INFO_BAR (widget));
  GtkWidget *button_box;
  GtkWidget *cancel_button;
  GtkWidget *content = gtk_info_bar_get_content_area (GTK_INFO_BAR (widget));

  g_return_if_fail (widget != NULL);

  gtk_widget_set_no_show_all (GTK_WIDGET (widget), TRUE);

  widget->label = gtk_label_new (NULL);
  gtk_widget_set_visible (widget->label, TRUE);
  gtk_box_pack_start (GTK_BOX (content), widget->label, FALSE, FALSE, 0);

  widget->entry = gtk_entry_new ();
  gtk_widget_set_visible (widget->entry, TRUE);
  gtk_box_pack_start (GTK_BOX (content), widget->entry, TRUE, TRUE, 0);

  button_box = gtk_hbutton_box_new ();
  gtk_widget_set_visible (button_box, TRUE);
  gtk_box_pack_start (GTK_BOX (content), button_box, FALSE, FALSE, 0);

  widget->evaluate_button = gtk_button_new_with_label (_("Translate"));
  gtk_widget_set_sensitive (widget->evaluate_button, FALSE);
  gtk_widget_set_visible (widget->evaluate_button, TRUE);
  gtk_box_pack_start (GTK_BOX (button_box), widget->evaluate_button, FALSE, FALSE, 0);

  cancel_button = gtk_button_new_from_stock (GTK_STOCK_CANCEL);
  gtk_widget_set_visible (cancel_button, TRUE);
  gtk_box_pack_start (GTK_BOX (button_box), cancel_button, FALSE, FALSE, 0);

  gtk_widget_set_no_show_all (action, TRUE);
  gtk_widget_set_visible (action, FALSE);

  g_signal_connect (G_OBJECT (widget->entry),
                    "activate",
                    G_CALLBACK (activate_entry),
                    widget);

  g_signal_connect (G_OBJECT (cancel_button),
                    "clicked",
                    G_CALLBACK (click_cancel),
                    widget);

  g_signal_connect (G_OBJECT (widget->evaluate_button),
                    "clicked",
                    G_CALLBACK (click_evaluate),
                    widget);

  g_signal_connect (G_OBJECT (widget->entry),
                    "notify::text",
                    G_CALLBACK (notify_entry_text),
                    widget);
}
开发者ID:gareth8118,项目名称:geda-gaf,代码行数:61,代码来源:gschem_translate_widget.c


示例9: activate_entry

/* Callback for when the user presses enter in the entry widget
 */
static void
activate_entry (GtkWidget *entry, GschemTranslateWidget *widget)
{
  g_return_if_fail (widget != NULL);

  if (gtk_entry_get_text_length (GTK_ENTRY (widget->entry)) == 0) {
    gtk_info_bar_response (GTK_INFO_BAR (widget), GTK_RESPONSE_CANCEL);
  }
  else if (convert_value (gtk_entry_get_text (GTK_ENTRY (widget->entry)), NULL)) {
    gtk_info_bar_response (GTK_INFO_BAR (widget), GTK_RESPONSE_OK);
  }
}
开发者ID:gareth8118,项目名称:geda-gaf,代码行数:14,代码来源:gschem_translate_widget.c


示例10: activate_entry

/* Callback for when the user presses enter in the entry widget
 */
static void
activate_entry (GtkWidget *entry, GschemShowHideTextWidget *widget)
{
  g_return_if_fail (widget != NULL);

  if (gtk_entry_get_text_length (GTK_ENTRY (widget->entry)) > 0) {
    gtk_info_bar_response (GTK_INFO_BAR (widget), GTK_RESPONSE_OK);
  }
  else {
    gtk_info_bar_response (GTK_INFO_BAR (widget), GTK_RESPONSE_CANCEL);
  }
}
开发者ID:rlutz,项目名称:geda-gaf,代码行数:14,代码来源:gschem_show_hide_text_widget.c


示例11: button_clicked

static void button_clicked(GtkWidget *button, gchar* message)
{
    gchar *text = g_strdup_printf("InfoBar displaying %s message", message);
    gtk_label_set_text(GTK_LABEL(label), text);
    if (message == "information")
        gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_INFO);
    else if (message == "warning")
        gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_WARNING);
    else if (message == "question")
        gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_QUESTION);
    else if (message == "error")
        gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_ERROR);
    gtk_widget_show(GTK_WIDGET(infobar));
}
开发者ID:dsqiu,项目名称:qzystudy,代码行数:14,代码来源:infobar.c


示例12: setup_root_info_bar

static void
setup_root_info_bar (NemoToolbar *self) {

    GtkWidget *root_bar = gtk_info_bar_new ();
    gtk_info_bar_set_message_type (GTK_INFO_BAR (root_bar), GTK_MESSAGE_ERROR);
    GtkWidget *content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (root_bar));

    GtkWidget *label = gtk_label_new (_("Elevated Privileges"));
    gtk_widget_show (label);
    gtk_container_add (GTK_CONTAINER (content_area), label);

    self->priv->root_bar = root_bar;
    gtk_box_pack_start (GTK_BOX (self), self->priv->root_bar, TRUE, TRUE, 0);
}
开发者ID:leigh123linux,项目名称:nemo,代码行数:14,代码来源:nemo-toolbar.c


示例13: gtk_info_bar_new

GtkWidget *gnome_info_bar(gchar *message, GtkMessageType type)
{
    GtkWidget *info_bar = gtk_info_bar_new();
    gtk_widget_set_no_show_all(info_bar, TRUE);
    GtkWidget *message_label = gtk_label_new(NULL);
    gtk_widget_show(message_label);
    GtkWidget *content_area = gtk_info_bar_get_content_area(GTK_INFO_BAR(info_bar));
    gtk_container_add(GTK_CONTAINER(content_area), message_label);
    gtk_label_set_markup(GTK_LABEL(message_label), message);
    gtk_info_bar_set_message_type(GTK_INFO_BAR(info_bar), type);
    gtk_widget_show(info_bar);

    return info_bar;
}
开发者ID:ThereIsNoYeti,项目名称:sflphone,代码行数:14,代码来源:utils.c


示例14: _compare_on_changed

/* compare_on_changed */
static void _compare_on_changed(gpointer data)
{
	Compare * compare = data;
	GtkLabel * label = GTK_LABEL(compare->label);
	char const * string1;
	char const * string2;
	GtkMessageType type = GTK_MESSAGE_OTHER;

	string1 = gtk_entry_get_text(GTK_ENTRY(compare->entry1));
	string2 = gtk_entry_get_text(GTK_ENTRY(compare->entry2));
	if(string1[0] == '\0' && string2[0] == '\0')
		gtk_label_set_text(label, "");
	else if(strcmp(string1, string2) == 0)
	{
		gtk_label_set_text(label, _("The strings MATCH"));
		type = GTK_MESSAGE_INFO;
	}
	else
	{
		gtk_label_set_text(label, _("The strings do NOT match"));
		type = GTK_MESSAGE_ERROR;
	}
#if GTK_CHECK_VERSION(2, 18, 0)
	gtk_info_bar_set_message_type(GTK_INFO_BAR(compare->infobar), type);
#endif
}
开发者ID:DeforaOS,项目名称:Accessories,代码行数:27,代码来源:compare.c


示例15: missing_plugins_retry_cb

static void
missing_plugins_retry_cb (gpointer instance, gboolean installed, RBImportErrorsSource *source)
{
	GtkTreeIter iter;
	RhythmDBEntryType *error_entry_type;

	gtk_info_bar_set_response_sensitive (GTK_INFO_BAR (source->priv->infobar),
					     GTK_RESPONSE_OK,
					     TRUE);

	if (installed == FALSE) {
		rb_debug ("installer failed, not retrying imports");
		return;
	}

	g_object_get (source, "entry-type", &error_entry_type, NULL);

	do {
		RhythmDBEntry *entry;

		entry = rhythmdb_query_model_iter_to_entry (source->priv->missing_plugin_model, &iter);
		rhythmdb_add_uri_with_types (source->priv->db,
					     rhythmdb_entry_get_string (entry, RHYTHMDB_PROP_LOCATION),
					     source->priv->normal_entry_type,
					     source->priv->ignore_entry_type,
					     error_entry_type);
	} while (gtk_tree_model_iter_next (GTK_TREE_MODEL (source->priv->missing_plugin_model), &iter));

	g_object_unref (error_entry_type);
}
开发者ID:dignan,项目名称:control,代码行数:30,代码来源:rb-import-errors-source.c


示例16: selections__gth_browser_update_extra_widget_cb

void
selections__gth_browser_update_extra_widget_cb (GthBrowser *browser)
{
    GthFileData *location_data;
    GtkWidget   *info_bar;
    int          n_selection;
    char        *msg;

    location_data = gth_browser_get_location_data (browser);
    if (! _g_content_type_is_a (g_file_info_get_content_type (location_data->info), "gthumb/selection"))
        return;

    n_selection = g_file_info_get_attribute_int32 (location_data->info, "gthumb::n-selection");
    if (n_selection <= 0)
        return;

    info_bar = gth_browser_get_list_info_bar (browser);
    gtk_info_bar_set_message_type (GTK_INFO_BAR(info_bar), GTK_MESSAGE_INFO);
    gth_info_bar_set_icon_name (GTH_INFO_BAR (info_bar), "dialog-information-symbolic", GTK_ICON_SIZE_MENU);
    gth_info_bar_set_primary_text (GTH_INFO_BAR (info_bar), NULL);
    msg = g_strdup_printf (_("Use Alt-%d to add files to this selection, Ctrl-%d to view this selection."), n_selection, n_selection);
    gth_info_bar_set_secondary_text (GTH_INFO_BAR (info_bar), msg);
    gtk_widget_show (info_bar);

    g_free (msg);
}
开发者ID:rlfbckr,项目名称:gthumb,代码行数:26,代码来源:callbacks.c


示例17: gtkui_cheats_par_add

void gtkui_cheats_par_add(GtkWidget *widget, gpointer userdata) {
	// Add a Pro Action Rocky code to the list
	GtkTreeIter iter;
	
	Cheats cheats(emulator);
	Cheats::Code code;
	
	char codebuf[9];
	char descbuf[512];
	
	snprintf(codebuf, sizeof(codebuf), "%.8s", gtk_entry_get_text(GTK_ENTRY(paredit)));
	snprintf(descbuf, sizeof(descbuf), "%s", gtk_entry_get_text(GTK_ENTRY(descedit)));
	
	if (cheats.ProActionRockyDecode(codebuf, code) == Nes::RESULT_OK) {
		gtk_tree_store_append(treestore, &iter, NULL);
		gtk_tree_store_set(treestore, &iter,
					0, true,
					1, codebuf,
					4, descbuf,
					-1);
		gtk_entry_set_text(GTK_ENTRY(descedit), "");
		gtk_entry_set_text(GTK_ENTRY(ggedit), "");
		gtk_entry_set_text(GTK_ENTRY(paredit), "");
		gtk_widget_hide(infobar);
		gtk_label_set_text(GTK_LABEL(infolabel), "");
		cheats.SetCode(code);
	}
	else {
		gtk_info_bar_set_message_type(GTK_INFO_BAR(infobar), GTK_MESSAGE_ERROR);
		gtk_label_set_text(GTK_LABEL(infolabel), "Error: Invalid PAR code");
		gtk_widget_show(infobar);
	}
}
开发者ID:joepogo,项目名称:nestopia,代码行数:33,代码来源:gtkui_cheats.cpp


示例18: GTKAddButton

void wxInfoBar::ShowMessage(const wxString& msg, int flags)
{
    if ( !UseNative() )
    {
        wxInfoBarGeneric::ShowMessage(msg, flags);
        return;
    }

    // if we don't have any buttons, create a standard close one to give the
    // user at least some way to close the bar
    if ( m_impl->m_buttons.empty() && !m_impl->m_close )
    {
        m_impl->m_close = GTKAddButton(wxID_CLOSE);
    }

    GtkMessageType type;
    if ( wxGTKImpl::ConvertMessageTypeFromWX(flags, &type) )
        gtk_info_bar_set_message_type(GTK_INFO_BAR(m_widget), type);
    gtk_label_set_text(GTK_LABEL(m_impl->m_label), wxGTK_CONV(msg));

    if ( !IsShown() )
        Show();

    UpdateParent();
}
开发者ID:3v1n0,项目名称:wxWidgets,代码行数:25,代码来源:infobar.cpp


示例19: gtk_info_bar_set_message_type

void
InterfaceGtk::msg_clear(void)
{
	gtk_info_bar_set_message_type(GTK_INFO_BAR(info_widget),
				      GTK_MESSAGE_OTHER);
	gtk_label_set_text(GTK_LABEL(message_widget), "");
}
开发者ID:Yomin,项目名称:sciteco,代码行数:7,代码来源:interface-gtk.cpp


示例20: nautilus_trash_bar_init

static void
nautilus_trash_bar_init (NautilusTrashBar *bar)
{
	GtkWidget *content_area, *action_area, *w;
	GtkWidget *label;
	PangoAttrList *attrs;

	bar->priv = NAUTILUS_TRASH_BAR_GET_PRIVATE (bar);
	content_area = gtk_info_bar_get_content_area (GTK_INFO_BAR (bar));
	action_area = gtk_info_bar_get_action_area (GTK_INFO_BAR (bar));

	gtk_orientable_set_orientation (GTK_ORIENTABLE (action_area),
					GTK_ORIENTATION_HORIZONTAL);

	attrs = pango_attr_list_new ();
	pango_attr_list_insert (attrs, pango_attr_weight_new (PANGO_WEIGHT_BOLD));
	label = gtk_label_new (_("Trash"));
	gtk_label_set_attributes (GTK_LABEL (label), attrs);
	pango_attr_list_unref (attrs);

	gtk_widget_show (label);
	gtk_container_add (GTK_CONTAINER (content_area), label);

	w = gtk_info_bar_add_button (GTK_INFO_BAR (bar),
				     _("_Restore"),
				     TRASH_BAR_RESPONSE_RESTORE);
	gtk_widget_set_tooltip_text (w,
				     _("Restore selected items to their original position"));

	w = gtk_info_bar_add_button (GTK_INFO_BAR (bar),
	/* Translators: "Empty" is an action (for the trash) , not a state */
				     _("_Empty"),
				     TRASH_BAR_RESPONSE_EMPTY);
	gtk_widget_set_tooltip_text (w,
				     _("Delete all items in the Trash"));

	g_signal_connect_object (nautilus_trash_monitor_get (),
				 "trash-state-changed",
				 G_CALLBACK (nautilus_trash_bar_trash_state_changed),
				 bar,
				 0);
	nautilus_trash_bar_trash_state_changed (nautilus_trash_monitor_get (),
						FALSE, bar);

	g_signal_connect (bar, "response",
			  G_CALLBACK (trash_bar_response_cb), bar);
}
开发者ID:Oliver-Luo,项目名称:nautilus,代码行数:47,代码来源:nautilus-trash-bar.c



注:本文中的GTK_INFO_BAR函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GTK_IS_ACTION函数代码示例发布时间:2022-05-30
下一篇:
C++ GTK_ICON_VIEW函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap