Fwd: bug on TextBuffer and TextView





---------- Forwarded message ----------
From: Dafna Hirschfeld <dafna3 gmail com>
Date: Mon, Jan 19, 2009 at 4:51 PM
Subject: Re: bug on TextBuffer and TextView
To: Emmanuel Rodriguez <emmanuel rodriguez gmail com>


the code is very simple, copied from the tutorials of gtk

in one place of the program I declare the textView and the associated buffer:
 
my $view = Gtk2::TextView->new();
my $buffer = $view->get_buffer();
$view->set_size_request(850,500);
$view->set_editable (FALSE);
our $textmark = $buffer->create_mark('end_mark',$buffer->get_end_iter,FALSE);
my $scrolls = Gtk2::ScrolledWindow->new();
$scrolls->set_policy('automatic','always');
$scrolls->set_shadow_type('in');
$scrolls->add ($view);

on a function that run according to a specific button click I insert the text:

 #printing the output on textview
  my $text_tag = $buffer->create_tag(undef,'font',"Sans Italic 12",'foreground','#680000');
  $buffer->insert_with_tags($buffer->get_end_iter,"<$command_num>\n",$text_tag);
  $buffer->insert ($buffer->get_end_iter,$out);
  $view->scroll_mark_onscreen($textmark);


On Mon, Jan 19, 2009 at 12:34 PM, Emmanuel Rodriguez <emmanuel rodriguez gmail com> wrote:
2009/1/19 Dafna Hirschfeld <dafna3 gmail com>:
> I have a textView with a textBuffer associated with it.
>
> When I start running my program and insert text to the buffer, it doesn't
> appear on the textView, only after I click the textView with the mouse or
> add another text, it appears.
That's a strange behaviour.

>
> I don't know why is it, maybe its a problem of the buffering, I thought
> maybe there is a flush function, to flush the buffer to the view but I
> didn't find one, does anyone can help me?
Could you share some code?


Emmanuel




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