Re: [gedit-list] Updating gui inside a signal



So anyway, with many thanks to a friend of mine at work, it would seem
the answer is

    while Gtk.events_pending():
            Gtk.main_iteration()

:)

On Sat, May 12, 2012 at 10:01 PM, Stephen Moore <delfick755 gmail com> wrote:
> Hi,
>
> So I'm trying to create a plugin that will run my tests from within
> gedit so I can do some meaningful TDD whilst I rewrite vigedit for
> gedit 3.
>
> So far I have https://github.com/delfick/vigedit/blob/master/src/vigedit_specs.py
> (for "convenience", started via
> https://github.com/delfick/vigedit/blob/master/test.sh)
> (look at revision 56c0ff080c of those two files for the messy solution
> I had before I came across GObject.idle_add)
>
> This works in the fact that it finds my tests and executes them and
> they have access to gedit things which is nice.
>
> The problem is that all the tests are run as part of the callback for
> one signal and hence the gui doesn't update at any point during my
> tests.
> Therefore I'm unable to actually test modifications to gedit which is
> the entire point of having tests that use gedit.
>
> It would seem I could use GObject.idle_add(self.emit, "signal") to
> make it run a signal when gedit is idle.
> However, making nosetests do that for every test looks difficult, if
> not impossible.
> (And I'd rather use nosetests than hack together my own random test
> discoverer/runner).
>
> So, the option that is left is some magical ability to make gedit
> update itself at random points during the signal.
>
> I get this feeling that isn't possible, but on the chance that it is
> possible, I thought I'd atleast ask the question.....
>
> Is there a way to refresh the Gedit GUI midway through the invocation
> of a signal?
> (or some other way of achieving what I want?)
>
> Thankyou
>
> Stephen.


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