1
`win <- gwindow(title = "Analysing PDB structures", visible=TRUE, name=title,
width = NULL, height = NULL, parent=NULL)
group <- ggroup(horizontal = FALSE, container=win)
obj <- glabel("Type your PDB code here:", container = group)
obj <- gedit("", container=group)
obj <- gbutton("Go", container = group)`
사용자가 gedit에 값을 입력하고 "이동"버튼을 누르면 다음 코드 (예 : install.packages (bio3d))가 자동으로 실행됩니까?어떻게 gWidget에 기능을 부여하고 사용자가 'gedit'에 입력 한 내용을 활용할 수 있습니까?
편집 : 게시물에 대한 응답으로 기능을 관리해 봤는데, 고마워. obj3의 'gedit'에서 사용자가 입력 한 내용을 어떻게 활용할 수 있습니까? 내가 도대체 뭘 잘못하고있는 겁니까?
win <- gwindow(title = "Analysing PDB structures",
visible=TRUE, name=title,
width = NULL, height = NULL, parent=NULL)
group <- ggroup(horizontal = FALSE, container=win)
obj1 <- glabel("Type your PDB code here:", container = group)
innergroup <- ggroup(container = group)
obj2 <- gedit((file1<-""), container=innergroup)
obj3<-addHandlerChanged(obj2, handler=function(...){
gbutton("Go", container = innergroup,
handler = function(h, ...) {
gmessage(svalue(obj2), title = (pdb<- read.pdb(file1)))
})
})