gtktextview

Gtk::TextView with constant string

自作多情 提交于 2019-12-25 08:48:42
问题 I am using Gtkmm 3+ and What I am trying to do is have the text buffer have the constant string "> " even if the user tries to delete it. In addition when the user pressed return it will automatically be there again. Basically have a constant string like a terminal does. The only way I can think about about accomplishing this would be to connect to the delete and backspace signals so the user cannot delete the string. But, is there a better way? so far this is the only way I can think of: /

How can I disable editting for GtkTextView in C?

Deadly 提交于 2019-12-13 03:24:14
问题 I tried this one and it generates a TextView window: http://zetcode.com/tutorials/gtktutorial/gtktextview/ But I don't want it to be editable. BTW, how can I show the scroll bar when the text overflows? 回答1: Check http://library.gnome.org/devel/gtk/stable/GtkTextView.html: There's a gtk_text_view_set_editable function. You can add scrollbars to widgets by adding them to a GtkScrolledWindow . Eg: GtkWidget* scrolled = gtk_scrolled_window_new(NULL, NULL); gtk_container_add (GTK_CONTAINER