Re: [code] Possible GTK init problem

From: Mitchell <m.att.foicica.com>
Date: Mon, 19 Sep 2016 11:23:21 -0400 (EDT)

Hi Markus,

On Mon, 19 Sep 2016, Markus F.X.J. Oberhumer wrote:

> Hi Mitchell,
>
> On 2016-09-19 16:00, Mitchell wrote:
>> Hi Markus,
>>
>> On Mon, 19 Sep 2016, Markus F.X.J. Oberhumer wrote:
>>
>>> I'm hitting a problem in the INITIALIZED event caused by the fact
>>> that buffer.lines_on_screen is not set.
>>>
>>> It works correctly in the Curses version, but the GTK version
>>> always prints "lines_on_screen=0".
>>>
>>> This could be some sort of initialization problem in textadept.c.
>>>
>>> Any ideas?
>>
>> GTK's event loop has not started and processed any pending draw events yet
>> when `events.INITIALIZED` has been fired. (Thus, the editor widget does not
>> know how big it is yet.)
>
> thanks for the explanation - that makes sense.
>
>> Try putting your code on a brief timeout with `timeout()`[1].
>
> Using timeout() will probably do the trick. Still, this is a little bit
> hacky, so would it be hard to add a proper GUI_INITIALIZED event ?

Before I go adding even more events to Textadept (which I prefer not to),
what exactly are you trying to do? Maybe there's another way to accomplish
your task.

Cheers,
Mitchell

-- 
You are subscribed to code.att.foicica.com.
To change subscription settings, send an e-mail to code+help.att.foicica.com.
To unsubscribe, send an e-mail to code+unsubscribe.att.foicica.com.
Received on Mon 19 Sep 2016 - 11:23:21 EDT

This archive was generated by hypermail 2.2.0 : Tue 20 Sep 2016 - 06:53:35 EDT