MathGroup Archive 2011

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

Search the Archive

PopupWindow vs EventHandler

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117482] PopupWindow vs EventHandler
  • From: Thomas Münch <thomas.muench at gmail.com>
  • Date: Sun, 20 Mar 2011 04:53:22 -0500 (EST)

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



  • Prev by Date: Re: Mathematica 8 bug (related to Graph[])
  • Next by Date: FullSimplify successive transforms
  • Previous by thread: Re: Vs. 2.2 Notebooks in vs. 7.0?
  • Next by thread: Re: PopupWindow vs EventHandler