I'm preparing an extension to the AUI demo [edit: now in master] that allows pane options to be turned on and off for each pane. It's mostly working but there's a few wrinkles to fix before submitting a PR.
There are two items that sometimes causes a crash: they are attempting to resize where the draggable border touches a non-resizable pane, or on rare occasions, toggling the resize status of a pane. The error on the console looks like this:
*** Caught unhandled unknown exception; terminating
Segmentation fault (core dumped)
I'm struggling to determine an exact set of reproduce instructions - presently I am toggling the resize property on a number of panes until it crashes! It's worth noting that when a property (such as resizability) changes, I am detaching the pane and re-adding it - this feels like a bit of hack but is the only way it seems to redraw correctly at present. It is possible that by doing that in a more elegant fashion, this issue might resolve itself too.
It occurs to me also that perhaps giving a pane an explicit size prior to removing resizability might help?
It may help for me to produce a simplified example to narrow down the cause, but perhaps someone can suggest things to make the code more stable in the meantime?
The rough-and-ready code to re-attach panes to redraw them is thus:
protected function onPaneTickBoxChange(wxEvent $event)
{
// Get the currently selected pane
$paneIndex = $this->getSelectedPaneIndex();
/* @var $paneInfo wxAuiPaneInfo */
$paneInfo = $this->getPaneInfoByIndex($paneIndex);
// Set new flag true/false on paneinfo, using setter methods
/* @var $ctrl wxCheckBox */
$ctrl = wxDynamicCast($event->GetEventObject(), "wxCheckBox");
$methods = $this->getPaneSetterMethods();
$method = $methods[$ctrl->GetName()];
$paneInfo->$method($ctrl->GetValue());
/* @var $window \wxTextCtrl */
/* @var $manager \wxAuiManager */
$window = $this->getManagedWindow()->getWindowByIndex($paneIndex);
$manager = $this->getManagedWindow()->getAuiManager();
// This sort of works, but the pane sometimes ends up being moved
$manager->DetachPane($window);
$manager->AddPane($window, $paneInfo);
// Now redraw the panes
$this->getManagedWindow()->getAuiManager()->Update();
}
I'm preparing an extension to the AUI demo [edit: now in master] that allows pane options to be turned on and off for each pane. It's mostly working but there's a few wrinkles to fix before submitting a PR.
There are two items that sometimes causes a crash: they are attempting to resize where the draggable border touches a non-resizable pane, or on rare occasions, toggling the resize status of a pane. The error on the console looks like this:
I'm struggling to determine an exact set of reproduce instructions - presently I am toggling the resize property on a number of panes until it crashes! It's worth noting that when a property (such as resizability) changes, I am detaching the pane and re-adding it - this feels like a bit of hack but is the only way it seems to redraw correctly at present. It is possible that by doing that in a more elegant fashion, this issue might resolve itself too.
It occurs to me also that perhaps giving a pane an explicit size prior to removing resizability might help?
It may help for me to produce a simplified example to narrow down the cause, but perhaps someone can suggest things to make the code more stable in the meantime?
The rough-and-ready code to re-attach panes to redraw them is thus: