🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: es.comp.os.linux.programacion
Article #15079

Re: [gtk] Botón con pixmap ¿como se hace?

#15079
From: batsman
Date: Wed, 16 Aug 2000 00:00
62 lines
3031 bytes
-----BEGIN PGP SIGNED MESSAGE-----


  >> El Wed, 16 Aug 2000 15:39:38 +0200, el siguiente flujo de bytes sali�
  >> del ordenador de Gorka Olaizola hacia es.comp.os.linux.programacion:

>Estoy intentando hacer una peque�a aplicaci�n con glade y quiero hacer
>algo parecido a lo que hace el xmms para pulsar los botones.
>�Se puede poner un pixmap en un bot�n? y si no se puede,

Se puede. Creas el bot�n con gtk_button_new y despu�s le metes el pixmap con
gtk_container_add* . Aqu� va un ejemplo (no probado :)

GtkWidget *pixmap_button( GtkWidget *parent,
                            gchar     *xpm_filename)
{
    GtkWidget *button;
    GtkWidget *pixmapwid;
    GdkPixmap *pixmap;
    GdkBitmap *mask;
    GtkStyle *style;

    button = gtk_button_new ();
    style = gtk_widget_get_style(parent);
    pixmap = gdk_pixmap_create_from_xpm (parent->window, &mask,
                                         &style->bg[GTK_STATE_NORMAL],
                                         xpm_filename);
    pixmapwid = gtk_pixmap_new (pixmap, mask);
    gtk_widget_show(pixmapwid);
    gtk_container_add (GTK_CONTAINER (button), pixmapwid);
    gtk_widget_show(button);

    return(button);
}

>�Hay documentaci�n que lo explique?

El tutorial (para empezar), el manual de referencia...
P�sate por /usr/doc/libgtk1.2-doc (Debian) o por http://www.gtk.org ...

- -- 
              _           _                             
             | |__   __ _| |_ ___ _ __ ___   __ _ _ __  
             | '_ \ / _` | __/ __| '_ ` _ \ / _` | '_ \ 
             | |_) | (_| | |_\__ \ | | | | | (_| | | | |
             |_.__/ \__,_|\__|___/_| |_| |_|\__,_|_| |_|

             Real email: batsman dot geo at yahoo dot com

-----BEGIN PGP SIGNATURE-----
Version: 2.6.3ia
Charset: noconv
Comment: Public key via email: send mail with Subject: [PGPKEY]

iQEVAwUBOZr0AL0Y27yr0iefAQGw0AgAiNzDftV7oBx7CL7bd1JijZOxx5WlHfDn
KL9jE5s4NwLh5ATO/RXJ21kG/S0Ss+cXE2r6Ey1xpkGDedNW6jvZWmjtWzkflwKM
SAHoHCUAwpNc1tGEi4BlhBtFE9JvXKkQOYJbokQ6SB+fwQI3/SDqtiOrpOCF5T2Y
E2a/R/pdg04rmkb8hT8to81z4Pu+rGAycuoCFiijZbMrPzcFAE0AN1bz04EgyMjT
yrBv2+uQyZTK6K2KsTOtDmrj21qxx7uPr/v2yckEQn/ViSjTA6CcsEApkM0r0K96
wZp+lZswdH6kFxG+XbEwVemOs9vLbWDjlB1FDcqlgqoTAlRqq+ay9A==
=XJ6l
-----END PGP SIGNATURE-----
Technical Details
Message-ID: <96sen8.g56.ln@simpsons4ever>
Path: arc1-ca.pugleaf.net!unknown!not-for-mail
References: <slrn8pl6cn.dhs.gorka@conan.hondarribia.org>

Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII
X-Google-Thread: f86c8,f380de9d933fc19b
X-Google-Attributes: gidf86c8,public
From: batsman@simpsons.for.ever (batsman)
Subject: Re: [gtk] Botón con pixmap ¿como se hace?
Date: 2000/08/16
Message-ID: <96sen8.g56.ln@simpsons4ever>
X-Deja-AN: 659095537
Content-Transfer-Encoding: 8bit
References: <slrn8pl6cn.dhs.gorka@conan.hondarribia.org>
Content-Type: text/plain; charset=iso-8859-1
Organization: Debian 2.2 Potato (disponible el 15 de agosto :-)
Mime-Version: 1.0
User-Agent: slrn/0.9.5.3 (UNIX)
Reply-To: see_signature-mira_firma-lire_signature-lesen_sie_die_Unterschrift-bIng_yIlaD
Newsgroups: es.comp.os.linux.programacion