On 2018-05-25 15:37-0400 David Bergman wrote:
Alan,
I regret waiting this long to reply but have had a lot of work.
To tell you the truth I am not sure what exactly caused the issue but I've
deleted the "wxOVERRIDE" from the code, which was clearly a copy-paste from a
wxWidgets example.
I copied the simple.cpp code into the PLplot-Widgets example.
cmake and nmake both ran find but cmake install generated the following fatal
error. Recall that I had quite a bit of trouble getting it to install the
first time and I may have missed an option that is required. Not sure if my
error is due to the same issue that caused your error.
Install the project...
-- Install configuration: "Debug"
-- Installing: C:/Program Files (x86)/plplot/share/doc/plplot/ABOUT
CMake Error at cmake_install.cmake:39 (file):
file INSTALL cannot copy file "C:/plplot-5.13.0/ABOUT" to "C:/Program Files
(x86)/plplot/share/doc/plplot/ABOUT".
NMAKE : fatal error U1077: 'echo' : return code '0x1'
Stop.
Hi David:
In my case, it was configuration of a new computer which kept me from
replying to what you said above in a timely way. My apologies for that
delay. But that new computer configuration has now been a success (I
am writing this from the new computer and PLplot also builds
on that new computer) so I now have a chance to answer you.
I think the nmake trouble you are having is due to the (default) install prefix
"C:/Program Files (x86)" having a blank in the path. I think all those "blank
in
path" issues are now gone in the git version of PLplot so please try that not
only for that reason but also because that is the version of PLplot I test with
in any case.
I tried a similar test (copying simple.cpp on top of
examples/c++/wxPLplotDemo.cpp) here,
but in my case I configured PLplot with the cmake option -DBUILD_TEST=ON which
allows users to test in the build tree without having to install. The result
on
my new Debian Buster platform was I could build and run simple.cpp using
"make test_wxPLplotDemo". That test had two key warnings which were
Gtk-Message: 22:23:32.181: GtkDialog mapped without a transient parent. This is
discouraged.
on the command line + a dialog box with the following contents:
"Somehow we attempted to plot before the wxPLplotwindow was ready. The plot
will not be drawn".
And indeed that was followed by a blank plot. So it appears your simple.cpp is
still
not set up correctly for the Linux case.
I have put this thread back on the plplot-general list because Phil
Rosenberg, the author of the PLplot wxwidgets binding and device may
wish to comment since he had similar "waiting for events" trouble in
the past on Linux which might be related to what I am seeing on Linux with
the current simple.cpp.
Alan
__________________________
Alan W. Irwin
Astronomical research affiliation with Department of Physics and Astronomy,
University of Victoria (astrowww.phys.uvic.ca).
Programming affiliations with the FreeEOS equation-of-state
implementation for stellar interiors (freeeos.sf.net); the Time
Ephemerides project (timeephem.sf.net); PLplot scientific plotting
software package (plplot.sf.net); the libLASi project
(unifont.org/lasi); the Loads of Linux Links project (loll.sf.net);
and the Linux Brochure Project (lbproject.sf.net).
__________________________
Linux-powered Science
__________________________
// For compilers that support precompilation, includes "wx/wx.h".
#include "wx/wxprec.h"
#ifdef __BORLANDC__
#pragma hdrstop
#endif
// for all others, include the necessary headers (this file is usually all you
// need because it includes almost all "standard" wxWidgets headers)
#ifndef WX_PRECOMP
#include "wx/wx.h"
#include "wx/log.h"
#include "wx/app.h"
#include "wx/frame.h"
#include "wx/scrolwin.h"
#include "wx/menu.h"
#include "wx/textctrl.h"
#include "wx/textdlg.h"
#endif
#include "wx/wx.h"
#include "wx/app.h"
#include "wx/frame.h"
#include "wx/panel.h"
#include "wx/scrolwin.h"
#include "wx/menu.h"
#include "wx/textctrl.h"
#include "wx/textdlg.h"
#include "wx/intl.h"
#include "wx/file.h"
#include "wx/log.h"
#include "wx/cmdline.h"
#include "wx/calctrl.h"
#include "wx/splitter.h"
#include "wx/dcmirror.h"
//*****
// Cut from wxPLplotDemo
//*****
#include "wxPLplotwindow.h"
#include <stdlib.h>
#include <iostream>
#include <fstream>
#include <string>
#include <sstream>
#include <math.h>
#include <complex>
#include <cmath>
using namespace std;
#define MAX( a, b ) ( ( a ) < ( b ) ? ( b ) : ( a ) )
#define MIN( a, b ) ( ( a ) < ( b ) ? ( a ) : ( b ) )
// Plotting function
template< class WXWINDOW >
void Plot(wxPLplotwindow<WXWINDOW> *plotwindow)
{
if (!plotwindow->IsReady())
{
wxMessageBox(wxT("Somehow we attempted to plot before the wxPLplotwindow was ready. The plot will not be drawn."));
return;
}
wxPLplotstream* pls = plotwindow->GetStream();
PLPLOT_wxLogDebug("Plot()");
assert(pls);
const size_t np = 500;
PLFLT x[np], y[np];
PLFLT xmin, xmax;
PLFLT ymin = 1e30, ymax = 1e-30;
xmin = -2.0;
xmax = 10.0;
for (size_t i = 0; i < np; i++)
{
x[i] = (xmax - xmin) * i / np + xmin;
y[i] = 1.0;
if (x[i] != 0.0)
y[i] = sin(x[i]) / x[i];
ymin = MIN(ymin, y[i]);
ymax = MAX(ymax, y[i]);
}
pls->scolbg(255, 255, 255);
pls->scol0(1, 0, 0, 0);
pls->scol0(2, 0, 130, 130);
pls->adv(0);
pls->col0(1);
pls->width(2);
pls->env(xmin, xmax, ymin, ymax, 0, 0);
pls->lab("x", "y", "sin(x)/x");
pls->col0(3);
pls->width(2);
pls->line(np, x, y);
plotwindow->RenewPlot();
}
// Define a new application type, each program should derive a class from wxApp
class MyApp : public wxApp
{
public:
// MyApp() { }
virtual bool OnInit(); // wxOVERRIDE;
// wxDECLARE_NO_COPY_CLASS(MyApp);
};
// Define a new frame type: this is going to be our main frame
class MyFrame : public wxFrame
{
public:
MyFrame();
private:
wxPLplotwindow<wxPanel> *m_right;
wxTextCtrl *m_left;
wxSplitterWindow* m_splitter;
wxWindow *m_replacewindow;
};
// ============================================================================
// implementation
// ============================================================================
wxIMPLEMENT_APP(MyApp);
bool MyApp::OnInit()
{
if (!wxApp::OnInit())
return false;
MyFrame *frame = new MyFrame;
frame->Show(true);
return true;
}
// frame constructor
MyFrame::MyFrame()
: wxFrame(NULL, wxID_ANY, wxT("Test!"),
wxDefaultPosition, wxSize(1020, 600),
wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE)
{
// Here is a new attempt which uses the splitter window and tries to get a plot in one of the windows.
m_splitter = new wxSplitterWindow(this);
m_splitter->SetSashGravity(1.0);
m_left = new wxTextCtrl(m_splitter, wxID_ANY, wxEmptyString,
wxDefaultPosition, wxDefaultSize,
wxTE_MULTILINE | wxTE_READONLY);
m_right = new wxPLplotwindow<wxPanel>();
m_right->Create(m_splitter, wxID_ANY);
m_splitter->SplitVertically(m_left, m_right);
m_splitter->SetSashGravity(0.2);
Plot(m_right);
m_replacewindow = NULL;
}
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Plplot-general mailing list
Plplot-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/plplot-general