Skip to content
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

Add function to hide and show the matlab engine #79

Merged
merged 1 commit into from
Nov 7, 2016
Merged

Add function to hide and show the matlab engine #79

merged 1 commit into from
Nov 7, 2016

Conversation

musm
Copy link
Collaborator

@musm musm commented Nov 6, 2016

For one this can be useful for debugging.

Also trim leading whitespaces.

@musm
Copy link
Collaborator Author

musm commented Nov 7, 2016

The two added functions are named
show_msession
hide_msession

I'm open to other suggestions

Copy link
Contributor

@yuyichao yuyichao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM with?w=0.

@@ -59,7 +59,7 @@ function close(session::MSession)
# Close a MATLAB Engine session
@assert libeng::Ptr{Void} != C_NULL
ret = ccall(engfunc(:engClose), Cint, (Ptr{Void},), session)
ret != 0 && throw(MEngineError("Failed to close a MATLAB engine session (err = $r)"))
ret != 0 && throw(MEngineError("failed to close a MATLAB engine session (err = $ret)"))
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note the extra space before ).

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks for the review. Not sure where this extra space is? I double checked but I don't see any.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

engfunc(:engSetVisible ) below. Apparently @github puts the comment on the wrong line if it was made with whitespace changes removed. You can see it at the right line with https://github.com/JuliaInterop/MATLAB.jl/pull/79/files?w=0 .

Copy link
Collaborator Author

@musm musm Nov 7, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks again, fixed.

@ChrisRackauckas ChrisRackauckas merged commit 36fc4b3 into JuliaInterop:master Nov 7, 2016
@musm musm deleted the hideopt branch November 7, 2016 16:43
@musm
Copy link
Collaborator Author

musm commented Nov 7, 2016

The only problematic issue here is if the user closes the matlab engine window. Because then the pointer to the engine is still attached to a session that does not exist. I'm not sure what the best way to prevent such an occurrence.

ChrisRackauckas added a commit that referenced this pull request Dec 14, 2016
Put a little section in the README for #79
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants