Okay cool, I didn't look at the full code only the patch. I'm at Guadec and the network isn't responding very well, so I never got to respond to your actual question.. so here is my only other thought on the patch.
+ #FIXME: is there a better way to set the title AND have a stock icon?
+ remove.get_children()[0].get_children()[0].get_children()[1].set_label(_("_Remove Packages"))
There's not really a way to change the text in a more direct way without messing up the icon (because conceptually, stocks are really "icon + text" combinations so using button_new_from_stock is really just a convenience function), but if you want to do something a little less cryptic looking (although maybe with a bit more code) you could do something to the effect of:
Sorry, I'm not familar with pygtk so this is the best I can offer. It's up to you, this is just a suggestion that I think makes the code a little bit more obvious in my opinion.
Okay cool, I didn't look at the full code only the patch. I'm at Guadec and the network isn't responding very well, so I never got to respond to your actual question.. so here is my only other thought on the patch.
+ #FIXME: is there a better way to set the title AND have a stock icon? get_children( )[0].get_ children( )[0].get_ children( )[1].set_ label(_ ("_Remove Packages"))
+ remove.
There's not really a way to change the text in a more direct way without messing up the icon (because conceptually, stocks are really "icon + text" combinations so using button_ new_from_ stock is really just a convenience function), but if you want to do something a little less cryptic looking (although maybe with a bit more code) you could do something to the effect of:
void set_button_ text_and_ icon (GtkButton *button, gchar *stock_id, gchar *label)
{
gint image_spacing;
gtk_ widget_ style_get (GTK_WIDGET (button),
" image-spacing" , &image_spacing,
NULL) ;
hbox = gtk_hbox_new (FALSE, image_spacing);
image = gtk_image_ new_from_ stock (GTK_STOCK_CANCEL); box_pack_ start (hbox, image, FALSE, FALSE, 0);
gtk_
label = gtk_label_new (_("_Remove Packages")); box_pack_ start (hbox, label, FALSE, FALSE, 0);
gtk_
gtk_ widget_ show_all (hbox); container_ add (GTK_CONTAINER (button), hbox);
gtk_
}
Sorry, I'm not familar with pygtk so this is the best I can offer. It's up to you, this is just a suggestion that I think makes the code a little bit more obvious in my opinion.