-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Taking member function pointer #55
Comments
The first way should work. |
@ihnorton. FWIW, I think it works if you do the following: # Passing a message to the Julia REPL (Fix)
# Create a function that prints a message in the REPL
say_hi() = println("Hi, this is fun!")::Void
. . . (same as before)
# Setup the button so that it is responsive to the click
cxx"""
void setup(QPushButton* hibtn)
{
QObject::connect(hibtn, &QPushButton::clicked, handle_hi);
}
"""
@cxx setup(hibtn)
. . . (same as before)
# execute the app
@cxx app->exec() Output . . . last step
julia> @cxx app->exec() # click button "say hi"
Hi, this is fun! The current implementation in |
@maxruby thanks - the version currently on master does work for me. However, I'm trying to to write a generalized connect function which is able to take an arbitrary signal. |
Sorry this was not helpful at all . . . I also have Cxx |
@maxruby no worries, it will be good to make sure it works on other plaforms (I'm on linux). @Keno I thought it ought to work too. But the error is from input expression:
result expression (after the error
Kind of confusing that the resulting expression does appear to be properly qualified despite the error message. |
I can take a look in a bit as soon as a I figure out #53, which I'm currently working on. |
@Keno the issue here appears to be (at least in part):
|
Yes, I have reached the same conclusion. Patch on its way. |
The member reference error is definitely fixed, but now I get:
This doesn't seem like a display issue, because |
Fixed! |
To make the Qt example nicer, I tried this:
setup(hibtn, @cxx(&QPushButton::clicked))
which fails with:
and this
setup(hibtn, pcpp"QPushButton::clicked")
, which fails with:Is there a way to do this that I am missing?
The text was updated successfully, but these errors were encountered: