Re: [Kicad-developers] [PATCH] Remove assert in pcbnew on osx with a debug build

2016-09-19 Thread Maciej Sumiński
Ok, I see. I have just removed the wxPaintDC object for all platforms,
as anyway GAL worked fine without it. If there are any drawing related
problems, let me know and we will look for another solution.

Regards,
Orson

On 09/19/2016 02:25 PM, Simon Wells wrote:
> Hi Orson,
> 
> i get one of the attached on GAL load (i hit cancel to supress further
> dialogs) and one
> 
> ../src/src/osx/carbon/dcclient.cpp(195): assert
> "window->MacGetCGContextRef() != NULL" failed in wxPaintDCImpl():
> using wxPaintDC without being in a native paint event
> 
> on console on every redraw (even just moving the mouse around)
> 
> although these are only visible in debug mode they drive me nuts when
> doing a lot of restarts to debug something
> 
> thanks
> 
> Simon
> 
> 
> 
> On Mon, Sep 19, 2016 at 11:53 PM, Maciej Sumiński
>  wrote:
>> Hi Simon,
>>
>> Can you give more details about the assert? Perhaps it is a different
>> problem and should be solved in another way.
>>
>> wxWidgets documentation[1] says it is necessary to create a wxPaintDC
>> object, even if it is not used. IIRC GAL worked on every platform even
>> when it has not created wxPaintDC object, but if the documentation says
>> it should be there, I would rather follow the advice.
>>
>> Regards,
>> Orson
>>
>> 1. http://docs.wxwidgets.org/stable/classwx_paint_d_c.html
>>
>> On 09/18/2016 06:32 AM, Simon Wells wrote:
>>> ---
>>>  common/draw_panel_gal.cpp | 2 ++
>>>  1 file changed, 2 insertions(+)
>>>
>>> diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp
>>> index fd48d83..2616490 100644
>>> --- a/common/draw_panel_gal.cpp
>>> +++ b/common/draw_panel_gal.cpp
>>> @@ -156,7 +156,9 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
>>>  void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
>>>  {
>>>  // This is required even though dc is not used otherwise.
>>> +#ifndef __WXMAC__
>>>  wxPaintDC dc(this);
>>> +#endif
>>>
>>>  m_pendingRefresh = false;
>>>
>>>
>>
>>




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Remove assert in pcbnew on osx with a debug build

2016-09-19 Thread jp charras
Le 19/09/2016 à 13:53, Maciej Sumiński a écrit :
> Hi Simon,
> 
> Can you give more details about the assert? Perhaps it is a different
> problem and should be solved in another way.
> 
> wxWidgets documentation[1] says it is necessary to create a wxPaintDC
> object, even if it is not used. IIRC GAL worked on every platform even
> when it has not created wxPaintDC object, but if the documentation says
> it should be there, I would rather follow the advice.
> 
> Regards,
> Orson
> 

It is true, but it could be a old info in wxWidgets, not yet updated, and not 
true in a wxGLCanvas
wxPaintEvent.

Just for info, I also saw this assert during tests on Ubuntu, with wxWidgets 
compiled with GTK3
(working only in GAL mode, because the "legacy" canvas does not work with GTK3).


-- 
Jean-Pierre CHARRAS

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Remove assert in pcbnew on osx with a debug build

2016-09-19 Thread Maciej Sumiński
Hi Simon,

Can you give more details about the assert? Perhaps it is a different
problem and should be solved in another way.

wxWidgets documentation[1] says it is necessary to create a wxPaintDC
object, even if it is not used. IIRC GAL worked on every platform even
when it has not created wxPaintDC object, but if the documentation says
it should be there, I would rather follow the advice.

Regards,
Orson

1. http://docs.wxwidgets.org/stable/classwx_paint_d_c.html

On 09/18/2016 06:32 AM, Simon Wells wrote:
> ---
>  common/draw_panel_gal.cpp | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/common/draw_panel_gal.cpp b/common/draw_panel_gal.cpp
> index fd48d83..2616490 100644
> --- a/common/draw_panel_gal.cpp
> +++ b/common/draw_panel_gal.cpp
> @@ -156,7 +156,9 @@ void EDA_DRAW_PANEL_GAL::SetFocus()
>  void EDA_DRAW_PANEL_GAL::onPaint( wxPaintEvent& WXUNUSED( aEvent ) )
>  {
>  // This is required even though dc is not used otherwise.
> +#ifndef __WXMAC__
>  wxPaintDC dc(this);
> +#endif
>  
>  m_pendingRefresh = false;
>  
> 




signature.asc
Description: OpenPGP digital signature
___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp


Re: [Kicad-developers] [PATCH] Remove assert in pcbnew on osx with a debug build

2016-09-18 Thread Simon Wells
nickoe has commented on irc whether this is required on any platform,
unfortunately i do not have any other platform for testing on, However
the wxwidgets documention states that wxPaintDC should only be used in
"native onpaint" handlers, what native means in this instance i am
unsure, however on debug builds on osx i get many assertions due to
this so have opted to #ifndef it out.



On Sun, Sep 18, 2016 at 4:37 PM, Simon Wells  wrote:
> ---
>  common/draw_panel_gal.cpp | 2 ++
>  1 file changed, 2 insertions(+)
>

___
Mailing list: https://launchpad.net/~kicad-developers
Post to : kicad-developers@lists.launchpad.net
Unsubscribe : https://launchpad.net/~kicad-developers
More help   : https://help.launchpad.net/ListHelp