MathGroup Archive 2007

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

Search the Archive

simple Button code hangs dynamic evaluation: why?

  • To: mathgroup at smc.vnet.net
  • Subject: [mg83470] simple Button code hangs dynamic evaluation: why?
  • From: Matthew Fairtlough <matthew at fairtlough.net>
  • Date: Wed, 21 Nov 2007 02:51:24 -0500 (EST)

I have a notebook containing code to generate a button to prompt for 
input (the full expression has been shown in the below as obviously I 
can't paste the button here):

In[1]:= Button["Warning: may hang kernel", Input["Good luck!"]]

Out[1]= Cell[BoxData[
  ButtonBox["\<\"Warning: may hang kernel\"\>",
   Appearance->Automatic,
   ButtonFrame->"DialogBox",
   ButtonFunction:>Input["Good luck!"],
   Evaluator->Automatic,
   Method->"Preemptive"]], "Output",
  CellChangeTimes->{3.404570874283229*^9, 3.4045709276399517`*^9}]

when I click on the button an input field pops up but I get a (warning?) 
dialog hidden behind the input field and after a period of hanging get a 
kernel message asking if I want to abort dynamic evaluation.  It can be 
difficult or impossible to interrupt the dynamic evaluation or get rid 
of the dialog button until I respond appropriately to the kernel message.

This seemed to me an innocent sort of thing to do; can anyone tell me 
why it isn't or if this is a bug?

thanks,

Matthew.


  • Prev by Date: StringInput Question
  • Next by Date: Re: Fast way of checking for perfect squares?
  • Previous by thread: Re: StringInput Question
  • Next by thread: Re: simple Button code hangs dynamic evaluation: why?