{"action":"created","issue":{"url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/54","repository_url":"https://api.github.com/repos/LeoTindall/libui-rs","labels_url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/54/labels{/name}","comments_url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/54/comments","events_url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/54/events","html_url":"https://github.com/LeoTindall/libui-rs/issues/54","id":392004943,"node_id":"MDU6SXNzdWUzOTIwMDQ5NDM=","number":54,"title":"Creating controls is unsound","user":{"login":"LeoTindall","id":3290365,"node_id":"MDQ6VXNlcjMyOTAzNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/3290365?v=4","gravatar_id":"","url":"https://api.github.com/users/LeoTindall","html_url":"https://github.com/LeoTindall","followers_url":"https://api.github.com/users/LeoTindall/followers","following_url":"https://api.github.com/users/LeoTindall/following{/other_user}","gists_url":"https://api.github.com/users/LeoTindall/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoTindall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoTindall/subscriptions","organizations_url":"https://api.github.com/users/LeoTindall/orgs","repos_url":"https://api.github.com/users/LeoTindall/repos","events_url":"https://api.github.com/users/LeoTindall/events{/privacy}","received_events_url":"https://api.github.com/users/LeoTindall/received_events","type":"User","site_admin":false},"labels":[{"id":799946135,"node_id":"MDU6TGFiZWw3OTk5NDYxMzU=","url":"https://api.github.com/repos/LeoTindall/libui-rs/labels/c-bug","name":"c-bug","color":"d93f0b","default":false},{"id":875413974,"node_id":"MDU6TGFiZWw4NzU0MTM5NzQ=","url":"https://api.github.com/repos/LeoTindall/libui-rs/labels/p-high","name":"p-high","color":"b60205","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2018-12-18T05:42:24Z","updated_at":"2018-12-23T04:34:26Z","closed_at":null,"author_association":"OWNER","body":"Creating controls is unsound at the moment. libui enforces a tree structure. We should enforce it in the API.\r\n\r\nI would like to do this by creating a trait which permits adding a control, and implementing it on all containers (like windows and grids and boxes).\r\n\r\nThe question is, should we have individual methods for each control:\r\n\r\n```rust\r\nlet btn: &mut Button = window.add_button(\"Button text!\");\r\n```\r\n\r\nor should we have an enum with all the controls?\r\n\r\n```rust\r\nlet btn: &mut Button = window.add(Controls::Button(\"Button text!\"));\r\n```"},"comment":{"url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/comments/449613791","html_url":"https://github.com/LeoTindall/libui-rs/issues/54#issuecomment-449613791","issue_url":"https://api.github.com/repos/LeoTindall/libui-rs/issues/54","id":449613791,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0OTYxMzc5MQ==","user":{"login":"LeoTindall","id":3290365,"node_id":"MDQ6VXNlcjMyOTAzNjU=","avatar_url":"https://avatars0.githubusercontent.com/u/3290365?v=4","gravatar_id":"","url":"https://api.github.com/users/LeoTindall","html_url":"https://github.com/LeoTindall","followers_url":"https://api.github.com/users/LeoTindall/followers","following_url":"https://api.github.com/users/LeoTindall/following{/other_user}","gists_url":"https://api.github.com/users/LeoTindall/gists{/gist_id}","starred_url":"https://api.github.com/users/LeoTindall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LeoTindall/subscriptions","organizations_url":"https://api.github.com/users/LeoTindall/orgs","repos_url":"https://api.github.com/users/LeoTindall/repos","events_url":"https://api.github.com/users/LeoTindall/events{/privacy}","received_events_url":"https://api.github.com/users/LeoTindall/received_events","type":"User","site_admin":false},"created_at":"2018-12-23T04:34:26Z","updated_at":"2018-12-23T04:34:26Z","author_association":"OWNER","body":"When you make a control, if you don't add as a node in a tree whose root is ultimately a Window or other appropriate control, the process will abort without unwinding, which is (afaik) not sound."}}
{"actor":{"display_login":"LeoTindall"}}