Mercurial > pidgin
diff src/util.c @ 603:9b0717b4a490
[gaim-migrate @ 613]
picture_button(GtkWidget *window, char *text, char **xpm);
window is the window it will be drawn in.
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Fri, 04 Aug 2000 04:08:31 +0000 |
parents | 7c75d69a1129 |
children | 50f7a0bc76fc |
line wrap: on
line diff
--- a/src/util.c Fri Aug 04 02:42:35 2000 +0000 +++ b/src/util.c Fri Aug 04 04:08:31 2000 +0000 @@ -888,3 +888,35 @@ cpy[cnt]='\0'; return(cpy); } + +GtkWidget *picture_button(GtkWidget *window, char *text, char **xpm) +{ + GtkWidget *button; + GtkWidget *button_box; + GtkWidget *label; + GdkBitmap *mask; + GdkPixmap *pm; + GtkWidget *pixmap; + + button = gtk_button_new(); + if (display_options & OPT_DISP_COOL_LOOK) + gtk_button_set_relief(GTK_BUTTON(button), GTK_RELIEF_NONE); + gtk_widget_show(button); + + button_box = gtk_hbox_new(FALSE, 5); + gtk_container_add(GTK_CONTAINER(button), button_box); + gtk_widget_show(button_box); + + pm = gdk_pixmap_create_from_xpm_d(window->window, &mask, NULL, xpm); + pixmap = gtk_pixmap_new(pm, mask); + gtk_box_pack_start(GTK_BOX(button_box), pixmap, FALSE, FALSE, 2); + gtk_widget_show(pixmap); + + label = gtk_label_new(text); + gtk_box_pack_end(GTK_BOX(button_box), label, FALSE, FALSE, 2); + gtk_widget_show(label); + + gtk_widget_set_usize(button, 75, 30); + + return button; +}