Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to set out property struct as text input in slint to rust #5014

Closed
MohaBeacon opened this issue Apr 4, 2024 · 0 comments
Closed

How to set out property struct as text input in slint to rust #5014

MohaBeacon opened this issue Apr 4, 2024 · 0 comments

Comments

@MohaBeacon
Copy link

MohaBeacon commented Apr 4, 2024

import { Button, VerticalBox, TextEdit } from "std-widgets.slint";

export struct Userdetails {
    name:string,
    pass:string
    
}

export component AppWindow inherits Window {
    in-out property<int> counter: 42;
    in-out property <Userdetails> userdetails;

    callback request-increase-value();
    VerticalBox {
        Text {
            text: "Username";
        }
        TextInput {
            input-type: text;
            edited(value) => {self.text  = root.userdetails.name};
        }
        Text{
            text: "Password";
        }
        TextInput {
            input-type: password;
            text : "\{userdetails.pass}";
        }
        Button {
            text: "Increase value";
            clicked => {
                root.request-increase-value();
            }
        }
    }
}
@slint-ui slint-ui locked and limited conversation to collaborators Apr 4, 2024
@ogoffart ogoffart converted this issue into discussion #5015 Apr 4, 2024

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant