Well, I figured it out, $m_mgr goes out of scope, but needs to be kept alive, so this fixes it

$m_mgr->Update(); $this->{m_mgr} = $m_mgr ; } $this->Show; ## memory access violation here NO MORE $app->MainLoop; $this->{m_mgr}->UnInit(); ## without this its fault address 0x001d4d91 +.

Subclassing a frame like the original example works better

Final example

#!/usr/bin/perl -- use strict; use warnings; use Wx; use Wx::AUI; ### http://wiki.wxwidgets.org/WxAUI my $app = Wx::SimpleApp->new; my $myframe = MyFrame->new( undef, -1, "myframe3", [ -1, -1 ], [ -1, -1 ], Wx::wxDEFAULT_FRAME_STYLE() | Wx::wxTAB_TRAVERSAL() ); $myframe->Show; $app->MainLoop; BEGIN { package MyFrame; use base qw/ Wx::Frame /; use Wx::Locale( gettext => 'wxT' ); sub new { my $class = shift; my $this = $class->SUPER::new(@_); my $m_mgr = Wx::AuiManager->new(); ## // notify wxAUI which frame to use $m_mgr->SetManagedWindow($this); ## // create several text controls my $text1 = Wx::TextCtrl->new( $this, -1, wxT("Pane 1 - sample text"), Wx::wxDefaultPosition(), Wx::Size->new( ( 200, 150 ) ), Wx::wxNO_BORDER() | Wx::wxTE_MULTILINE() ); my $text2 = Wx::TextCtrl->new( $this, -1, wxT("Pane 2 - sample text"), Wx::wxDefaultPosition(), Wx::Size->new( ( 200, 150 ) ), Wx::wxNO_BORDER() | Wx::wxTE_MULTILINE() ); my $text3 = Wx::TextCtrl->new( $this, -1, wxT("Main content window"), Wx::wxDefaultPosition(), Wx::Size->new( ( 200, 150 ) ), Wx::wxNO_BORDER() | Wx::wxTE_MULTILINE() ); ## // add the panes to the manager $m_mgr->AddPane( $text1, Wx::wxLEFT(), wxT("Pane Number One" +) ); $m_mgr->AddPane( $text2, Wx::wxBOTTOM(), wxT("Pane Number Two" +) ); $m_mgr->AddPane( $text3, Wx::wxCENTER(), "" ); ## same as above #~ $m_mgr->AddPane( $text1, Wx::AuiPaneInfo->new->Name( "Pane Numb +er One" )->Left->Position( 1 )->Resizable ); #~ $m_mgr->AddPane( $text2, Wx::AuiPaneInfo->new->Name( "Pane Numb +er Two" )->Bottom->Position( 1 )->Resizable ); #~ $m_mgr->AddPane( $text3, Wx::AuiPaneInfo->new->Name( "Pane Numb +er Three" )->CenterPane->Position( 1 )->Resizable ); ## // tell the manager to "commit" all the changes just made $m_mgr->Update(); $this->{m_mgr} = $m_mgr; return $this; } sub DESTROY { shift()->{m_mgr}->UnInit(); } }

In reply to Re: Wx::AuiManager likes to be kept alive, derive/subclass works better by Anonymous Monk
in thread Wx::AuiManager faulting module wxbase294u_gcc_citrusperl.dll, version 2.9.4.0, fault address 0x001d52da. by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.