我正在创建一个带有图像的按钮。我想让它左对齐并且按钮边缘没有间隙。然而,尽管我将按钮对齐到文本的左侧,但图像和按钮边框之间存在一个小的“固定”间隙。我怎样才能将差距归零?
这是代码:
GtkWidget *button;
GtkWidget *buttonImage;
GtkSettings *default_settings = gtk_settings_get_default();
g_object_set(default_settings, "gtk-button-images", TRUE, NULL);
buttonImage = gtk_image_new();
gtk_image_set_from_file(GTK_IMAGE(buttonImage),"icon.jpg");
button= gtk_button_new_with_label("Click");
gtk_button_set_relief ((GtkButton *)button, GTK_RELIEF_NONE);
gtk_button_set_image((GtkButton *)button, buttonImage);
gtk_button_set_image_position((GtkButton *)button, GTK_POS_LEFT);
谢谢你。