MathGroup Archive 2011

[Date Index] [Thread Index] [Author Index]

Search the Archive

Re: PopupWindow vs EventHandler

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117494] Re: PopupWindow vs EventHandler
  • From: magma <maderri2 at gmail.com>
  • Date: Mon, 21 Mar 2011 06:12:29 -0500 (EST)
  • References: <im4ir9$d1s$1@smc.vnet.net>

On Mar 20, 10:53 am, Thomas M=FCnch <thomas.mue... at gmail.com> wrote:
> Dear Group,
>
> Below is a simplified version to illustrate my problem. The code below
> will create a simple graph with a red and blue point. When you click on
> the points, a popup-window will open to present a plot of the "data".
> The red dot does this with an EventHandler[], and the blue dot with a
> PopupWindow[].
>
> data = Table[Sin[x], {x, 0, 10}];
> event[point_] :=
>    EventHandler[Tooltip[Point[point], "EventHandler"],
>     "MouseClicked" :>
>      CreateDocument[ListPlot[data], WindowSize -> All]];
> pop[point_] :=
>    PopupWindow[Tooltip[Point[point], "Popup"], ListPlot[data],
>     WindowSize -> All];
> Graphics[{PointSize[Large], Red, event[{0, 1}], Blue, pop[{1, 1}]},
>   AspectRatio -> Full, ImageSize -> {50, 20}]
>
> There is the following problem: The plot in the PopupWindow can be
> selected, but cannot copied-and-pasted somewhere else. This is something
> that I would like to be able to do.
> With the Plot in the other window (EventHandler), this is possible.
> However, if you now Quit[] the kernel (i.e. Mathematica forgets about
> the definition of data), the EventHandler does not produce the plot
> anymore, while the PopupWindow still works.
>
> I'd like to be able to do one of the following:
> - copy-and-paste plots out of the PopupWindow,
> or:
> - have the EventHandler remember the data in a fresh Mathematica session.
>
> Some background: I analyze data, where the points represent some
> condensed properties of data. Clicking the points should show the
> original data, with the possibility to extract the original-data plot
> (copy-and-paste) for further inspection.
>
> Thank you!
> thomas

I think it is easier to forget the PopupWindow command.
According to the documentation, one should be able to customize the
poppedup window ad libitum, with notebook options,but there does not
seem to be an obvious way to copy and paste the contents of the
window.

I would do:

Button["Plot Data", CreateDocument[{ListPlot[data]}]]

and customize the button and the window as I wish.
This way you can copy-paste, recreate the window (if you get its
handle), ect.
hth


  • Prev by Date: Re: PopupWindow vs EventHandler
  • Next by Date: Re: How to search mathgroup archives... or why does Export on linux need X?
  • Previous by thread: Re: PopupWindow vs EventHandler
  • Next by thread: Re: PopupWindow vs EventHandler