Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- library(gWidgets)
- items <- data.frame(id=numeric(0), IR=character(0), MR=character(0), FF=character(0), CR=character(0), CO=character(0), OP=character(0), stringsAsFactors=FALSE)
- input <- c("P", "A", "N")
- w <- gwindow("Sample GUI", visible=FALSE)
- g <- ggroup(cont=w, horizontal=FALSE)
- lyt <- glayout(cont=g)
- lyt[1,1] <- "Industrial Risk:"
- lyt[1,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[2,1] <- "Management Risk:"
- lyt[2,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[3,1] <- "Financial Flexibility:"
- lyt[3,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[4,1] <- "Creditability:"
- lyt[4,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[5,1] <- "Competitiveness:"
- lyt[5,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[6,1] <- "Operating Risk:"
- lyt[6,2] <- gcombobox(input, selected=0L, cont=lyt)
- lyt[7,2] <- gbutton("Add", cont=lyt, handler=function(h,...) {
- vals <- lapply(lyt[1:6, 2], svalue)
- id <- nrow(items) + 1
- items[id, ] <<- c(id, vals)
- tbl[] <- items
- })
- gseparator(cont=g)
- tbl <-gtable(items, cont=g)
- visible(w) <- TRUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement