why that not working?
- From: =?big5?b?tsC8eSBLYXNvbiBIdWFuZw==?= <kasonhuang kinposh com cn>
- To: <gtk-list gnome org>
- Subject: why that not working?
- Date: Mon, 21 Jan 2002 16:44:20 +0800
hello:
for creating a colorful button,I do a testing code,however,that not working?
why and how to do?anyone could help me?
#include<gtk/gtk.h>
#include<gdk/gdkx.h>
GdkColor cyan = {0,0x0000,0xFFFF,0xFFFF};
int main(int argc,char *argv[])
{
GtkWidget *window;
GttkWidget *button1;
GtkWidget *button2;
GtkWidget *vbox;
gtk_init(&argc,&argv);
window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_signal_connect(GTK_OBJECT(window),"destroy",GTK_SIGNAL_FUNC(gtk_exit),NULL);
vbox = gtk_vbox_new(TRUE,2);
gtk_container_add(GTK_CONTAINER(window),vbox);
button1= gtk_button_new_with_label("1");
gtk_widget_realize(button1);
gdk_window_set_background(button1->window,&cyan); //not working,why?
gtk_box_pack_start(GTK_BOX(vbox),button1,TRUE,FALSE,0);
button2= gtk_button_new_with_label("2");
gtk_widget_realize(button2);
gdk_window_set_background(button2->window,&cyan); //not working,why?
gtk_box_pack_start(GTK_BOX(vbox),button2,TRUE,FALSE,0);
gtk_widget_show(button1);
gtk_widget_show(button2);
gtk_widget_show(vbox);
gtk_widget_show(window);
gtk_main();
return 1;
}
Thank you in advance! waiting for your mail back.
you can get me by mail :
kasonhuang kinposh com cn
kason
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]