GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Sun Aug 31, 2014 2:14 am

All times are UTC




Post new topic Reply to topic  [ 7 posts ] 
Author Message
 Post subject: GtkTextView and serial line
PostPosted: Wed Jun 13, 2007 11:47 pm 
Offline
Familiar Face

Joined: Mon Jun 11, 2007 4:45 am
Posts: 8
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.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jun 14, 2007 2:26 am 
Offline
Familiar Face

Joined: Mon Jun 11, 2007 4:45 am
Posts: 8
why gtktextview widget getting longer?
when character inserted into the widget.


Top
 Profile  
 
 Post subject:
PostPosted: Fri Jun 15, 2007 9:03 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
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.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 12:23 am 
Offline
Familiar Face

Joined: Mon Jun 11, 2007 4:45 am
Posts: 8
Hi,

I don't want scrolling function, just fixed 1 line textview form is fine.
Any help that would be very appreciated.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 12:33 am 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
You can enable wrapping in the text view widget. However, if your text grows beyond the widget, it will always grow.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 19, 2007 1:43 am 
Offline
Familiar Face

Joined: Mon Jun 11, 2007 4:45 am
Posts: 8
Code:
  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.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 20, 2007 2:27 am 
Offline
Familiar Face

Joined: Mon Jun 11, 2007 4:45 am
Posts: 8
Hi,
I figured it out to replace gtktextview with gtkentry.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 7 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 1 guest


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group