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

Re: bug on TextBuffer and TextView



Sorry for the double spam. I forgot to include the mailing list on the
first mail.

On Mon, Jan 19, 2009 at 4:19 PM, Emmanuel Rodriguez
<emmanuel rodriguez gmail com> wrote:
> On Mon, Jan 19, 2009 at 3:51 PM, Dafna Hirschfeld <dafna3 gmail com> wrote:
>> 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.
>>>
That's very strange. I've complete your test and it works as expected.
Can you execute my script and confirm that if you click the 'Write'
button that you have the same behavior?

On my computer this test works as expected: once the button is clicked
the text is added to the textview.



-- 
Emmanuel Rodriguez

Attachment: t.pl
Description: Perl program



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