當前位置: 首頁>>代碼示例>>C++>>正文


C++ GTK_STATUSBAR函數代碼示例

本文整理匯總了C++中GTK_STATUSBAR函數的典型用法代碼示例。如果您正苦於以下問題:C++ GTK_STATUSBAR函數的具體用法?C++ GTK_STATUSBAR怎麽用?C++ GTK_STATUSBAR使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GTK_STATUSBAR函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: ui_log_level_info

/* Map G_LOG_LEVEL_INFO logs to the window's status bar. */
static void
ui_log_level_info (const gchar * log_domain, GLogLevelFlags log_level,
                   const char * message, gpointer user_data)
{
  static GtkWidget * statusbar;
  static guint context;
  static guint initialized = 0;
  if (!initialized)
    {
      statusbar = GET_OBJECT ("statusbar");
      context = gtk_statusbar_get_context_id(GTK_STATUSBAR (statusbar), "Game messages");
      initialized = 1;
    }
  gtk_statusbar_pop (GTK_STATUSBAR (statusbar), context);
  gtk_statusbar_push (GTK_STATUSBAR (statusbar), context, message);
  gtk_main_iteration();
}
開發者ID:davazp,項目名稱:connection,代碼行數:18,代碼來源:conn-ui.c

示例2: statusbar_clear_status

void
statusbar_clear_status(StatusBar_t *statusbar)
{
   if (statusbar->message_id)
      gtk_statusbar_remove(GTK_STATUSBAR(statusbar->status),
                           statusbar->status_id,
                           statusbar->message_id);
}
開發者ID:AdamGrzonkowski,項目名稱:gimp-1,代碼行數:8,代碼來源:imap_statusbar.c

示例3: mark_set_callback

static void
mark_set_callback (GtkTextBuffer     *buffer,
                   const GtkTextIter *new_location,
                   GtkTextMark       *mark,
                   gpointer           data)
{
  update_statusbar (buffer, GTK_STATUSBAR (data));
}
開發者ID:3dfxmadscientist,項目名稱:gnome-apps,代碼行數:8,代碼來源:application.c

示例4: clear_widgets

void clear_widgets()
{
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED1), FALSE);
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED2), FALSE);
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED3), FALSE);
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkLED4), FALSE);
	gtk_check_menu_item_set_active(GTK_CHECK_MENU_ITEM(chkRumble), FALSE);

	gtk_statusbar_push(GTK_STATUSBAR(statBattery), 0, "");
	gtk_statusbar_push(GTK_STATUSBAR(statExtension), 0, "");

	clear_acc_widgets();
	clear_ir_data();
	clear_nunchuk_widgets();
	clear_classic_widgets();
	clear_motionplus_widgets();
}
開發者ID:bobbens,項目名稱:cwiid,代碼行數:17,代碼來源:main.c

示例5: explorer_init

static void explorer_init(Explorer *self) {

    if (g_file_test (FYRE_DATADIR "/explorer.glade", G_FILE_TEST_EXISTS))
        self->xml = glade_xml_new (FYRE_DATADIR "/explorer.glade", NULL, NULL);
    if (!self->xml)
	self->xml = glade_xml_new(BR_DATADIR("/fyre/explorer.glade"), NULL, NULL);
    if (!self->xml) {
	GtkWidget *dialog;
	dialog = gtk_message_dialog_new_with_markup(NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK,
						    "<b>Fyre can't find its data files.</b>\n\n"
						    "The main glade file could not be located.\n"
						    "We tried looking for it in the following places:\n"
						    "\n"
						    "    %s\n"
						    "    %s",
						    FYRE_DATADIR "/explorer.glade",
						    BR_DATADIR("/fyre/explorer.glade"));
	gtk_dialog_run(GTK_DIALOG(dialog));
	exit(0);
    }

    self->window = glade_xml_get_widget(self->xml, "explorer_window");
    fyre_set_icon_later(self->window);
    fyre_set_icon_later(glade_xml_get_widget(self->xml, "animation_window"));
    fyre_set_icon_later(glade_xml_get_widget(self->xml, "interactive_prefs"));
    fyre_set_icon_later(glade_xml_get_widget(self->xml, "cluster_window"));
    fyre_set_icon_later(glade_xml_get_widget(self->xml, "about_window"));
    fyre_set_icon_later(glade_xml_get_widget(self->xml, "error dialog"));

    /* Connect signal handlers */
    glade_xml_signal_connect_data(self->xml, "on_randomize",                    G_CALLBACK(on_randomize),                    self);
    glade_xml_signal_connect_data(self->xml, "on_load_defaults",                G_CALLBACK(on_load_defaults),                self);
    glade_xml_signal_connect_data(self->xml, "on_save",                         G_CALLBACK(on_save),                         self);
    glade_xml_signal_connect_data(self->xml, "on_save_exr",                     G_CALLBACK(on_save_exr),                     self);
    glade_xml_signal_connect_data(self->xml, "on_quit",                         G_CALLBACK(on_quit),                         self);
    glade_xml_signal_connect_data(self->xml, "on_pause_rendering_toggle",       G_CALLBACK(on_pause_rendering_toggle),       self);
    glade_xml_signal_connect_data(self->xml, "on_load_from_image",              G_CALLBACK(on_load_from_image),              self);
    glade_xml_signal_connect_data(self->xml, "on_widget_toggle",                G_CALLBACK(on_widget_toggle),                self);
    glade_xml_signal_connect_data(self->xml, "on_zoom_reset",                   G_CALLBACK(on_zoom_reset),                   self);
    glade_xml_signal_connect_data(self->xml, "on_zoom_in",                      G_CALLBACK(on_zoom_in),                      self);
    glade_xml_signal_connect_data(self->xml, "on_zoom_out",                     G_CALLBACK(on_zoom_out),                     self);
    glade_xml_signal_connect_data(self->xml, "on_render_time_changed",          G_CALLBACK(on_render_time_changed),          self);
    glade_xml_signal_connect_data(self->xml, "on_interactive_prefs_delete",     G_CALLBACK(on_interactive_prefs_delete),     self);

#ifndef HAVE_EXR
    /* If we don't have OpenEXR support, gray out the menu item
     * so it sits there taunting the user and not breaking HIG
     */
    gtk_widget_set_sensitive(glade_xml_get_widget(self->xml, "save_image_as_exr"), FALSE);
#endif

    /* Set up the statusbar */
    self->statusbar = GTK_STATUSBAR(glade_xml_get_widget(self->xml, "statusbar"));
    self->render_status_context = gtk_statusbar_get_context_id(self->statusbar, "Rendering status");
    self->speed_timer = g_timer_new();
    self->auto_update_rate_timer = g_timer_new();
    self->status_update_rate_timer = g_timer_new();
}
開發者ID:ain101,項目名稱:Fyre,代碼行數:58,代碼來源:explorer.c

