{"action":"created","issue":{"url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/454","labels_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/454/labels{/name}","comments_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/454/comments","events_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/454/events","html_url":"https://github.com/PistonDevelopers/conrod/pull/454","id":79333733,"number":454,"title":"[wip] auto uiid for ui","user":{"login":"viperscape","id":3178836,"avatar_url":"https://avatars.githubusercontent.com/u/3178836?v=3","gravatar_id":"","url":"https://api.github.com/users/viperscape","html_url":"https://github.com/viperscape","followers_url":"https://api.github.com/users/viperscape/followers","following_url":"https://api.github.com/users/viperscape/following{/other_user}","gists_url":"https://api.github.com/users/viperscape/gists{/gist_id}","starred_url":"https://api.github.com/users/viperscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viperscape/subscriptions","organizations_url":"https://api.github.com/users/viperscape/orgs","repos_url":"https://api.github.com/users/viperscape/repos","events_url":"https://api.github.com/users/viperscape/events{/privacy}","received_events_url":"https://api.github.com/users/viperscape/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":14,"created_at":"2015-05-22T07:34:35Z","updated_at":"2015-06-02T12:58:24Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/PistonDevelopers/conrod/pulls/454","html_url":"https://github.com/PistonDevelopers/conrod/pull/454","diff_url":"https://github.com/PistonDevelopers/conrod/pull/454.diff","patch_url":"https://github.com/PistonDevelopers/conrod/pull/454.patch"},"body":"This is a first attempt at a possible [auto uiid](https://github.com/PistonDevelopers/conrod/issues/40) for ui contexts. It's slightly heavy handed when it comes to use, see [tests](https://github.com/viperscape/conrod/blob/auto-uiid/tests/lib.rs#L72) for example. It would be better if widgets had a trait method like ```set``` called ```ifset``` that determines if ui contains said widget. ~~I didn't want to make any breaking changes, so I never implemented that.~~\r\n\r\nAdditionally, this mixes with manual widget ids to an extent-- but could be complete if instead of [only tracking](https://github.com/viperscape/conrod/blob/auto-uiid/src/ui.rs#L111) widget ids we checked widget_cache first for preexisting ids. That's more complicated because canvas and widget cache is separate.\r\n"},"comment":{"url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/comments/107945393","html_url":"https://github.com/PistonDevelopers/conrod/pull/454#issuecomment-107945393","issue_url":"https://api.github.com/repos/PistonDevelopers/conrod/issues/454","id":107945393,"user":{"login":"viperscape","id":3178836,"avatar_url":"https://avatars.githubusercontent.com/u/3178836?v=3","gravatar_id":"","url":"https://api.github.com/users/viperscape","html_url":"https://github.com/viperscape","followers_url":"https://api.github.com/users/viperscape/followers","following_url":"https://api.github.com/users/viperscape/following{/other_user}","gists_url":"https://api.github.com/users/viperscape/gists{/gist_id}","starred_url":"https://api.github.com/users/viperscape/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/viperscape/subscriptions","organizations_url":"https://api.github.com/users/viperscape/orgs","repos_url":"https://api.github.com/users/viperscape/repos","events_url":"https://api.github.com/users/viperscape/events{/privacy}","received_events_url":"https://api.github.com/users/viperscape/received_events","type":"User","site_admin":false},"created_at":"2015-06-02T12:58:24Z","updated_at":"2015-06-02T12:58:24Z","body":"These are good ideas. You're right, the use case is probably limited-- and since [mush](https://github.com/PistonDevelopers/mush) was using conrod I came in to this need. This is just one way to solve the problem, I think a range of IDs works better, and the random-seed for id generation is a neat idea too. Aside from graph libraries, I'm not sure how useful dynamic widget generation would be, perhaps basic 2d-games? Thanks for the feedback!"}}