Ticket #93 (closed defect: fixed)

Opened 5 years ago

Last modified 5 years ago

wxNotebook/wxAuiNotebook incompatibility

Reported by: hjansen Owned by:
Priority: major Milestone:
Component: editor Version: 0.15
Keywords: Cc:

Description

wxNotebook/wxAuiNotebook are almost but apparently not fully compatible: There is no equivalent to wxNotebook::ChangeSelection in !wxAuiNotebook (at least up to wxWidgets 2.8.9).
One can use wxAuiNotebook::SetSelection but unlike wxNotebook::ChangeSelection this will generate a page change event.
I don't know if that might be a problem but since using ChangeSelection definitely _is_ a problem the following change seems unavoidable:

Index: lib/Padre/Wx/MainWindow.pm
===================================================================
--- lib/Padre/Wx/MainWindow.pm  (Revision 693)
+++ lib/Padre/Wx/MainWindow.pm  (Arbeitskopie)
@@ -1159,7 +1183,7 @@
        my ($self, $id) = @_;
        my $page = $self->{notebook}->GetPage($id);
        if ($page) {
-          $self->{notebook}->ChangeSelection($id);
+          $self->{notebook}->SetSelection($id);
           $self->refresh_status;
           return 1;
        }

Change History

comment:1 Changed 5 years ago by szabgab

  • Status changed from new to closed
  • Resolution set to fixed

applied, thanks
so Padre now won't crash when trying to open a file that was already opened.

Note: See TracTickets for help on using tickets.