Closed sanpii closed 6 years ago
I'm not sure what you're asking about? Can you please show me a code example what what you want and isn't working?
Of, course. Here a patch for examples/buttons-derive/src/main.rs
:
diff --git i/examples/buttons-derive/src/main.rs w/examples/buttons-derive/src/main.rs
index e5ef6f7..b918d3b 100644
--- i/examples/buttons-derive/src/main.rs
+++ w/examples/buttons-derive/src/main.rs
@@ -33,7 +33,6 @@ use gtk::{
WidgetExt,
};
use gtk::Orientation::Vertical;
-use relm::Widget;
pub struct Model {
counter: i32,
@@ -48,7 +47,7 @@ pub enum Msg {
// An alternative to the #[widget] attribute which works on stable.
relm_widget! {
- impl Widget for Win {
+ impl ::relm::Widget for Win {
// The initial model.
fn model() -> Model {
Model {
And the compilation error:
error: no rules expected the token `::`
--> src/main.rs:50:10
|
50 | impl ::relm::Widget for Win {
| ^^
This is necessary when you called your widget
Widget
.I tried to allow any type, but rustc isn’t aggree with my idea. Maybe my low experience with macro is the raison. At least it’s could be great to write the complete type name (
::relm::Widget
) in addition ofWidget
.