I have some problems with gtk-rs crate.
This is my first "serious" project with a GUI.
This is my program: main.rs\src - lcs.git -
The main problem is that I get a segmentation fault if i do the following:
Open a dialog
Close the dialog
Open the dialog again
Click anywhere in the opened dialog
On the third operation I can read these error messages in my terminal window:
First, sorry you've been running into problems. If you have issues like this, I'd recommend you try hopping on the Gitter for gtk-rs as you'll probably find better support than asking here.
As to your real issue, are you able to run any of the examples properly, like ones that end up utilizing similar functionality to what you're trying to replicate? I haven't used any of the Glade stuff with gtk-rs, but I've done dialogs and windows and not seen any problems. Is there anyway you could create a minimal test case and then post the code and a description of the issue to the gtk-rs bugtracker? That'd be the fastest way to resolve this probably.
I prefer the forum because if anyone else runs into the same problems he can find the solution.
If I try to compile it I get the following compilation errors:
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:151:9: 151:43 error: a type named `WindowHints` has already been imported in this module [E0252]
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:151 pub use ffi::GdkWindowHints as WindowHints;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24:9: 24:17 note: previous import of `WindowHints` here
/home/gianmarco/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24 pub use auto::*;
^~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:151:9: 151:43 help: run `rustc --explain E0252` to see a detailed explanation
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:136:9: 136:39 error: a type named `EventMask` has already been imported in this module [E0252]
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:136 pub use ffi::GdkEventMask as EventMask;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24:9: 24:17 note: previous import of `EventMask` here
/home/gianmarco/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24 pub use auto::*;
^~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:136:9: 136:39 help: run `rustc --explain E0252` to see a detailed explanation
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:134:9: 134:41 error: a type named `DragAction` has already been imported in this module [E0252]
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:134 pub use ffi::GdkDragAction as DragAction;
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24:9: 24:17 note: previous import of `DragAction` here
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:24 pub use auto::*;
^~~~~~~~
/.cargo/registry/src/github.com-1ecc6299db9ec823/gdk-0.5.2/src/lib.rs:134:9: 134:41 help: run `rustc --explain E0252` to see a detailed explanation
One problem is that the close button is automatically connected with the destroy() method, so I think that this could be a bug.
On the other hand, if the dialog is like the "about" it's ok hiding and showing it, because it's always the same, but if it's an interactive dialog I need to clean up all in order to show a clean dialog, so I would prefer destroying it and creating a new one.
The compilation errors were due to the old version of the rust compiler I was using. Anyway the segmentation fault problem remains if I destroy the dialogs.