示例6: eom_statusbar_init

static void
eom_statusbar_init (EomStatusbar *statusbar)
{
	EomStatusbarPrivate *priv;
	GtkWidget *vbox;

	statusbar->priv = EOM_STATUSBAR_GET_PRIVATE (statusbar);
	priv = statusbar->priv;

	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (statusbar), TRUE);

	priv->img_num_statusbar = gtk_statusbar_new ();
	gtk_statusbar_set_has_resize_grip (GTK_STATUSBAR (priv->img_num_statusbar), FALSE);
	gtk_widget_set_size_request (priv->img_num_statusbar, 100, 10);
	gtk_widget_show (priv->img_num_statusbar);

	gtk_box_pack_end (GTK_BOX (statusbar),
			  priv->img_num_statusbar,
			  FALSE,
			  TRUE,
			  0);

	vbox = gtk_vbox_new (FALSE, 0);

	gtk_box_pack_end (GTK_BOX (statusbar),
			  vbox,
			  FALSE,
			  FALSE,
			  2);

	statusbar->priv->progressbar = gtk_progress_bar_new ();

	gtk_box_pack_end (GTK_BOX (vbox),
			  priv->progressbar,
			  TRUE,
			  TRUE,
			  2);

	gtk_widget_set_size_request (priv->progressbar, -1, 10);

	gtk_widget_show (vbox);

	gtk_widget_hide (statusbar->priv->progressbar);

}
開發者ID:steev,項目名稱:mate-image-viewer,代碼行數:45,代碼來源:eom-statusbar.c

示例7: progress_update_display

static void
progress_update_display (TrackedTask *task)
{
	GtkProgressBar *progress = NULL;
	GtkStatusbar *status = NULL;
	GtkLabel *label = NULL;
	GtkWidget *widget;
	TrackedPart *part;
	gdouble fraction;
	guint id;

	if (task->builder == NULL)
		return;

	/* Dig out our progress display stuff */
	widget = GTK_WIDGET (gtk_builder_get_object (task->builder, "progress-bar"));
	if (widget == NULL)
		g_warning ("cannot display progress because seahorse window has no progress widget");
	else
		progress = GTK_PROGRESS_BAR (widget);
	widget = GTK_WIDGET (gtk_builder_get_object (task->builder, "status"));
	if (GTK_IS_STATUSBAR (widget)) {
		status = GTK_STATUSBAR (widget);
	} else {
		widget = GTK_WIDGET (gtk_builder_get_object (task->builder, "progress-details"));
		if (GTK_IS_LABEL (widget))
			label = GTK_LABEL (widget);
	}

	/* The details is the first on a begun part */
	part = tracked_part_find (task, find_part_begun_with_details, NULL);
	if (status) {
		id = gtk_statusbar_get_context_id (status, "operation-progress");
		gtk_statusbar_pop (status, id);
		if (part != NULL)
			gtk_statusbar_push (status, id, part->details);
	} else if (label) {
		gtk_label_set_text (label, part ? part->details : "");
	}

	/* If all parts are running simultaneously then indeterminate */
	if (task->parts_prepped == 0 && task->parts_ended == 0) {
		fraction = -1;
	} else {
		fraction = (gdouble)task->parts_ended /
		           (gdouble)task->parts->length;
	}

	if (progress) {
		if (fraction >= 0.0) {
			stop_pulse (progress);
			gtk_progress_bar_set_fraction (progress, fraction);
		} else {
			start_pulse (progress);
		}
	}
}
開發者ID:atulhjp,項目名稱:seahorse,代碼行數:57,代碼來源:seahorse-progress.c

