Re: Help me about this "drawable" error

You need a gtk_widget_realize(plot_area) before you draw on it.


On Fri, 10 Nov 2000 05:11:23 -0500, Jung-Wuk Hong said:

 I wrote a function to write text on popup window. However it doesn't work
 I met the error drawable!=NULL.
 Please help me about this problem.
 In main.c, this callback is connected like this "gtk_signal_connect( button1,
 "clicked", show_property, NULL);
 Although I could see the button generated in this callback....
 J. Hong
 void show_property()
   GtkWidget *property_window;
   GtkWidget *button;
   GtkWidget *vbox, *plot_area;
   GdkFont *font;
   property_window = gtk_window_new (GTK_WINDOW_POPUP); /* make init image
 window */
   plot_area = gtk_drawing_area_new();
   button = gtk_button_new_with_label("OK");
   gtk_drawing_area_size( GTK_DRAWING_AREA(plot_area), 300, 200 );
   vbox = gtk_vbox_new(FALSE, NO_SPACING);
   gtk_window_set_position (GTK_WINDOW (property_window), GTK_WIN_POS_CENTER);
   font = gdk_font_load ("-*-helvetica-bold-r-normal-*-14-*-*-*-*-*-*-*");
   gdk_draw_text(GTK_WIDGET(plot_area)->window, font, 
                 GTK_WIDGET(plot_area)->style->black_gc, 10,10, "abc",15);
   gtk_box_pack_start( GTK_BOX(vbox), plot_area, FALSE, FALSE, NO_PADDING );
   gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, FALSE, NO_PADDING );
   gtk_container_add( GTK_CONTAINER( property_window ), vbox );
 gtk-app-devel-list mailing list
 gtk-app-devel-list gnome org

muhri muhri net --

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