MathGroup Archive 2011

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

Search the Archive

Re: PopupWindow vs EventHandler

  • To: mathgroup at smc.vnet.net
  • Subject: [mg117514] Re: PopupWindow vs EventHandler
  • From: Syd Geraghty <sydgeraghty at me.com>
  • Date: Mon, 21 Mar 2011 06:16:08 -0500 (EST)

Dear Thomas & MathGroup,

 	As I said in my private communication to you your original code worked "as is" on my Mathematica system setup below. I have addressed this post to MathGroup to see if other Mac users also saw no problems.

I generated the two plots in separate windows, copied the graphs & then pasted them successfully into the working notebook or other new notebooks.

I have modified your original post to accentuate the two different methods but the original code you posted is essentially unchanged.

The modified code is:

data = Table[Sin[x], {x, 0, 10}];
event[point_] :=
  EventHandler[Tooltip[Point[point], "EventHandler"],
   "MouseClicked" :>
    CreateDocument[
     ListPlot[data, Frame -> True,
      FrameLabel -> {{y, Sin[x]}, {x,
         "EventHandler Copy & Paste Works"}},
      LabelStyle -> Directive[Red, Bold]], WindowSize -> All]];
pop[point_] :=
  PopupWindow[Tooltip[Point[point], "Popup"],
   ListPlot[data, Frame -> True,
    FrameLabel -> {{y, Sin[x]}, {x, "Popup Copy & Paste Works"}},
    LabelStyle -> Directive[Blue, Bold]], WindowSize -> All];
Graphics[{PointSize[Large], Red, event[{0, 1}], Blue, pop[{1, 1}]},
 AspectRatio -> Full, ImageSize -> {50, 20}]

Thomas wrote:

> It is interesting that it works for you: your solution does not work for me. Maybe it's a Mac vs. Win issue? However, John Fultz has sent me a solution, which will also appear on Mathgroup.

I want to raise an issue that has bothered me recently as someone who plans to enjoy using Mathematica more and more in the next decade.

I appreciate that this particular problem is probably hardware dependent but we seem to be discussing too many hardware / "Mathematica Version Number" problems recently in MathGroup.

In my opinion Mathematica is too important a system to have such issues twenty three years after its first release. Looking back at version history at:

http://www.wolfram.com/mathematica/quick-revision-history.html

anyone who follows the groups posts closely can still see too much evidence that very old versions still have relatively high current usage.

I hope it is only a matter of waiting a short time before Dr. Wolfram decides to rationalize the marketing and sales strategy to make Mathematica the force for technical excellence and mass utility that all the brilliant development work warrants.

The perpetuation of support problems that the current "product version proliferation" in the customer base creates for WRI and its customers has no place in todays world of global software systems.

Customers expect high standards of quality, uniformity of performance, and consistency of operation.

(All that despite a heterogenous set of supported customer platforms).

Having rapid and near 100% customer conversion to the currently released version of a software product is the norm

Having that for Mathematica would drastically reduce support problems for WRI and only enhance the user community product satisfaction. I hope this be comes a realized goal for Mathematica soon, if you go through the current product marketing materials on the Mathematica website it does not appear to be even a goal right now.

We might then also get frequent (and automated) bug fixes, reasonable cost upgrades annually, and the benefits of a rapidly growing user base sharing a common Mathematica experience.

That is also a key to creating a stronger market for Mathematica developers and publishers.

I invite your comments.

Cheers .... Syd

Syd Geraghty B.Sc, M.Sc.

sydgeraghty at mac.com

Mathematica 8.0 for Mac OS X x86 (64-bit) (February 23, 2011)
ReleaseID:    8.0.1.0 (2063982, 2063639)
MacOS X Version 10.6.5 Snow Leopard
MacBook Pro 2.33 GHz Intel Core 2 Duo  2GB RAM

On Mar 20, 2011, at 6:13 PM, Thomas M=FCnch wrote:

> Dear Syd,
>
> good to hear from you. Thank you for your help!
> It is interesting that it works for you: your solution does not work for =
me. Maybe it's a Mac vs. Win issue? However, John has sent me a solution, w=
hich will also appear on Mathgroup.
>>
>>
>> On Mar 20, 2011, at 5:53 AM, Thomas M=FCnch 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 somethin=
g
>>> 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 sessio=
n.
>>>
>>> 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: Wolfram, meet Stefan and Boltzmann
  • Next by Date: Message: "Syntax error in file: xyz" on trying to open saved nb. Ver: 8.0.1
  • Previous by thread: Re: PopupWindow vs EventHandler
  • Next by thread: FullSimplify successive transforms