octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: gnuplot & multiplot


From: Daniel J Sebald
Subject: Re: gnuplot & multiplot
Date: Sat, 19 Oct 2013 01:56:12 -0500
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.24) Gecko/20111108 Fedora/3.1.16-1.fc14 Thunderbird/3.1.16

On 10/18/2013 07:42 AM, Michael Goffioul wrote:
On Thu, Oct 17, 2013 at 11:37 PM, Daniel J Sebald
<address@hidden <mailto:address@hidden>> wrote:
[snip]
    Actually, there may be a solution to this, but it would take a
    slight bit extra programming on the application side.  Before Qt
    gnuplot terminal, I added a feature to the x11 terminal whereby an X
    window ID can be passed into the gnuplot command "set term x11".
      The concept is that the application creates a phantom X window
    that it wants gnuplot to plot to.  In that scenario, the X gnuplot
    driver will not create a X term, but just plot into the external
    window.  Thus, if the X window is closed, the application should be
    able to detect that.  I remember writing some kind of demo using gtk
    or one of those graphical interfaces that showed promise for a short
    while.

    It appears that Qt terminal has a similar sort of thing:

      Syntax:
              set term qt {<n>}
                          {size <width>,<height>}
                          {{no}enhanced}
                          {font <font>}
                          {title "title"}
                          {{no}persist}
                          {{no}raise}
                          {{no}ctrl}
                          {close}
                          {widget <id>}

    So, if Octave can recognize that gnuplot is using qt terminal, it
    would first create an empty Qt window and pass the ID (if it can be
    discovered) to gnuplot.  Octave would connect the close signal of
    that Qt window to a slot that does "close(5)", for example... if
    there were a background command queue (which I wrote in the patch
    tracker somewhere).

    In the documentation for the Qt Widget is this member function:

    http://qt-project.org/doc/qt-__4.8/qwidget.html#__effectiveWinId
    <http://qt-project.org/doc/qt-4.8/qwidget.html#effectiveWinId>

    typedef WId

    Platform dependent window identifier.  I'll ask the list.


Be careful that the effective WinId is shared by multiple QWidget within
the same window. So you may end up with gnuplot drawing over other
widgets you might have in the window. You need to enable the native
windows flag on the widget if you want it to have its own X11 ID. Also
I'm wondering how portable to other platforms your suggestion is.

The phantom window is specifically intended for gnuplot to use. One shouldn't put other widgets in there. No X11 ID; that was a description of what I did prior to when the gnuplot Qt terminal came along. The person who wrote the Qt terminal patterned its syntax/functionality similar to the X11 terminal syntax... I'm only considering the gnuplot Qt terminal because Octave GUI is written using Qt, so the concept is portable in so much as Qt is portable.

Dan


reply via email to

[Prev in Thread] Current Thread [Next in Thread]