Re: how to display pixmap on button.



Hi!
There are two  ways.
Using GLADE
1: Edit the .glade file! or use Glade to edit the UI
interface.

Programming Wise.
2: Button widget has a child which holds the Label
widget.
   Now you have to create a image, and like a
container you add it
   into the button, like this.

This code does your job programmatically,
<CODE>
    img=gtk_image_new_from_file("monodoc.png");
    btn=gtk_button_new_with_label("Exit");
    gtk_widget_destroy(gtk_bin_get_child(btn));
    gtk_container_add(GTK_CONTAINER(btn),img);
</CODE>
-Muthu

--- harshavardhanreddy mandeepala
<hvreddy1110 gmail com> wrote:
hi,
i have created buttons with some names on them using
glade-2 tools.
i have used gdk,gtk programming on linux fedora core
3 platrform.
now i want to remove those  names on buttons and
display appropriate
pixmap(ex:Back.xpm ,which i have already with me)on
the buttons.

if u have a solution  kindly send it to
hvreddy1110 gmail com
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org

http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list



                
Yahoo! Mail
Stay connected, organized, and protected. Take the tour:
http://tour.mail.yahoo.com/mailtour.html




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]