jverzani / gWidgets2

Rewrite of gWidgets
35 stars 9 forks source link

‘dispose’ is not a valid field or method name for reference class “GBasicDialog” #103

Open selesnow opened 3 years ago

selesnow commented 3 years ago

Hello!

Thank for gWidgets2

When i try apply dispose() to gbasicdialog object i get error: ‘dispose’ is not a valid field or method name for reference class “GBasicDialog”.

Minimal example:

library(gWidgets2)
library(gWidgets2tcltk)

library(gWidgets2)
library(gWidgets2tcltk)

auth_win <- gbasicdialog("BI Data Uploader System v 2.0",visible  = F,do.buttons=FALSE)

gbutton("Cancel", container = auth_win,handler = function(h,...) {
  dispose(auth_win)
})

How i can close gbasicdialog?

selesnow commented 3 years ago

I finded reason on this error.

Code of gWidgets2:::dispose.GBasicDialog()

```r
function (obj, ...) 
{
    obj$dispose()
}

But obj does't has $dispose() methode, it has $dispose_window() methode.

You can change to:

function (obj, ...) 
{
    obj$dispose_window()
}
selesnow commented 3 years ago

I sended pull request with bug fix.

OskarHansson commented 2 years ago

@selesnow, I have the same issue. @jverzani will it be fixed in the next version?

selesnow commented 2 years ago

@OskarHansson

Hello, i am fixed this issue, you can install package from my fork https://github.com/selesnow/gWidgets2

OskarHansson commented 2 years ago

@selesnow Thanks, I might do that. But I hope your/a solution will get implemented in the next release.

jverzani commented 2 years ago

Sorry, this is my fault. I wanted to put the gWidgets stuff in a single github name (not mine) but gWidgets2 was taken. So the repositories here: https://github.com/gWidgets3 are where you can make PRs. I don't know why I didn't set things up to redirect, likely ignorance and low enough activity to think it would be an issue. Anyways, if you want to add a PR on the active repository I can merge it in and try to get passed the CRAN guards.

OskarHansson commented 2 years ago

I posted this as a new issue in the correct repository as a reminder. I have reworked my code to use a gconfirm dialog instead.