RE: How to shape a button
- From: Muthiah Annamalai <dearestchum yahoo co in>
- To: Chris Wu Sanmina-SCI Com, gtk-app-devel-list gnome org
- Cc:
- Subject: RE: How to shape a button
- Date: Fri, 20 May 2005 02:33:42 -0700 (PDT)
Hi!
It seems to work for me...
I just forgot to mention, just create & connect a
button to its configure_event.
<CODE>
#include<gtk/gtk.h>
#include<gtk/gtkitemfactory.h>
#include<glib/gprintf.h>
gboolean configure_event(GtkWidget *w,gpointer
data)
{
//make a shaped mask
GdkPixmap *pix;
GdkBitmap *bit;
GdkColor c={0};
pix=gdk_pixmap_create_from_xpm(w->window,&bit,&c,"circle.xpm");
gdk_window_shape_combine_mask(GDK_WINDOW(w->window),bit,100,100);
gtk_window_set_decorated(GTK_WINDOW(w),FALSE);
return TRUE;
}
GtkWidget * make_shapedwidget(void)
{
GtkWidget *w,*btn;
w=gtk_window_new(GTK_WINDOW_TOPLEVEL);
btn=gtk_button_new_with_label("Hello WOrld");
g_signal_connect(G_OBJECT(btn),"configure_event",G_CALLBACK(configure_event),NULL);
g_signal_connect(G_OBJECT(w),"destroy",G_CALLBACK(gtk_main_quit),NULL);
gtk_container_add(GTK_CONTAINER(w),btn);
return w;
}
</CODE>
Cheers
-Muthu.
__________________________________
Yahoo! Mail Mobile
Take Yahoo! Mail with you! Check email on your mobile phone.
http://mobile.yahoo.com/learn/mail
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]