OS X: Figures open and close immediately

Issue #35 resolved
Jan Beneke created an issue

When opening a figure it flashes and closes immediately. It can be shown afterwards.

Example: plot

fig = figure()
fig.plot(dataObject.randN([100,200]))

Figure flashes and closes.

The command

fig.show()

shows the plot dialog as requested.

Example: liveImage

The snippet

cam = dataIO("DummyGrabber")

cam.setParam("bpp",8)
print("width:", cam.getParam("sizex"))
print("height:", cam.getParam("sizey"))

liveImage(cam)

returns

width: 640
height: 480
(5, PlotItem(UiItem(class: Itom2dQwtPlot, name: plot0x0)))

Again, the dialog flashes and disappears immediately.
The debug console output is:

ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  0 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  1 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  2 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  0 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  1 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  2 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  0 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  1 number of items:  3 
ItomSharedSemaphore run into a timeout. Number of attempted listeners:  1 , already freed:  0 
timeout in number:  2 number of items:  3 
begin: startDeviceAndRegisterListener
end: startDeviceAndRegisterListener

Comments (3)

  1. Jan Beneke reporter

    plot() closes in:

    • uiOrganizer.cpp:2816: retval += fig->plot(dataCont.getDataObject(), areaRow, areaCol, className, &destWidget);
    • figureWidget.cpp::326: changeCurrentSubplot(idx);
    • figureWidget.cpp::717: addToolBar(i->toolbar, key_, i->area, i->section);
    • abstractDockWidget::554: m_pWindow->insertToolBar(m_dockToolbar, tb);

    The same happens when using m_pWindow->addToolBar(tb); in abstractDockWidget::554.

  2. Jan Beneke reporter

    Adding

    #ifdef __APPLE__
        // Bug fix: Issue #35
        // OS X hides windows/ dialog after adding a toolbar
        m_pWindow->show();
    #endif // __APPLE__
    

    at the end of

    AbstractDockWidget::addToolBar()
    

    fixes the issue.

  3. Log in to comment