Re: Why "GtkWidget->window" is "NULL" when "gtk_window_new()"
- From: "Wu Yin" <lazy fox wu gmail com>
- To: gtk-list gnome org
- Subject: Re: Why "GtkWidget->window" is "NULL" when "gtk_window_new()"
- Date: Tue, 12 Aug 2008 18:24:51 +0800
Thanks very much. But I have Another question:
I want to draw line on my own initiative, don't use "expose-event" and callback function.
Like the following code, but the code can't do what I want.
Please tell me how to do this?
Code:
+-------------------------------------------------------------------------------------
| int main(int argc, char *argv[])
| {
| GtkWidget *w;
|
| gtk_init(&argc, &argv);
|
| w = gtk_window_new(GTK_WINDOW_TOPLEVEL);
| g_signal_connect(GTK_OBJECT(w), "destroy", G_CALLBACK(gtk_main_quit), NULL);
|
| gtk_widget_realize(w);
| gdk_draw_line(w->window, w->style->fg_gc[GTK_WIDGET_STATE(w)],
| 0, 0, 120, 120);
|
| gtk_widget_show_all(w);
| gtk_main();
| return 0;
| }
+-------------------------------------------------------------------------------------
--
----------------------------------------------
┏━━━━━━━━━━━━━━━━━━━━━━━━┓
┃菩提本无树,明镜亦非台。本来无一物,何处惹尘埃。┃
┗━━━━━━━━━━━━━━━━━━━━━━━━┛
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]