Hi, all.
IUP 3.13, official bin, iuplua.
In iup.plot the plot.CLEAR not worked.
See example in attach.
After several button clicks - it crashes.
--
wbr,
Karagy
local iup = require("iuplua")
require("iupluacontrols")
require("iuplua_plot")
local T = {
{0.1, 0.2, 0.35, 0.4, 0.72},
{3.1, 2.8, 2.52, 2.6, 2.68},
}
local APP = {}
APP.plot = iup.plot{
ANTIALIAS = "NO",
--GRAPHICSMODE = "OPENGL",
GRAPHICSMODE = "NATIVEPLUS",
--GRAPHICSMODE = "IMAGERGB",
--SYNCVIEW = "YES",
TITLE = "test plot.CLEAR",
MARGINBOTTOM = 30,
MARGINLEFT = 60,
AXS_XLABEL = "Time",
-- AXS_YLABEL = "RPM",
AXS_XAUTOMIN = "YES",
AXS_XAUTOMAX = "YES",
AXS_YAUTOMIN = "YES",
AXS_YAUTOMAX = "YES",
AXS_XCROSSORIGIN = "NO",
AXS_YCROSSORIGIN = "NO",
LEGENDSHOW = "NO",
LEGENDPOS = "TOPRIGHT",
GRID = "YES",
}
function APP:show_ds(ds)
local plot = self.plot
print("A:", plot.COUNT)
plot.CLEAR = 1
print("B:", plot.COUNT)
iup.PlotBegin(plot, 0)
local n = iup.PlotEnd(plot)
iup.PlotAddSamples(plot, n, ds[1], ds[2], #ds[1])
plot.REDRAW = 1
print("C:", plot.COUNT)
end
APP.dlg = iup.dialog{
SIZE = "HALFxHALF",
iup.hbox{
iup.vbox{
iup.button{
TITLE = "ReCreate",
action = function (this)
APP:show_ds(T)
end,
},
},
APP.plot,
},
}
APP.dlg:showxy(iup.CENTER, iup.CENTER)
APP:show_ds(T)
--iup.Show(iup.LayoutDialog(APP.dlg))
iup.MainLoop()
------------------------------------------------------------------------------
BPM Camp - Free Virtual Workshop May 6th at 10am PDT/1PM EDT
Develop your own process in accordance with the BPMN 2 standard
Learn Process modeling best practices with Bonita BPM through live exercises
http://www.bonitasoft.com/be-part-of-it/events/bpm-camp-virtual- event?utm_
source=Sourceforge_BPM_Camp_5_6_15&utm_medium=email&utm_campaign=VA_SF
_______________________________________________
Iup-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/iup-users