← Back to team overview

kicad-developers team mailing list archive

Re: Problem with the new quasimodal

 

On 05/04/2014 03:10 PM, Lorenzo Marcantonio wrote:
> On Sun, May 04, 2014 at 02:36:46PM -0500, Dick Hollenbeck wrote:
>> a) How does one easily come into using version 2.24.20 of GTK?  i.e. distro & version please.
> 
> GTK repository, recompiled from the source.
> 
>> b) is this a debug build of GTK?
> 
> Yes
> 
>> c) where did the wx come from?  You arbitrarily built that version from source?  Any
>> reason for that version?
> 
> I had a 2.8 and that was the wxPython release available when I did the upgrade...
> 
>> Since committing, I see that it did not compile for wx 2.8.  Now it compiles, but exhibits
>> similar behaviour as far as immediate termination.  So maybe I have something to duplicate
>> the issue with.
>>
>> Its possible its just a difference of opinion, not an actual bug.  Not sure what a version
>> without the assert would do.
> 
> It immediately closes the dialog. 
> 
> My opinion is that probably the wxEventLoop thing doesn't handle
> correctly the reentrancy (that wouldn't the first idiocy in wx:P). 
> 
> Maybe they fixed it in 3.0? I know for sure
> that GTK (glib, actually) correctly dispatches multiple event loops. My wx 2.9
> has this routine:
> 
> int wxGUIEventLoop::Run()
> {
>     // event loops are not recursive, you need to create another loop!
>     wxCHECK_MSG( !IsRunning(), -1, "can't reenter a message loop" );
> 
>     wxEventLoopActivator activate(this);
> 
>     gtk_main();
> 
>     OnExit();
> 
>     return m_exitcode;
> }
> 
> gtk_main is *not* what you want for a modal loop, so it seems an issue with wx... 
> (the proper way would be using g_main_loop_new and g_main_loop_run, gtk_main also does application level stuff). If in 3.0 it is done in a different way, then that's the reason:D
> 
> Also I don't know if wxGUIEventLoop is supported on 2.8 (didn't find it
> in the docs)


I don't think using gtk directly from KiCad is the proper solution.  I would have been
hours ago if it was that easy.

Using wx is the solution.  But right now its like playing jango on a treadmill.

Nested event loops *are* possible on 2.8, because I can see them doing it, in class
wxDialog::ShowModal().

It's just a matter of finding the changed technique, and figuring out how many times it
has changed and at what versions.  Could be as many as three different techniques needed here.

My Ubuntu package repo is at 2.8.12.  So there are a lot of linux users parked on that
version of wx.  It needs to work back that far.

I may simply need to supply a modern wxEventLoopActivator to the older code.  I got a
feeling that that's been made smarter lately.


Dick




Follow ups

References