Thank you Carsten,

I prepare the new release.

Best regards,                   Georges.

Carsten Grohmann a écrit :
> Hi Georges,
> 
> may you add the attached patch to the current Debian package. It fixes
> the bug reported by Karsten as well as a second minor bug in the Perl
> code generator.
> 
> Yes, the fix isn't in a release version yet. The fix is in the stable
> branch of wxGlade. You can download the stable version of wxGlade
> always from Bitbucket
> (https://bitbucket.org/agriggio/wxglade/downloads#branch-downloads) and
> execute it directly.
> 
> Regards,
> Carsten
> 
> Karsten Hilbert schrieb am 02.05.2016:
> > Hi Carsten,
> > 
> > > this bug is already fixed in the stable branch of wxGlade 0.7.2 with
> > > changeset 62797578d6d2 "Fix PyDeadObject errors and crashes during
> > > cut and paste".  
> > 
> > Great !  You mean in an unreleased version thereof ?  Because:
> > 
> >     wxglade:
> >       Installiert:           0.7.2-1
> >       Installationskandidat: 0.7.2-1
> >       Versionstabelle:
> >      *** 0.7.2-1 990
> >             990 ftp://ftp.de.debian.org/debian stretch/main i386
> > Packages 500 ftp://ftp.de.debian.org/debian unstable/main i386
> > Packages 100 /var/lib/dpkg/status
> > 
> > > You have three different possibibilties to report wxGlade bugs:
> > >  - send bug reports to the mailing list,
> > >  - file a ticket on Sourceforge
> > > or 
> > >  - send email to my private email address.  
> > 
> > I should've done as I used to do -- email you directly.
> > 
> > Anyway, no harm done.
> > 
> > Karsten
> 

> diff --git a/NEWS.txt b/NEWS.txt
> --- a/NEWS.txt
> +++ b/NEWS.txt
> @@ -25,6 +25,9 @@ Bugs:
>    - Fix generated code for wxDatePickerCtrl
>    - Add workaround for missing wxDefaultDateTime in wxPerl
>    - Fix missing icons in release packages
> +  - Fix PyDeadObject errors and crashes during cut and paste
> +  - System colour constants named incorrectly in Perl (sf bug #184,
> +    Thanks to Sue D. Nymme)
>  
>  Deprecation
>    - In place modifications for generated source files will be removed in one
> diff --git a/README.SF.md b/README.SF.md
> --- a/README.SF.md
> +++ b/README.SF.md
> @@ -26,8 +26,8 @@ Files
>  MD5 checksums
>  -------------
>      b13cdf9eff9857f6f07f1bd6bf50348a  wxGlade-0.7.2-setup.exe
> -    81d3270ba1c764d482b0fed00c6f9c59  wxGlade-0.7.2.tar.gz
> -    69885a306f694222655fe63d3443191b  wxGlade-0.7.2.zip
> +    16395cd62adba4b53da371fe59707a33  wxGlade-0.7.2.tar.gz
> +    61ca7513da4913045854c1b0a62a04a3  wxGlade-0.7.2.zip
>      e57843ad4d0cb6bf1fc2aab7c46aaa73  wxGlade-SAE-0.7.2-setup.exe
>  
>  
> diff --git a/edit_sizers/edit_sizers.py b/edit_sizers/edit_sizers.py
> --- a/edit_sizers/edit_sizers.py
> +++ b/edit_sizers/edit_sizers.py
> @@ -372,9 +372,12 @@ class SizerSlot(object):
>          self.menu.AppendSeparator()
>          misc.append_item(self.menu, PREVIEW_ID, _('Preview'))
>  
> -        wx.EVT_MENU(self.widget, REMOVE_ID, self.remove)
> -        wx.EVT_MENU(self.widget, PASTE_ID, self.clipboard_paste)
> -        wx.EVT_MENU(self.widget, PREVIEW_ID, self.preview_parent)
> +        def bind(method):
> +            return lambda e: wx.CallAfter(method)
> +
> +        wx.EVT_MENU(self.widget, REMOVE_ID, bind(self.remove))
> +        wx.EVT_MENU(self.widget, PASTE_ID, bind(self.clipboard_paste))
> +        wx.EVT_MENU(self.widget, PREVIEW_ID, bind(self.preview_parent))
>  
>      def remove(self, *args):
>          if not self.sizer.is_virtual():
> @@ -409,9 +412,12 @@ class SizerSlot(object):
>  
>          @see: L{clipboard.paste()}
>          """
> +        if self.widget:
> +            self.widget.Hide()
>          if clipboard.paste(self.parent, self.sizer, self.pos):
>              common.app_tree.app.saved = False
> -            self.widget.Hide()
> +        else:
> +            self.widget.Show()
>  
>      def on_select_and_paste(self, *args):
>          """\
> @@ -422,11 +428,11 @@ class SizerSlot(object):
>          self.widget.SetFocus()
>          self.clipboard_paste()
>  
> -    def delete(self, delete_widget=True):
> +    def delete(self):
>          if misc.currently_under_mouse is self.widget:
>              misc.currently_under_mouse = None
>  
> -        if delete_widget and self.widget:
> +        if self.widget:
>              self.widget.Hide()
>  
>              # unbind events to prevent new created (and queued) events
> @@ -1182,7 +1188,7 @@ class SizerBase(Sizer):
>          try:
>              old_child = self.children[pos]
>              if isinstance(old_child.item, SizerSlot):
> -                old_child.item.delete(False)
> +                old_child.item.delete()
>              self.children[pos] = SizerItem(item, pos, option, flag, border,
>                                             size)
>          except IndexError:  # this shouldn't happen!
> diff --git a/tests/casefiles/bug184.cpp b/tests/casefiles/bug184.cpp
> new file mode 100755
> --- /dev/null
> +++ b/tests/casefiles/bug184.cpp
> @@ -0,0 +1,74 @@
> +// -*- C++ -*-
> +//
> +// generated by wxGlade f5bfb036bf72 on Fri Apr 22 21:37:27 2016
> +//
> +// Example for compiling a single file project under Linux using g++:
> +//  g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
> +//
> +// Example for compiling a multi file project under Linux using g++:
> +//  g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp 
> Dialog1.cpp Frame1.cpp
> +//
> +
> +#include "bug184.h"
> +
> +// begin wxGlade: ::extracode
> +// end wxGlade
> +
> +
> +
> +Bug184_Frame::Bug184_Frame(wxWindow* parent, wxWindowID id, const wxString& 
> title, const wxPoint& pos, const wxSize& size, long style):
> +    wxFrame(parent, id, title, pos, size, style)
> +{
> +    // begin wxGlade: Bug184_Frame::Bug184_Frame
> +    label_1 = new wxStaticText(this, wxID_ANY, _("Just a label"));
> +
> +    set_properties();
> +    do_layout();
> +    // end wxGlade
> +}
> +
> +
> +void Bug184_Frame::set_properties()
> +{
> +    // begin wxGlade: Bug184_Frame::set_properties
> +    SetTitle(_("frame_1"));
> +    
> SetBackgroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
> +    // end wxGlade
> +}
> +
> +
> +void Bug184_Frame::do_layout()
> +{
> +    // begin wxGlade: Bug184_Frame::do_layout
> +    wxBoxSizer* sizer_1 = new wxBoxSizer(wxVERTICAL);
> +    sizer_1->Add(label_1, 1, wxALIGN_CENTER|wxALL|wxEXPAND, 5);
> +    SetSizer(sizer_1);
> +    sizer_1->Fit(this);
> +    Layout();
> +    // end wxGlade
> +}
> +
> +
> +class MyApp: public wxApp {
> +public:
> +    bool OnInit();
> +protected:
> +    wxLocale m_locale;  // locale we'll be using
> +};
> +
> +IMPLEMENT_APP(MyApp)
> +
> +bool MyApp::OnInit()
> +{
> +    m_locale.Init();
> +#ifdef APP_LOCALE_DIR
> +    m_locale.AddCatalogLookupPathPrefix(wxT(APP_LOCALE_DIR));
> +#endif
> +    m_locale.AddCatalog(wxT(APP_CATALOG));
> +
> +    wxInitAllImageHandlers();
> +    Bug184_Frame* Frame184 = new Bug184_Frame(NULL, wxID_ANY, wxEmptyString);
> +    SetTopWindow(Frame184);
> +    Frame184->Show();
> +    return true;
> +}
> diff --git a/tests/casefiles/bug184.h b/tests/casefiles/bug184.h
> new file mode 100755
> --- /dev/null
> +++ b/tests/casefiles/bug184.h
> @@ -0,0 +1,51 @@
> +// -*- C++ -*-
> +//
> +// generated by wxGlade f5bfb036bf72 on Fri Apr 22 21:37:27 2016
> +//
> +// Example for compiling a single file project under Linux using g++:
> +//  g++ MyApp.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp
> +//
> +// Example for compiling a multi file project under Linux using g++:
> +//  g++ main.cpp $(wx-config --libs) $(wx-config --cxxflags) -o MyApp 
> Dialog1.cpp Frame1.cpp
> +//
> +
> +#ifndef BUG184_H
> +#define BUG184_H
> +
> +#include <wx/wx.h>
> +#include <wx/image.h>
> +#include <wx/intl.h>
> +
> +#ifndef APP_CATALOG
> +#define APP_CATALOG "app"  // replace with the appropriate catalog name
> +#endif
> +
> +
> +// begin wxGlade: ::dependencies
> +// end wxGlade
> +
> +// begin wxGlade: ::extracode
> +// end wxGlade
> +
> +
> +class Bug184_Frame: public wxFrame {
> +public:
> +    // begin wxGlade: Bug184_Frame::ids
> +    // end wxGlade
> +
> +    Bug184_Frame(wxWindow* parent, wxWindowID id, const wxString& title, 
> const wxPoint& pos=wxDefaultPosition, const wxSize& size=wxDefaultSize, long 
> style=wxDEFAULT_FRAME_STYLE);
> +
> +private:
> +    // begin wxGlade: Bug184_Frame::methods
> +    void set_properties();
> +    void do_layout();
> +    // end wxGlade
> +
> +protected:
> +    // begin wxGlade: Bug184_Frame::attributes
> +    wxStaticText* label_1;
> +    // end wxGlade
> +}; // wxGlade: end class
> +
> +
> +#endif // BUG184_H
> diff --git a/tests/casefiles/bug184.lisp b/tests/casefiles/bug184.lisp
> new file mode 100755
> --- /dev/null
> +++ b/tests/casefiles/bug184.lisp
> @@ -0,0 +1,79 @@
> +#!/usr/bin/env lisp
> +;;;
> +;;; generated by wxGlade edb3dab3dd59+ on Sat Apr 23 17:23:16 2016
> +;;;
> +
> +(asdf:operate 'asdf:load-op 'wxcl)
> +(use-package "FFI")
> +(ffi:default-foreign-language :stdc)
> +
> +
> +;;; begin wxGlade: dependencies
> +(use-package :wxCL)
> +(use-package :wxColour)
> +(use-package :wxEvent)
> +(use-package :wxEvtHandler)
> +(use-package :wxFrame)
> +(use-package :wxSizer)
> +(use-package :wxStaticText)
> +(use-package :wxWindow)
> +(use-package :wx_main)
> +(use-package :wx_wrapper)
> +;;; end wxGlade
> +
> +;;; begin wxGlade: extracode
> +;;; end wxGlade
> +
> +
> +(defclass Bug184_Frame()
> +        ((top-window :initform nil :accessor slot-top-window)
> +        (label-1 :initform nil :accessor slot-label-1)
> +        (sizer-1 :initform nil :accessor slot-sizer-1)))
> +
> +(defun make-Bug184_Frame ()
> +        (let ((obj (make-instance 'Bug184_Frame)))
> +          (init obj)
> +          (set-properties obj)
> +          (do-layout obj)
> +          obj))
> +
> +(defmethod init ((obj Bug184_Frame))
> +"Method creates the objects contained in the class."
> +        ;;; begin wxGlade: Bug184_Frame.__init__
> +        (setf (slot-label-1 obj) (wxStaticText_Create (slot-top-window obj) 
> wxID_ANY (_"Just a label") -1 -1 -1 -1 0))
> +        ;;; end wxGlade
> +        )
> +
> +(defmethod set-properties ((obj Bug184_Frame))
> +        ;;; begin wxGlade: Bug184_Frame.__set_properties
> +        (wxFrame_SetTitle (slot-top-window obj) (_"frame_1"))
> +        (wxWindow_SetBackgroundColour (slot-top-window obj) 
> (wxSystemSettings_GetColour wxSYS_COLOUR_BACKGROUND))
> +        ;;; end wxGlade
> +        )
> +
> +(defmethod do-layout ((obj Bug184_Frame))
> +        ;;; begin wxGlade: Bug184_Frame.__do_layout
> +        (setf (slot-sizer-1 obj) (wxBoxSizer_Create wxVERTICAL))
> +        (wxSizer_AddWindow (slot-sizer-1 obj) (slot-label-1 obj) 1 (logior 
> wxALIGN_CENTER wxALL wxEXPAND) 5 nil)
> +        (wxWindow_SetSizer (slot-top-window obj) (slot-sizer-1 obj))
> +        (wxSizer_Fit (slot-sizer-1 obj) (slot-top-window obj))
> +        (wxFrame_layout (slot-Frame184 self))
> +        ;;; end wxGlade
> +        )
> +
> +;;; end of class Bug184_Frame
> +
> +
> +(defun init-func (fun data evt)
> +        (let ((Frame184 (make-Bug184_Frame)))
> +        (ELJApp_SetTopWindow (slot-top-window Frame184))
> +        (wxWindow_Show (slot-top-window Frame184))))
> +;;; end of class MyApp
> +
> +    (setf (textdomain) "app") ;; replace with the appropriate catalog name
> +    (defun _ (msgid) (gettext msgid "app"))
> +
> +
> +(unwind-protect
> +    (Eljapp_initializeC (wxclosure_Create #'init-func nil) 0 nil)
> +    (ffi:close-foreign-library "../miscellaneous/wxc-msw2.6.2.dll"))
> diff --git a/tests/casefiles/bug184.pl b/tests/casefiles/bug184.pl
> new file mode 100755
> --- /dev/null
> +++ b/tests/casefiles/bug184.pl
> @@ -0,0 +1,96 @@
> +#!/usr/bin/perl -w -- 
> +#
> +# generated by wxGlade f5bfb036bf72 on Fri Apr 22 21:35:44 2016
> +#
> +# To get wxPerl visit http://www.wxperl.it
> +#
> +
> +use Wx 0.15 qw[:allclasses];
> +use strict;
> +
> +# begin wxGlade: dependencies
> +# end wxGlade
> +
> +# begin wxGlade: extracode
> +# end wxGlade
> +
> +package Bug184_Frame;
> +
> +use Wx qw[:everything];
> +use base qw(Wx::Frame);
> +use strict;
> +
> +use Wx::Locale gettext => '_T';
> +sub new {
> +    my( $self, $parent, $id, $title, $pos, $size, $style, $name ) = @_;
> +    $parent = undef              unless defined $parent;
> +    $id     = -1                 unless defined $id;
> +    $title  = ""                 unless defined $title;
> +    $pos    = wxDefaultPosition  unless defined $pos;
> +    $size   = wxDefaultSize      unless defined $size;
> +    $name   = ""                 unless defined $name;
> +
> +    # begin wxGlade: Bug184_Frame::new
> +    $self = $self->SUPER::new( $parent, $id, $title, $pos, $size, $style, 
> $name );
> +    $self->{label_1} = Wx::StaticText->new($self, wxID_ANY, _T("Just a 
> label"));
> +
> +    $self->__set_properties();
> +    $self->__do_layout();
> +
> +    # end wxGlade
> +    return $self;
> +
> +}
> +
> +
> +sub __set_properties {
> +    my $self = shift;
> +    # begin wxGlade: Bug184_Frame::__set_properties
> +    $self->SetTitle(_T("frame_1"));
> +    
> $self->SetBackgroundColour(Wx::SystemSettings::GetColour(wxSYS_COLOUR_BACKGROUND));
> +    # end wxGlade
> +}
> +
> +sub __do_layout {
> +    my $self = shift;
> +    # begin wxGlade: Bug184_Frame::__do_layout
> +    $self->{sizer_1} = Wx::BoxSizer->new(wxVERTICAL);
> +    $self->{sizer_1}->Add($self->{label_1}, 1, 
> wxALIGN_CENTER|wxALL|wxEXPAND, 5);
> +    $self->SetSizer($self->{sizer_1});
> +    $self->{sizer_1}->Fit($self);
> +    $self->Layout();
> +    # end wxGlade
> +}
> +
> +# end of class Bug184_Frame
> +
> +1;
> +
> +package MyApp;
> +
> +use base qw(Wx::App);
> +use strict;
> +
> +sub OnInit {
> +    my( $self ) = shift;
> +
> +    Wx::InitAllImageHandlers();
> +
> +    my $Frame184 = Bug184_Frame->new();
> +
> +    $self->SetTopWindow($Frame184);
> +    $Frame184->Show(1);
> +
> +    return 1;
> +}
> +# end of class MyApp
> +
> +package main;
> +
> +unless(caller){
> +    my $local = Wx::Locale->new("English", "en", "en"); # replace with ??
> +    $local->AddCatalog("app"); # replace with the appropriate catalog name
> +
> +    my $app = MyApp->new();
> +    $app->MainLoop();
> +}
> diff --git a/tests/casefiles/bug184.py b/tests/casefiles/bug184.py
> new file mode 100755
> --- /dev/null
> +++ b/tests/casefiles/bug184.py
> @@ -0,0 +1,56 @@
> +#!/usr/bin/env python
> +# -*- coding: UTF-8 -*-
> +#
> +# generated by wxGlade f5bfb036bf72 on Fri Apr 22 21:37:33 2016
> +#
> +
> +import wx
> +
> +# begin wxGlade: dependencies
> +import gettext
> +# end wxGlade
> +
> +# begin wxGlade: extracode
> +# end wxGlade
> +
> +
> +class Bug184_Frame(wx.Frame):
> +    def __init__(self, *args, **kwds):
> +        # begin wxGlade: Bug184_Frame.__init__
> +        wx.Frame.__init__(self, *args, **kwds)
> +        self.label_1 = wx.StaticText(self, wx.ID_ANY, _("Just a label"))
> +
> +        self.__set_properties()
> +        self.__do_layout()
> +        # end wxGlade
> +
> +    def __set_properties(self):
> +        # begin wxGlade: Bug184_Frame.__set_properties
> +        self.SetTitle(_("frame_1"))
> +        
> self.SetBackgroundColour(wx.SystemSettings_GetColour(wx.SYS_COLOUR_BACKGROUND))
> +        # end wxGlade
> +
> +    def __do_layout(self):
> +        # begin wxGlade: Bug184_Frame.__do_layout
> +        sizer_1 = wx.BoxSizer(wx.VERTICAL)
> +        sizer_1.Add(self.label_1, 1, wx.ALIGN_CENTER | wx.ALL | wx.EXPAND, 5)
> +        self.SetSizer(sizer_1)
> +        sizer_1.Fit(self)
> +        self.Layout()
> +        # end wxGlade
> +
> +# end of class Bug184_Frame
> +class MyApp(wx.App):
> +    def OnInit(self):
> +        Frame184 = Bug184_Frame(None, wx.ID_ANY, "")
> +        self.SetTopWindow(Frame184)
> +        Frame184.Show()
> +        return True
> +
> +# end of class MyApp
> +
> +if __name__ == "__main__":
> +    gettext.install("app") # replace with the appropriate catalog name
> +
> +    app = MyApp(0)
> +    app.MainLoop()
> \ No newline at end of file
> diff --git a/tests/casefiles/bug184.wxg b/tests/casefiles/bug184.wxg
> new file mode 100644
> --- /dev/null
> +++ b/tests/casefiles/bug184.wxg
> @@ -0,0 +1,21 @@
> +<?xml version="1.0"?>
> +<!-- generated by wxGlade edb3dab3dd59+ on Sat Apr 23 17:23:26 2016 -->
> +
> +<application class="MyApp" encoding="UTF-8" for_version="2.8" 
> header_extension=".h" indent_amount="4" indent_symbol="space" is_template="0" 
> language="perl" name="app" option="0" overwrite="1" 
> path="/home/carsten/Projekte.cvs/wxglade/tests/casefiles/bug184.pl" 
> source_extension=".cpp" top_window="Frame184" use_gettext="1" 
> use_new_namespace="1">
> +    <object class="Bug184_Frame" name="Frame184" base="EditFrame">
> +        <title>frame_1</title>
> +        <background>wxSYS_COLOUR_BACKGROUND</background>
> +        <object class="wxBoxSizer" name="sizer_1" base="EditBoxSizer">
> +            <orient>wxVERTICAL</orient>
> +            <object class="sizeritem">
> +                <flag>wxALL|wxEXPAND|wxALIGN_CENTER</flag>
> +                <border>5</border>
> +                <option>1</option>
> +                <object class="wxStaticText" name="label_1" 
> base="EditStaticText">
> +                    <attribute>1</attribute>
> +                    <label>Just a label</label>
> +                </object>
> +            </object>
> +        </object>
> +    </object>
> +</application>
> diff --git a/tests/casefiles/bug184.xrc b/tests/casefiles/bug184.xrc
> new file mode 100644
> --- /dev/null
> +++ b/tests/casefiles/bug184.xrc
> @@ -0,0 +1,19 @@
> +<?xml version="1.0" encoding="UTF-8"?>
> +<!-- generated by wxGlade f5bfb036bf72 on Fri Apr 22 21:37:31 2016 -->
> +
> +<resource version="2.3.0.1">
> +    <object class="wxFrame" name="Frame184" subclass="Bug184_Frame">
> +        <title>frame_1</title>
> +        <object class="wxBoxSizer">
> +            <orient>wxVERTICAL</orient>
> +            <object class="sizeritem">
> +                <option>1</option>
> +                <flag>wxALIGN_CENTER|wxALL|wxEXPAND</flag>
> +                <border>5</border>
> +                <object class="wxStaticText" name="label_1">
> +                    <label>Just a label</label>
> +                </object>
> +            </object>
> +        </object>
> +    </object>
> +</resource>
> diff --git a/tests/test_bugs.py b/tests/test_bugs.py
> --- a/tests/test_bugs.py
> +++ b/tests/test_bugs.py
> @@ -75,3 +75,12 @@ class TestCodeGen(WXGladeBaseTest):
>          self._compare(result_app,    generated_app, app_filename)
>          self._compare(result_frame_cpp,  generated_frame_cpp , 
> 'Bug179_Frame.c++')
>          self._compare(result_frame_h,    generated_frame_h,    
> 'Bug179_Frame.hpp')
> +
> +    def test_bug184(self):
> +        """\
> +        Test bug #184 - Perl code generation: System colour constants named
> +        incorrectly.
> +
> +        That's the test case for SF bug #184.
> +        """
> +        self._test_all('bug184')
> \ No newline at end of file
> diff --git a/wcodegen/__init__.py b/wcodegen/__init__.py
> --- a/wcodegen/__init__.py
> +++ b/wcodegen/__init__.py
> @@ -295,6 +295,7 @@ class PerlMixin(BaseLanguageMixin):
>             name.startswith('wxSPLASH_') or \
>             name.startswith('wxST_') or \
>             name.startswith('wxSys_') or \
> +           name.startswith('wxSYS_COLOUR_') or \
>             name.startswith('wxSW_') or \
>             name.startswith('wxSASH_') or \
>             name.startswith('wxTB_') or \
> diff --git a/wxglade b/wxglade
> --- a/wxglade
> +++ b/wxglade
> @@ -44,7 +44,6 @@ for INTERPRETER in $INTERPRETER_LIST; do
>    break
>  done
>  
> -
>  if [ ! "$PYTHON_BIN" ]; then
>    echo "ERROR: No interpreter for Python 2 found!"
>    echo "       Please install Python 2 to run wxGlade!"
> @@ -71,7 +70,7 @@ for DIR in \
>     "${CURR_DIR}/../lib/python${PY_VERSION}/dist-packages/wxglade" \
>     ; do
>    BINARY="${DIR}/wxglade.py"
> -  if [ -x "${BINARY}" ]; then
> +  if [ -e "${BINARY}" ]; then
>      WXG_BINARY="$BINARY"
>      break
>    fi




-- 
Georges KHAZNADAR et Jocelyne FOURNIER
22 rue des mouettes, 59240 Dunkerque France.
Téléphone +33 (0)3 28 29 17 70

Attachment: signature.asc
Description: PGP signature

Reply via email to