示例8: gtkgui_set_statustext

void gtkgui_set_statustext(char *testo) 
{
  //  gdk_threads_enter();

  contextid=gtk_statusbar_push(GTK_STATUSBAR(statusbar), 
			       contextid, (gchar *) testo);
  
  //  gdk_threads_leave();
}
開發者ID:dyne,項目名稱:MuSE,代碼行數:9,代碼來源:musegtk.cpp

示例9: gnac_ui_push_status

void
gnac_ui_push_status(const gchar *message)
{
  GtkStatusbar *status_bar = GTK_STATUSBAR(gnac_ui_get_widget("statusbar"));
  g_free(status_msg);
  status_msg = g_strdup(message);
  gtk_statusbar_pop(status_bar, 0);
  gtk_statusbar_push(status_bar, 0, status_msg);
}
開發者ID:GNOME,項目名稱:gnac,代碼行數:9,代碼來源:gnac-ui.c

示例10: dcc_gnome_make_load_bar

static GtkWidget * dcc_gnome_make_load_bar (void)
{
  GtkWidget *bar;
  gint context_id;

  bar = gtk_statusbar_new ();
  context_id = gtk_statusbar_get_context_id(GTK_STATUSBAR (bar), "load");

  gtk_statusbar_push(GTK_STATUSBAR (bar), context_id, "Load: ");

  g_timeout_add (2000,          /* ms */
                 dcc_gnome_load_update_cb,
                 bar);

  dcc_gnome_load_update_cb (bar);

  return bar;
}
開發者ID:aosm,項目名稱:distcc,代碼行數:18,代碼來源:mon-gnome.c

示例11: create_status_bar

static void
create_status_bar (EtStatusBar *self)
{
    EtStatusBarPrivate *priv;

    priv = et_status_bar_get_instance_private (self);

    /* Specify a size to avoid statubar resizing if the message is too long */
    gtk_widget_set_size_request (GTK_WIDGET (self), 200, -1);

    /* Create serie */
    priv->message_context = gtk_statusbar_get_context_id (GTK_STATUSBAR (self),
                                                          "messages");
    priv->timer_context = gtk_statusbar_get_context_id (GTK_STATUSBAR (self),
                                                        "timer");

    et_status_bar_message (self, _("Ready to start"), TRUE);
}
開發者ID:GNOME,項目名稱:easytag,代碼行數:18,代碼來源:status_bar.c

示例12: statusbar_set_zoom

void
statusbar_set_zoom(StatusBar_t *statusbar, gint factor)
{
   char scratch[16];

   sprintf(scratch, "1:%d", factor);
   gtk_statusbar_push(GTK_STATUSBAR(statusbar->zoom), statusbar->zoom_id,
                      scratch);
}
開發者ID:AdamGrzonkowski,項目名稱:gimp-1,代碼行數:9,代碼來源:imap_statusbar.c

示例13: game_message

void game_message(const char *format, ...)
{
	int id;
	va_list ap;
	char *message;
	GtkWidget *status;

	va_start(ap, format);
	message = g_strdup_vprintf(format, ap);
	va_end(ap);

	status = lookup_widget(main_win, "statusbar");
	id = gtk_statusbar_get_context_id(GTK_STATUSBAR(status), "Main");
	gtk_statusbar_pop(GTK_STATUSBAR(status), id);
	gtk_statusbar_push(GTK_STATUSBAR(status), id, message);

	g_free(message);
}
開發者ID:ralight,項目名稱:ggz,代碼行數:18,代碼來源:game.c

示例14: statusbar_remove_temporary_msg

/*
 * Timeout callbacks for statusbar_push_temporary_msg
 */
static gboolean
statusbar_remove_temporary_msg(gpointer data)
{
    guint msg_id = GPOINTER_TO_UINT(data);

    gtk_statusbar_remove(GTK_STATUSBAR(info_bar), main_ctx, msg_id);

    return FALSE;
}
開發者ID:AmesianX,項目名稱:wireshark,代碼行數:12,代碼來源:main_statusbar.c

示例15: statusbar_pop_file_msg

/*
 * Pop a message referring to file access off the statusbar.
 */
static void
statusbar_pop_file_msg(void)
{
    /*g_warning("statusbar_pop");*/
    if (status_levels[STATUS_LEVEL_FILE] > 0) {
        status_levels[STATUS_LEVEL_FILE]--;
    }
    gtk_statusbar_pop(GTK_STATUSBAR(info_bar), file_ctx);
}
開發者ID:AmesianX,項目名稱:wireshark,代碼行數:12,代碼來源:main_statusbar.c


注:本文中的GTK_STATUSBAR函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。