Re: no joy...



On 12/20/2011 03:52 PM, Gary Kline wrote:

thanks to those  who have tried to help, mostly off-list.  i can't
believe how hard this is.

Well it isn't that hard.  Reading over the last two weeks of list posts,
it's very unclear what you are trying to do.

and fopen some file and display the text in the buffer.  The   
question remains: how? what am i missing to display some
miscellaneous words in the text window?

The TextView widget is a MVC widget.  It consists of a view and a buffer
component.  After creating the TextView you have to ask it for it's
buffer, which you can then use to add or remove text using an iterator
(standard fare for container data structures).   Here's a complete
example, even with style tags.  You can of course not use style tags at
all and this example becomes a lot simpler.

http://zetcode.com/tutorials/gtktutorial/gtktextview/

I found this with just a couple of seconds of google searching.  "gtk
textview example."

Note how easy it is to set the text in the widget:

buffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(view));
gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);
gtk_text_buffer_insert(buffer, &iter, "Plain text\n", -1);
gtk_text_buffer_insert(buffer, &iter, "More text\n", -1);

As the Mr Morris said, refer to the API docs.  I have no idea what last
parameter does.  You'll have to refer to the docs to find that out.

From your other e-mails, it's not clear that you understand how GUI apis
work, how widgets are placed in a UI in a hierarchy and so forth.  For
example, the vbox hbox problem you were having is basic GUI stuff and is
explained quite well in the official GTK tutorial.  You'll want to go
over the tutorial I think.



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