[GRASS-dev] Re: [GRASS-user] error message from GRASS 7 on mac os

Michael Barton Michael.Barton at asu.edu
Sun Mar 18 23:34:29 EDT 2012


Since wx.CallAfter does not solve this, the only sure-fire fix that I can find is to either revert to the standard wx.SplashScreen or to replace line 59 in wxgui.py with:

        if SC and sys.platform != 'darwin':

That way, at least the Macs default to the basic splash screen without the errors. The AdvancedSplash does show the text "Starting GRASS GUI...", but that is the only thing lost by reverting the old splash screen

Michael

On Mar 18, 2012, at 1:44 PM, Anna Kratochvílová wrote:

> Hi,
> 
> 2012/3/18 Michael Barton <Michael.Barton at asu.edu>:
>> I found the problem. It's the 'advanced splash screen' (in the agw package) called fromwxgui.py.
>> 
>> Although the advanced splash screen can do some additional things beyond the normal splash screen, we don't really use much (or any?) of those capabilities.
>> 
> 
> I don't have any experience with it. You can try to use wx.CallAfter
> (as advised in the wxwidgets bug report) when setting splash screen.
> 
> Something like:
> 
> def SetSplashScreen(self, splashScreen):
>     splashScreen.Set...
>     ....
> 
> 
> if SC:
>      splash = SC.AdvancedSplash(bitmap = introBmp, timeout = 2000,
> parent = None, id = wx.ID_ANY)
>      wx.CallAfter(self.SetSplashScreen, splash)
> 
> Again, I really don't know what's going on. I think it's not GRASS gui
> fault, problem seems to be in wxwidgets and Mac. The same for the next
> error message (CFURLCreateWithString ...), I doubt anything can be
> done by GRASS developers. Maybe some workaround exists but I can't
> google anything now.
> 
> Anna
> 
> 
>> try:
>>    import wx.lib.agw.advancedsplash as SC
>> except ImportError:
>>    SC = None
>> 
>> 
>> ...
>> 
>>        if SC:
>>            splash = SC.AdvancedSplash(bitmap = introBmp,
>>                                       timeout = 2000, parent = None, id = wx.ID_ANY)
>>            splash.SetText(_('Starting GRASS GUI...'))
>>            splash.SetTextColour(wx.Colour(45, 52, 27))
>>            splash.SetTextFont(wx.Font(pointSize = 15, family = wx.DEFAULT, style = wx.NORMAL,
>>                                       weight = wx.BOLD))
>>            splash.SetTextPosition((150, 430))
>> 
>> 
>> 
>> Every call to splash produces "<Error>: CGContextRestoreGState: invalid context 0x0"
>> 
>> Michael
>> 
>> On Mar 18, 2012, at 12:53 AM, Anna Kratochvílová wrote:
>> 
>>> 2012/3/17 Michael Barton <michael.barton at asu.edu>:
>>>> Anna,
>>>> 
>>>> Where did you insert this? I can do a quick test. I'd be delighted if we
>>>> could avoid those annoying error messages.
>>> 
>>> Not sure what 'where' means, here [1] is the changeset. According to
>>> this email [2] the error message 'CGContextRestoreGState: invalid
>>> context' is supposed to show up immediately after wxGUI start. This
>>> fix is just a guess, I really don't understand what's going on. Are
>>> there any other annoying messages on Mac?
>>> 
>>> Anna
>>> 
>>> [1] http://trac.osgeo.org/grass/changeset/51089
>>> [2] http://lists.osgeo.org/pipermail/grass-user/2012-March/063996.html
>>>> 
>>>> Michael
>>>> 
>>>> Begin forwarded message:
>>>> 
>>>> Hi,
>>>> 
>>>> I added CallAfter as suggested (r51089), let's see if it helps.
>>>> 
>>>> Anna
>>>> 
>>>> 
>>>> _____________________
>>>> C. Michael Barton
>>>> Visiting Scientist, Integrated Science Program
>>>> National Center for Atmospheric Research &
>>>> University Consortium for Atmospheric Research
>>>> 303-497-2889 (voice)
>>>> 
>>>> Director, Center for Social Dynamics & Complexity
>>>> Professor of Anthropology, School of Human Evolution & Social Change
>>>> Arizona State University
>>>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>>>> 
>>>> 
>>>> 
>>>> 
>>>> 
>> 
>> _____________________
>> C. Michael Barton
>> Visiting Scientist, Integrated Science Program
>> National Center for Atmospheric Research &
>> University Consortium for Atmospheric Research
>> 303-497-2889 (voice)
>> 
>> Director, Center for Social Dynamics & Complexity
>> Professor of Anthropology, School of Human Evolution & Social Change
>> Arizona State University
>> www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu
>> 
>> 
>> 
>> 
>> 

_____________________
C. Michael Barton
Visiting Scientist, Integrated Science Program
National Center for Atmospheric Research &
University Consortium for Atmospheric Research
303-497-2889 (voice)

Director, Center for Social Dynamics & Complexity 
Professor of Anthropology, School of Human Evolution & Social Change
Arizona State University
www: http://www.public.asu.edu/~cmbarton, http://csdc.asu.edu







More information about the grass-dev mailing list