Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
193
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.03 KB | None | 0 0
  1. library(gWidgets)
  2. 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)
  3. input <- c("P", "A", "N")
  4. w <- gwindow("Sample GUI", visible=FALSE)
  5. g <- ggroup(cont=w, horizontal=FALSE)
  6. lyt <- glayout(cont=g)
  7. lyt[1,1] <- "Industrial Risk:"
  8. lyt[1,2] <- gcombobox(input, selected=0L, cont=lyt)
  9. lyt[2,1] <- "Management Risk:"
  10. lyt[2,2] <- gcombobox(input, selected=0L, cont=lyt)
  11. lyt[3,1] <- "Financial Flexibility:"
  12. lyt[3,2] <- gcombobox(input, selected=0L, cont=lyt)
  13. lyt[4,1] <- "Creditability:"
  14. lyt[4,2] <- gcombobox(input, selected=0L, cont=lyt)
  15. lyt[5,1] <- "Competitiveness:"
  16. lyt[5,2] <- gcombobox(input, selected=0L, cont=lyt)
  17. lyt[6,1] <- "Operating Risk:"
  18. lyt[6,2] <- gcombobox(input, selected=0L, cont=lyt)
  19. lyt[7,2] <- gbutton("Add", cont=lyt, handler=function(h,...) {
  20. vals <- lapply(lyt[1:6, 2], svalue)
  21. id <- nrow(items) + 1
  22. items[id, ] <<- c(id, vals)
  23. tbl[] <- items
  24. })
  25. gseparator(cont=g)
  26. tbl <-gtable(items, cont=g)
  27. visible(w) <- TRUE
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement