Skip to content
This repository was archived by the owner on Dec 25, 2024. It is now read-only.

Add menu support #87

Merged
merged 3 commits into from
Jun 24, 2015
Merged

Add menu support #87

merged 3 commits into from
Jun 24, 2015

Conversation

tsurai
Copy link
Contributor

@tsurai tsurai commented Jun 20, 2015

This pull request adds menu support as an optional feature to the crate.

I meant to add this feature for a while but couldn't because it wasn't possible to allocate a C string in Rust and transfer ownership to C without leaking. This feature has been finally added to rust recently.

It has only been added to nightly and NOT yet to rust stable.

@jeaye
Copy link
Owner

jeaye commented Jun 20, 2015

  1. It'd be great to get an example added, showing how this can be used
  2. I'm interested in what other ncurses-rs users have to say about the addition

Thanks for this PR. I'm looking forward to seeing it merged.

@tsurai
Copy link
Contributor Author

tsurai commented Jun 20, 2015

  1. I've added an example very similar to the ones in the official documentation. The README says that the difficulty of the example increases with the number which is why I'm not sure where to put it but you can do it as you please.
  2. I can't speak for the rest of the ncurses-rs users but personally I think that it just makes sense to add the menu library functions because it's a part of ncurses and gets shipped with it. Just like the panel library which has already been added.
    But other users may have a different opinion

@jeaye
Copy link
Owner

jeaye commented Jun 23, 2015

Will you add this as the new 5 in the README and shift the existing on to 6?

I certainly think this is a good change, but the only last obstacle is how much we want support for Rust stable, especially considering that there is a stable Rust now.

@tsurai
Copy link
Contributor Author

tsurai commented Jun 24, 2015

I tried to get it to work with Rust stable for days and had to find out that it's unfortunately not possible right now.

All menu library functions are behind a feature gate meaning that ncurses-rs as it is right now still compiles with Rust stable and won't break for anyone. It's like an opt-in extra feature for those using rust nightly.

But if you really don't want any unstable code in ncurses-rs you may also wait until the CString reform lands in Rust stable.

jeaye added a commit that referenced this pull request Jun 24, 2015
@jeaye jeaye merged commit 1c09de2 into jeaye:master Jun 24, 2015
@jeaye
Copy link
Owner

jeaye commented Jun 24, 2015

It's gated off and compiles with stable, and I think it's a great addition, so I've merged it in. Thanks so much for your wok on this.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants