From: Richard Kettlewell Date: Sun, 22 Nov 2009 12:41:52 +0000 (+0000) Subject: Use gtk_widget_set_tooltip_text() instead of obsolete (and somewhat X-Git-Tag: 5.0~47 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~mdw/git/disorder/commitdiff_plain/a31f7a7285f35e978d5dde802316b5ca0d89836f?ds=sidebyside Use gtk_widget_set_tooltip_text() instead of obsolete (and somewhat heavyweight) GtkTooltips. --- diff --git a/disobedience/choose-search.c b/disobedience/choose-search.c index 1208f17..acfddfa 100644 --- a/disobedience/choose-search.c +++ b/disobedience/choose-search.c @@ -515,15 +515,15 @@ GtkWidget *choose_search_widget(void) { gtk_widget_set_style(choose_search_entry, tool_style); g_signal_connect(choose_search_entry, "changed", G_CALLBACK(choose_search_entry_changed), 0); - gtk_tooltips_set_tip(tips, choose_search_entry, - "Enter search terms here; search is automatic", ""); + gtk_widget_set_tooltip_text(choose_search_entry, + "Enter search terms here; search is automatic"); /* Cancel button to clear the search */ choose_clear = gtk_button_new_from_stock(GTK_STOCK_CANCEL); gtk_widget_set_style(choose_clear, tool_style); g_signal_connect(G_OBJECT(choose_clear), "clicked", G_CALLBACK(choose_clear_clicked), 0); - gtk_tooltips_set_tip(tips, choose_clear, "Clear search terms", ""); + gtk_widget_set_tooltip_text(choose_clear, "Clear search terms"); /* Up and down buttons to find previous/next results; initially they are not * usable as there are no search results. */ diff --git a/disobedience/control.c b/disobedience/control.c index 852885f..931746a 100644 --- a/disobedience/control.c +++ b/disobedience/control.c @@ -289,8 +289,8 @@ GtkWidget *control_widget(void) { gtk_scale_set_digits(GTK_SCALE(balance_widget), 10); gtk_widget_set_size_request(volume_widget, 192, -1); gtk_widget_set_size_request(balance_widget, 192, -1); - gtk_tooltips_set_tip(tips, volume_widget, "Volume", ""); - gtk_tooltips_set_tip(tips, balance_widget, "Balance", ""); + gtk_widget_set_tooltip_text(volume_widget, "Volume"); + gtk_widget_set_tooltip_text(balance_widget, "Balance"); gtk_box_pack_start(GTK_BOX(hbox), volume_widget, FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX(hbox), balance_widget, FALSE, TRUE, 0); /* space updates rather than hammering the server */ @@ -374,8 +374,8 @@ static void icon_changed(const char attribute((unused)) *event, * state is immediately displayed. sensitive and GTK_WIDGET_SENSITIVE show * it to be in the correct state, so I think this is may be a GTK+ bug. */ if(icon->tip_on) - gtk_tooltips_set_tip(tips, icon->button, - on ? icon->tip_on : icon->tip_off, ""); + gtk_widget_set_tooltip_text(icon->button, + on ? icon->tip_on : icon->tip_off); gtk_widget_set_sensitive(icon->button, sensitive); /* Icons with an associated menu item */ if(icon->item) { diff --git a/disobedience/disobedience.c b/disobedience/disobedience.c index edffbb5..9b050f4 100644 --- a/disobedience/disobedience.c +++ b/disobedience/disobedience.c @@ -85,9 +85,6 @@ static int rights_lookup_in_flight; /** @brief Current rights bitmap */ rights_type last_rights; -/** @brief Global tooltip group */ -GtkTooltips *tips; - /** @brief True if RTP play is available * * This is a bit of a bodge... @@ -476,8 +473,6 @@ int main(int argc, char **argv) { /* periodic operations (e.g. expiring the cache, checking local volume) */ g_timeout_add(600000/*milliseconds*/, periodic_slow, 0); g_timeout_add(1000/*milliseconds*/, periodic_fast, 0); - /* global tooltips */ - tips = gtk_tooltips_new(); make_toplevel_window(); /* reset styles now everything has its name */ gtk_rc_reset_styles(gtk_settings_get_for_screen(gdk_screen_get_default())); diff --git a/disobedience/disobedience.h b/disobedience/disobedience.h index f4678c7..cafa48d 100644 --- a/disobedience/disobedience.h +++ b/disobedience/disobedience.h @@ -101,7 +101,6 @@ extern int playing; /* true if playing some track */ extern int volume_l, volume_r; /* current volume */ extern double goesupto; /* volume upper bound */ extern int choosealpha; /* break up choose by letter */ -extern GtkTooltips *tips; extern int rtp_supported; extern int rtp_is_running; extern GtkItemFactory *mainmenufactory; diff --git a/disobedience/misc.c b/disobedience/misc.c index c26cb54..96e1750 100644 --- a/disobedience/misc.c +++ b/disobedience/misc.c @@ -172,7 +172,7 @@ GtkWidget *iconbutton(const char *path, const char *tip) { gtk_widget_set_style(content, tool_style); gtk_container_add(GTK_CONTAINER(button), content); if(tip) - gtk_tooltips_set_tip(tips, button, tip, ""); + gtk_widget_set_tooltip_text(button, tip); return button; } @@ -188,7 +188,7 @@ GtkWidget *create_buttons_box(struct button *buttons, g_signal_connect(G_OBJECT(buttons[n].widget), "clicked", G_CALLBACK(buttons[n].clicked), 0); gtk_box_pack_start(GTK_BOX(box), buttons[n].widget, FALSE, FALSE, 1); - gtk_tooltips_set_tip(tips, buttons[n].widget, buttons[n].tip, ""); + gtk_widget_set_tooltip_text(buttons[n].widget, buttons[n].tip); } return box; }