s-news
[Top] [All Lists]

Re: gui Dialog Box

To: "Steffen Barembruch" <Steffen@Barembruch.de>
Subject: Re: gui Dialog Box
From: David L Lorenz <lorenz@usgs.gov>
Date: Fri, 1 Dec 2006 08:34:21 -0600
Cc: s-news@lists.biostat.wustl.edu, s-news-owner@lists.biostat.wustl.edu
In-reply-to: <000901c712ea$dcb3da10$c9495382@Steffenlaptop>

Steffen,
  To force the argument passed to the program as a character, you must change the first line to:
guiCreate("Property", Name="first", DialogControl="String", DialogPrompt="first", UseQuotes=T)
  Otherwise, it will look for an object named whatever you typed in to the dialog box.
Dave



"Steffen Barembruch" <Steffen@Barembruch.de>
Sent by: s-news-owner@lists.biostat.wustl.edu

11/28/2006 06:43 AM

To
<s-news@lists.biostat.wustl.edu>
cc
Subject
[S] gui Dialog Box





Hey!
 
I created a very simple Dialog Box with the following code:
 
 
guiCreate("Property", Name="first", DialogControl="String", DialogPrompt="first")
guiCreate("Property", Name="group1",  Type="Group", PropertyList = "first")
guiCreate("Property", Name= "returnvalue", DialogControl = "Invisible", DefaultValue= "a")
 
test <- function(arg1){
   
   print(arg1)
   invisible()
   
}
 
guiCreate("FunctionInfo", Name="test", Function="test", PropertyList = "returnvalue, group1")
guiDisplayDialog("Function", Name="test")
 
Unfortunately I get the following error when entering  a string into the field:
Problem: Object "text" not found
 
If I enter a string included in quotation marks, the error does not occur and the string is passed to the function. How can I change that behaviour?
 
Thanks a lot
Steffen Barembruch
<Prev in Thread] Current Thread [Next in Thread>
  • Re: gui Dialog Box, David L Lorenz <=