Inserting PlotCanvas in a dialog build with wxDesigner

I've create a dialog with wxDesigner. I've inserted and foreign control
with ID ID_ALINEAMIENTO_GRAFICA.

I've created the folowing clas to insert a PlotCanvas (from wxPyPlot) in
the foreign control, but when i call the dialog a segment failure appears.

class AlineamientoDlg(wxDialog):
    def __init__(self, parent, id, title,
        pos = wxPyDefaultPosition, size = wxPyDefaultSize,
        style = wxDEFAULT_DIALOG_STYLE ):
        wxDialog.__init__(self, parent, id, title, pos, size, style)

        AlineamientoDialogFunc( self, true )

        self.CentreOnParent()
        self.plotcanvas = PlotCanvas(self,ID_ALINEAMIENTO_GRAFICA)

        self.pg = PlotGraphics()
        self.plotCanvas.Draw(self.pg)

Somebody knows how to do this properly?

Thanks in advance

Zunbeltz

Zunbeltz Izaola wrote:

I've create a dialog with wxDesigner. I've inserted and foreign control
with ID ID_ALINEAMIENTO_GRAFICA.

I've created the folowing clas to insert a PlotCanvas (from wxPyPlot) in
the foreign control, but when i call the dialog a segment failure appears.

class AlineamientoDlg(wxDialog):
    def __init__(self, parent, id, title,
        pos = wxPyDefaultPosition, size = wxPyDefaultSize,
        style = wxDEFAULT_DIALOG_STYLE ):
        wxDialog.__init__(self, parent, id, title, pos, size, style)

        AlineamientoDialogFunc( self, true )

        self.CentreOnParent()
        self.plotcanvas = PlotCanvas(self,ID_ALINEAMIENTO_GRAFICA)

        self.pg = PlotGraphics()
        self.plotCanvas.Draw(self.pg)

Somebody knows how to do this properly?

I think you need to create the foreign control (the PlotCanvas) *before* you call the DialogFunc. Look in the AlineamientoDialogFunc code and see what it is doing with ID_ALINEAMIENTO_GRAFICA and it will help explain this.

···

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

Thanks it works.

Zunbeltzx

···

On Wed, 29 Oct 2003, Robin Dunn wrote:

Zunbeltz Izaola wrote:
> I've create a dialog with wxDesigner. I've inserted and foreign control
> with ID ID_ALINEAMIENTO_GRAFICA.
>
> I've created the folowing clas to insert a PlotCanvas (from wxPyPlot) in
> the foreign control, but when i call the dialog a segment failure appears.
>
> class AlineamientoDlg(wxDialog):
> def __init__(self, parent, id, title,
> pos = wxPyDefaultPosition, size = wxPyDefaultSize,
> style = wxDEFAULT_DIALOG_STYLE ):
> wxDialog.__init__(self, parent, id, title, pos, size, style)
>
> AlineamientoDialogFunc( self, true )
>
> self.CentreOnParent()
> self.plotcanvas = PlotCanvas(self,ID_ALINEAMIENTO_GRAFICA)
>
> self.pg = PlotGraphics()
> self.plotCanvas.Draw(self.pg)
>
> Somebody knows how to do this properly?

I think you need to create the foreign control (the PlotCanvas) *before*
you call the DialogFunc. Look in the AlineamientoDialogFunc code and
see what it is doing with ID_ALINEAMIENTO_GRAFICA and it will help
explain this.

--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!

---------------------------------------------------------------------
To unsubscribe, e-mail: wxPython-users-unsubscribe@lists.wxwindows.org
For additional commands, e-mail: wxPython-users-help@lists.wxwindows.org