GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GtkTextView and serial line

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
binutils
Familiar Face


Joined: 11 Jun 2007
Posts: 8

PostPosted: Wed Jun 13, 2007 11:47 pm    Post subject: GtkTextView and serial line Reply with quote

Hi,

I am looking at gtkterm source, trying to modify the source.
i have included 4 new gtktextview widgets, and want to put serial buffer into the widget, but i haven't clue yet.
Back to top
binutils
Familiar Face


Joined: 11 Jun 2007
Posts: 8

PostPosted: Thu Jun 14, 2007 2:26 am    Post subject: Reply with quote

why gtktextview widget getting longer?
when character inserted into the widget.
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Fri Jun 15, 2007 9:03 pm    Post subject: Reply with quote

You must put your GtkTextView widget into a GtkScrolledWindow container for it to support scrolling. Otherwise, it will resize itself to show all of the text on the screen.
Back to top
binutils
Familiar Face


Joined: 11 Jun 2007
Posts: 8

PostPosted: Tue Jun 19, 2007 12:23 am    Post subject: Reply with quote

Hi,

I don't want scrolling function, just fixed 1 line textview form is fine.
Any help that would be very appreciated.
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Tue Jun 19, 2007 12:33 am    Post subject: Reply with quote

You can enable wrapping in the text view widget. However, if your text grows beyond the widget, it will always grow.
Back to top
binutils
Familiar Face


Joined: 11 Jun 2007
Posts: 8

PostPosted: Tue Jun 19, 2007 1:43 am    Post subject: Reply with quote

Code: (Plaintext)
1
2
3
4
5
6
7
8
9
10

  gtk_text_buffer_insert(AIn_buff, &AIn_iter,buffer_tmp->str,-1);
  g_printf("the count is %d\n",gtk_text_buffer_get_char_count(AIn_buff));

  if(gtk_text_buffer_get_char_count(AIn_buff)==70){
    gtk_text_buffer_set_text(AIn_buff, buffer_tmp->str, 70);
    //gtk_text_buffer_delete( AIn_buff, 0, 70);
        //gtk_text_buffer_insert(AIn_buff, &AIn_iter,buffer_tmp->str,-1);
  }


this code clear line when character count reached 70, but then next character doesn't show up.
Back to top
binutils
Familiar Face


Joined: 11 Jun 2007
Posts: 8

PostPosted: Wed Jun 20, 2007 2:27 am    Post subject: Reply with quote

Hi,
I figured it out to replace gtktextview with gtkentry.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP