Programming Forums
User Name Password Register
 

RSS Feed
FORUM INDEX | TODAY'S POSTS | UNANSWERED THREADS | ADVANCED SEARCH

Reply
 
Thread Tools Display Modes
Old Mar 5th, 2006, 9:23 PM   #1
Serinth
Programmer
 
Serinth's Avatar
 
Join Date: Sep 2005
Posts: 50
Rep Power: 4 Serinth is on a distinguished road
GTK+-2.0 and textview problem

I've done quite a bit of googling and i looked at the GTK tutorials but the textview part is blank and the google stuff is coming up with non C code. I was just wondering what i needed in my signal event function for say..button1 to output some string to the textview window. Thanks.
__________________
A girl talked to me once.

http://www.latestanime.com
Serinth is offline   Reply With Quote
Old Mar 6th, 2006, 12:51 AM   #2
Serinth
Programmer
 
Serinth's Avatar
 
Join Date: Sep 2005
Posts: 50
Rep Power: 4 Serinth is on a distinguished road
Nevermind, solved my own problem
__________________
A girl talked to me once.

http://www.latestanime.com
Serinth is offline   Reply With Quote
Old Mar 6th, 2006, 12:08 PM   #3
Ooble
I eat cake for breakfast.
 
Ooble's Avatar
 
Join Date: Jul 2004
Location: In my box.
Posts: 4,434
Rep Power: 9 Ooble is on a distinguished road
Mind posting the solution for us, mate?
__________________
Me :: You :: Them
Ooble is offline   Reply With Quote
Old Mar 6th, 2006, 8:39 PM   #4
Serinth
Programmer
 
Serinth's Avatar
 
Join Date: Sep 2005
Posts: 50
Rep Power: 4 Serinth is on a distinguished road
Is this the great BOoble asking?
__________________
A girl talked to me once.

http://www.latestanime.com
Serinth is offline   Reply With Quote
Old Mar 6th, 2006, 8:49 PM   #5
DaWei
Resident Grouch
 
DaWei's Avatar
 
Join Date: Jun 2005
Posts: 6,453
Rep Power: 10 DaWei is on a distinguished road
Quote:
A girl talked to me once.
...and here I thought it WAS a girl, judging from the avatar and name (slaps own hand with the ruler, just like the nuns used to do).
__________________
Abstraction doesn't make it impossible to write bad code; it makes it possible to write superior code.
Contributor's Corner: Grumpy on C++ Exceptions DaWei on Pointers
DaWei is offline   Reply With Quote
Old Mar 6th, 2006, 9:01 PM   #6
Serinth
Programmer
 
Serinth's Avatar
 
Join Date: Sep 2005
Posts: 50
Rep Power: 4 Serinth is on a distinguished road
in your callbacks, say for example you had a widget called button1 which you want an action when clicked you have this:
void on_button1_clicked (GtkButton *button, gpointer user_data)
{
       GtkTextBuffer *buffer;
       GtkTextIter iter;

/*first you need to find the widget name of the textview box, say for example it's called textview1 in this case, you're only concerned with txtbox which is the identifier to the widget "textview1"*/
 
       GtkWidget *txtbox=lookup_widget(GTK_WIDGET (button), "textview1");

/*You then need to set the buffer to the size of the textview area*/

       buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(txtbox));

/*Now you need to set the offset; the number of characters to display before you start overlapping at 0 again. Play with the number and see the difference.*/
    
      gtk_text_buffer_get_iter_at_offset(buffer, &iter, 0);

/*Insert text time...*/

     gtk_text_buffer_insert(buffer, &iter, "Hello World!",-1);

}

I wish they would update stuff for the GTK+-2.0 tutorials
__________________
A girl talked to me once.

http://www.latestanime.com
Serinth is offline   Reply With Quote
Reply

Bookmarks

« Previous Thread in Forum | Next Thread in Forum »

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump




DaniWeb IT Discussion Community
All times are GMT -5. The time now is 12:53 PM.

Powered by vBulletin® Version 3.7.0, Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Copyright ©2007 DaniWeb® LLC