s-news
[Top] [All Lists]

[S] Returning Values from a Dialog

To: S Plus News <s-news@wubios.wustl.edu>
Subject: [S] Returning Values from a Dialog
From: David Rose <Quinion_Rose@compuserve.com>
Date: Wed, 29 Dec 1999 14:57:03 -0500
Sender: owner-s-news@wubios.wustl.edu
To any S-Plus programmers:

[S-Plus 2000 running on Windows 95]

I want to create a dialog which prompts me for a data frame and also a
column within that data frame.  The names of both will then be supplied to
an analysis (I've called it a "ribbon analysis" - this is irrelevant, but
is the explanation for my naming convention) on the column of the data
frame in question.

I've borrowed the "Widgets" example from the manual and adapted it
slightly, so that the following script delivers the name of the column
correctly - but I can't get at the name of the selected data frame.  Can
anybody tell me how I can access BOTH names?

Many thanks to anybody who can help me with this.


guiCreate("Property",
   Name = "RibDataFrame",
   DialogPrompt = "Data Frame",
   CopyFrom = "TXPROP_DataFrames")

guiCreate("Property",
   Name = "RibDataColumn",
   DialogPrompt = "Data Column",
   CopyFrom = "TXPROP_DataFrameColumnsND",
   UseQuotes = T)

guiCreate("Property",
   Name = "RibDataGroup",
   Type = "Group",
   DialogPrompt = "Data",
   PropertyList = c("RibDataFrame", "RibDataColumn"))

guiCreate("Property",
   Name = "RibReturn",
   DialogControl = "String",
   DialogPrompt = "Save As",
   DefaultValue = "Last.Ribbon")

guiCreate("Property",
   Name = "RibPage1",
   Type = "Page",
   dialogPrompt = "Data Page",
   PropertyList = c("RibDataGroup", "RibReturn"))

Ribbon <- function(RibDataFrame, RibDataColumn)
   {
   display.messagebox(cat("You are loading ", RibDataFrame, sep = ""))
   invisible()
   }

guiCreate("FunctionInfo",
   Name = "Ribbon",
   DialogHeader = "Ribbon Chart",
   PropertyList = c("RibPage1"),
   ArgumentList = c("#0 = RibDataFrame", "#1 = RibDataColumn"))

guiDisplayDialog("Function", Name = "Ribbon")

(Incidentally, reversing the order of the argument list in FunctionInfo
above does have the effect of returning the data frame as opposed to the
selected column - but it delivers the contents of the data frame as opposed
to its name.  I think I probably have to use the cbGetCurrValue() function
for each of the objects I want to access, and link in a callback function -
but at this point I'm out of my depth, as I don't yet understand callback
functions.)
-----------------------------------------------------------------------
This message was distributed by s-news@wubios.wustl.edu.  To unsubscribe
send e-mail to s-news-request@wubios.wustl.edu with the BODY of the
message:  unsubscribe s-news

<Prev in Thread] Current Thread [Next in Thread>