Re: Help me about this "drawable" error
- From: "Maher Awamy" <muhri muhri net>
- To: Jung-Wuk Hong <jwhong MIT EDU>, gtk-app-devel-list gnome org
- Subject: Re: Help me about this "drawable" error
- Date: 10 Nov 2000 06:30:26 CST
You need a gtk_widget_realize(plot_area) before you draw on it.
Maher
On Fri, 10 Nov 2000 05:11:23 -0500, Jung-Wuk Hong said:
Hi
I wrote a function to write text on popup window. However it doesn't work
correctly.
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....
Thanks
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_widget_show_all(property_window);
}
_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list gnome org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
--
muhri muhri net -- http://www.muhri.net
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]