I think it should be this (not sure, never programmed in Julia):

IupOpen();
IupPlotOpen(); # init IupPlot library

# create plots
plot = IupPlot()

# dialog
hbox = IupHbox(plot, C_NULL);
IupSetAttribute(hbox, "MARGIN", "4x4");
IupSetAttribute(hbox, "GAP", "10");

dlg = IupDialog(hbox);
IupSetAttributes(dlg, "SIZE=500x240" );
IupSetAttribute(dlg, "TITLE", "IupPlot Example");

InitPlots(); # It must be able to be done independent of dialog Mapping

IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
IupSetAttribute(dlg, "SIZE", C_NULL);

IupMainLoop()
IupClose()

  It this showing a dialog with at least a white canvas in the center
surrounded by 4x4 margins?

Best,
Scuri


On Sat, May 23, 2015 at 12:04 PM, Joaquim Luis <jl...@ualg.pt> wrote:

>  No, the vboxr was NULL terminated (see line:  vboxr[2] = C_NULL # mark
> end of vector) and I kept the vector out of pure laziness. It turned out
> that this didn't work
>
> plot = IupPlot()
>  dlg = IupDialog(hbox);
>
> because I had an issue on the porting of IupPlot that returned a pointer
> to int instead of a pointer to Ihandle (a void *). When I fixed this it
> started to work.
> But my basic incomprehension of what a dialog is still remains. I know the
> doc says
>
> "... It manages user interaction with the interface elements"
>
> but sorry, this too vague for me. Can I think of it as a similar to the
> Matlab handle to a Figure?
> Why can't I create a dialog by calling it on a IupCanvas. That is, why
> doesn't this work?
>
> dlg = IupDialog( IupCanvas())
>
> And a IupPlot object, can I think of it as a ML equivalent to an axes
> handle? How can I put more than one IupPlot plot side by side?
>
> Well, sorry. Lots of questions but I still don't understand the "mechanics
> of the IUP ensemble"
>
> Joaquim
>
>   Hi,
>
>   I think there is a misunderstanding about the vbox terminator. When you
> pass a list of controls for a box you end that list with a null, for
> instance vbox(but1, but2, null).
>
>   This is not what you are doing. First, if you don't want a tabs, remove
> it from your test. Make it simpler. You also don't need an array of plots,
> you will use just one. Eliminate that too.
>
>   Then we start from there.
>
>   And send me the full Julia file so I can also see what you are doing in
> InitPlot.
>
> Best,
> Scuri
> Em 22/05/2015 16:55, "Joaquim Luis" <jl...@ualg.pt> escreveu:
>
>> Thanks,
>>
>> I managed to make it work in a stripped down version of the pplot
>> example.
>> But now I don't want to plot it in a Tab, I just want a simple plot with
>> an image. I understand that the solution must be in what is used to
>> generate the  IupDialog() bellow, but everything else that I try just
>> brings an empty figure.
>> This is so painful by trial and error. I guess that I simply don't
>> understand what a dialog (the return of  IupDialog(...)) is and the
>> importance of its input argument.
>>
>> Joaquim
>>
>> IupControlsOpen(); # init the addicional controls library (we use IupTabs)
>> IupPlotOpen(); # init IupPlot library
>>
>> # create plots
>> plot[1] = IupPlot()
>>
>> # right panel: tabs with plots
>> vboxr[1] = IupVbox(plot[1]); # each plot a tab
>> s = @sprintf("Plot %d", 1)
>> IupSetAttribute(vboxr[1], "TABTITLE", s); # name each tab
>> vboxr[2] = C_NULL # mark end of vector
>>
>> tabs = IupTabsv(pointer(vboxr)) # create tabs
>>
>> # dialog
>> hbox = IupHbox(tabs);
>> IupSetAttribute(hbox, "MARGIN", "4x4");
>> IupSetAttribute(hbox, "GAP", "10");
>>
>> dlg = IupDialog(hbox);
>> IupSetAttributes(dlg, "SIZE=500x240" );
>> IupSetAttribute(dlg, "TITLE", "IupPlot Example");
>>
>> InitPlots(); # It must be able to be done independent of dialog Mapping
>>
>> IupShowXY(dlg, IUP_CENTER, IUP_CENTER);
>> IupSetAttribute(dlg, "SIZE", C_NULL);
>>
>> IupMainLoop()
>> IupClose()
>>
>>
>>   Hi,
>>
>>   No, only IupImage is accepted as an image handle in a control. So
>> instead of using imFileImageLoadBitmap, use IupLoadImage. It will use 
>> imFileImageLoadBitmap
>> internally and it will return an IupImage Ihandle* so you can use it in
>> IupSetAttributeHandle.
>>
>> Best,
>> Scuri
>>
>>
>> On Wed, May 20, 2015 at 11:24 AM, Joaquim Luis <jl...@ualg.pt> wrote:
>>
>>> Hi,
>>>
>>> How can I plot an image in an axes with coordinates?
>>> I tried with IupPlot and attribute "BACKIMAGE", as in (in Julia)
>>>
>>>         error = pointer([0])
>>>         image = imFileImageLoadBitmap("V://Capture.PNG", 0, error)
>>>         IupSetAttributeHandle(plot[1], "BACKIMAGE", convert(Ptr{Void},
>>> image));
>>>
>>>
>>> but get crashes from the C side saying
>>>
>>> Exception: EXCEPTION_ACCESS_VIOLATION at 0x7ffdca48afd2 -- iupTableGet at
>>> C:\programs\compa_libs\iup\iup.DLL (unknown line)
>>> iupTableGet at C:\programs\compa_libs\iup\iup.DLL (unknown line)
>>> cdIupDrawImage at C:\programs\compa_libs\iup\iupcd.dll (unknown line)
>>> ...
>>>
>>> Thanks
>>>
>>> Joaquim
>>>
>>>
>>> ------------------------------------------------------------------------------
>>> One dashboard for servers and applications across Physical-Virtual-Cloud
>>> Widest out-of-the-box monitoring support with 50+ applications
>>> Performance metrics, stats and reports that give you Actionable Insights
>>> Deep dive visibility with transaction tracing using APM Insight.
>>> http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
>>> _______________________________________________
>>> Iup-users mailing list
>>> Iup-users@lists.sourceforge.net
>>> https://lists.sourceforge.net/lists/listinfo/iup-users
>>>
>>>
>>
>>
>>
>>
>
>
>
------------------------------------------------------------------------------
One dashboard for servers and applications across Physical-Virtual-Cloud 
Widest out-of-the-box monitoring support with 50+ applications
Performance metrics, stats and reports that give you Actionable Insights
Deep dive visibility with transaction tracing using APM Insight.
http://ad.doubleclick.net/ddm/clk/290420510;117567292;y
_______________________________________________
Iup-users mailing list
Iup-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/iup-users

Reply via email to