Closed 1sra3l closed 3 years ago
Hi I think it's fixed now if you can try the latest version. Unfortunately menus (and menu items) don't map particularly well from C++ to Rust. FLTK's C++ uses a menu array with null termination for submenus and the menu itself, this isn't exposed on the Rust side, and would be difficult to expose anyway. So on the Rust side, the ::add constructor is used.
So this happens using &File
now :smile_cat:
I think it is something in the formatting output??? The sub menus are not effected by it.
The important thing is that it compiles now!!!
Which meant I could delete my hacky code, and put it into the fl file, where other people would think it is!
So almost closed?
Oh yeah, the way I expose the menu to myself is
// menu item number 1
let mut m = match menu.at(1){
Some(m) => m,
None => return,
};
m.emit(send_action, Action::whatever);
The reason I am saying this, is that from the API user side, you have mapped things well. It may not be bit for bit, but you've made FLTK much more fun to use in Rust. I am interested to see what this will be like with the 1.4.X branch, when that day comes. That may be a game changer for many people, with the backened renderer setup changing.
That's great to hear :) Thank you
btw I've published version 0.4.9 with the fix for the brackets.
Thanks! That did it!
The issue is when adding Keyboard Shortcuts for a menu item via FLUID's widget browser, then running fl2rust.
I know I can simply build the menu programmatically, but I do like having all the menu items in the FLUID file for others to see it easily.
Thanks again for all your work