Всё я решил проблему. Вот как надо было.
const char *style = "* { background-color: #3c3c3c; } entry { color: #ffffff; } frame#frame_text * { background-color: #1c1c1c; border-radius: 6px; } textview text { color: #ffffff; } textview#text_view_w * { border-radius: 0px; }";
static gboolean entry_input_text_cb ( GtkWidget *widget, GdkEvent *event, gpointer data ) {
GdkEventKey *key = ( GdkEventKey * ) event;
if ( key->keyval == GDK_KEY_Return ) {
const char *t = gtk_entry_get_text ( ( GtkEntry * ) entry_input_text );
if ( strlen ( t ) == 0 ) return FALSE;
GtkTextBuffer *buf = gtk_text_buffer_new ( NULL );
gtk_text_buffer_set_text ( buf, t, strlen ( t ) );
printf ( "t: %s\n", t );
GtkWidget *frame = g_object_new ( GTK_TYPE_FRAME, "shadow-type", GTK_SHADOW_NONE, "name", "frame_text", NULL );
GtkWidget *text_view = gtk_text_view_new_with_buffer ( buf );
gtk_widget_set_name ( text_view, "text_view_w" );
gtk_widget_set_margin_start ( frame, 10 );
gtk_widget_set_margin_end ( frame, 10 );
gtk_widget_set_margin_top ( frame, 10 );
gtk_widget_set_margin_top ( text_view, 10 );
gtk_widget_set_margin_bottom ( text_view, 10 );
gtk_widget_set_margin_start ( text_view, 10 );
gtk_widget_set_margin_end ( text_view, 10 );
g_signal_connect ( text_view, "draw", G_CALLBACK ( text_view_draw_cb ), NULL );
gtk_container_add ( ( GtkContainer * ) frame, text_view );
gtk_box_pack_start ( ( GtkBox * ) text_box, frame, FALSE, FALSE, 0 );
gtk_widget_show_all ( text_box );
}
return FALSE;
}