Skip to content

Missing explenation in subclassing #1980

@jakubGodula

Description

@jakubGodula

Section 5.2 Subclassing does not mention adding the following code in mod.rs.

impl Default for CustomButton {
    fn default() -> Self {
        Self::new()
    }
}

The first part works well without it, but it is required by Adding functionality part.
I know that it is not GTK-related and that it is common knowledge among programmers that it is required, but I am sure that mentioning it will make it easier for newcomers to follow along with this book.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions