Example #1
0
File: gicon.c Project: S010/test
void
on_tt_text_get_clicked(GtkWidget *widget, gpointer data)
{
	GtkEntry *entry = data;
	const char *text;

	text = gtk_status_icon_get_tooltip_text(status_icon);
	if (text != NULL)
		gtk_entry_set_text(entry, text);
}
Example #2
0
static void
statusicon_on_notification_added (boost::shared_ptr<Ekiga::Notification> notification,
                                  gpointer data)
{
  StatusIcon *self = STATUSICON (data);
  GdkPixbuf* pixbuf = gtk_widget_render_icon_pixbuf (self->priv->chat_window,
						     GTK_STOCK_DIALOG_WARNING,
						     GTK_ICON_SIZE_MENU);

  gchar *current_tooltip = gtk_status_icon_get_tooltip_text (GTK_STATUS_ICON (self));
  gchar *tooltip = NULL;
  if (current_tooltip != NULL)
    tooltip = g_strdup_printf ("%s\n%s", current_tooltip, notification->get_title ().c_str ());
  else
    tooltip = g_strdup (notification->get_title ().c_str ());

  gtk_status_icon_set_from_pixbuf (GTK_STATUS_ICON (self), pixbuf);
  gtk_status_icon_set_tooltip_text (GTK_STATUS_ICON (self), tooltip);
  g_object_unref (pixbuf);

  g_free (current_tooltip);
  g_free (tooltip);
}