octave-maintainers
[Top][All Lists]
Advanced

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

Re: __fltk_ginput__ to __qt_ginput__


From: Michael Goffioul
Subject: Re: __fltk_ginput__ to __qt_ginput__
Date: Fri, 28 Mar 2014 11:51:01 -0400

On Fri, Mar 28, 2014 at 11:46 AM, John Swensen <address@hidden> wrote:



On Fri, Mar 28, 2014 at 11:38 AM, Doug Stewart <address@hidden> wrote:



On Fri, Mar 28, 2014 at 10:51 AM, Michael Goffioul <address@hidden> wrote:
On Fri, Mar 28, 2014 at 10:30 AM, Doug Stewart <address@hidden> wrote:



On Fri, Mar 28, 2014 at 10:00 AM, Michael Goffioul <address@hidden> wrote:
On Fri, Mar 28, 2014 at 9:48 AM, Doug Stewart <address@hidden> wrote:

I am looking at:
function [x, y, button] = __fltk_ginput__ (f, n = -1)

and would like your advice on how tho change it into
a file that would work with the qt back end.

I think a simple, and not toolkit specific, implementation could leverage the existence of the function waitfor. Conceptually, you can wait for a button press using something along those lines:

    set (gcf, 'windowbuttondownfcn', @(f) set (f, 'userdata', 1));
    waitfor (gcf, 'userdata');

This is the core functionality. Then you need to wrap this up with:
- save/restore windowbuttonfcn and userdata properties
- loop to retrieve multiple mouse clicks
- keep track of the pointer coordinates for each mouse click
- listen for Enter key to stop the process

AFAIK, "waitfor" works in both Qt and FLTK toolkits, so you'd have an implementation that works for both.

Michael.


But waitfor suspends octave.
What we need for sisotool is a non blocking mouse event grabber.
The user , after a plot is drawn, MIGHT want to click on it or might not.

I don't understand your concern. ginput also suspends octave...

Michael.



Is there any way to make a nonblocking mouse event function, using the uixxx type of logic?

If there isn't then I don't see how we can do the sisotool using uixxx functions.
I could be made in qt c++ language but this is quit a different GSoC project.
--
DAS


I'm assuming that many of the UI callbacks are not implemented yet? 

for a description of how you can register for mouse event through a callback function. This is how I normally do little GUI tools in Matlab, rather than ginput. I usually use ginput for cases where it is just a simple script with a known number of points.

QtHandles already supports a bunch of callbacks. The most outstanding missing one is the "motion" callback.

Michael.


reply via email to

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