{"action":"created","issue":{"url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/313","repository_url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI","labels_url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/313/labels{/name}","comments_url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/313/comments","events_url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/313/events","html_url":"https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/313","id":362941062,"node_id":"MDU6SXNzdWUzNjI5NDEwNjI=","number":313,"title":"Find and Update multiple elements at a time","user":{"login":"Otherion","id":40878732,"node_id":"MDQ6VXNlcjQwODc4NzMy","avatar_url":"https://avatars3.githubusercontent.com/u/40878732?v=4","gravatar_id":"","url":"https://api.github.com/users/Otherion","html_url":"https://github.com/Otherion","followers_url":"https://api.github.com/users/Otherion/followers","following_url":"https://api.github.com/users/Otherion/following{/other_user}","gists_url":"https://api.github.com/users/Otherion/gists{/gist_id}","starred_url":"https://api.github.com/users/Otherion/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Otherion/subscriptions","organizations_url":"https://api.github.com/users/Otherion/orgs","repos_url":"https://api.github.com/users/Otherion/repos","events_url":"https://api.github.com/users/Otherion/events{/privacy}","received_events_url":"https://api.github.com/users/Otherion/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-23T13:05:38Z","updated_at":"2018-09-23T15:03:09Z","closed_at":null,"author_association":"NONE","body":"I feel like there should be a way to find and update multiple elements at once instead of one by one. Something like a \"form.FindElements()\" and you put each key you want to find possibly as a list of keys so like \"form.FindElements(['key1', 'key2', 'key3'])\". \r\nIf you want to update each of those elements, you could call Update() or change it to something like MultiUpdate() and give it a list of values to update the same length as the list of keys. \r\nFor example, if you want to update three different elements, you could do something like \"form.FindElements(['key1', 'key2', 'key3']).MultiUpdate(disabled=[True,False,False])\" and have it all in one line instead of three. It just seems like a good way to slim down code such as in your \"Demo_Disable_Elements.py\" in which a large chunk of code is just enabling and disabling elements."},"comment":{"url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/comments/423822906","html_url":"https://github.com/MikeTheWatchGuy/PySimpleGUI/issues/313#issuecomment-423822906","issue_url":"https://api.github.com/repos/MikeTheWatchGuy/PySimpleGUI/issues/313","id":423822906,"node_id":"MDEyOklzc3VlQ29tbWVudDQyMzgyMjkwNg==","user":{"login":"MikeTheWatchGuy","id":13696193,"node_id":"MDQ6VXNlcjEzNjk2MTkz","avatar_url":"https://avatars1.githubusercontent.com/u/13696193?v=4","gravatar_id":"","url":"https://api.github.com/users/MikeTheWatchGuy","html_url":"https://github.com/MikeTheWatchGuy","followers_url":"https://api.github.com/users/MikeTheWatchGuy/followers","following_url":"https://api.github.com/users/MikeTheWatchGuy/following{/other_user}","gists_url":"https://api.github.com/users/MikeTheWatchGuy/gists{/gist_id}","starred_url":"https://api.github.com/users/MikeTheWatchGuy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/MikeTheWatchGuy/subscriptions","organizations_url":"https://api.github.com/users/MikeTheWatchGuy/orgs","repos_url":"https://api.github.com/users/MikeTheWatchGuy/repos","events_url":"https://api.github.com/users/MikeTheWatchGuy/events{/privacy}","received_events_url":"https://api.github.com/users/MikeTheWatchGuy/received_events","type":"User","site_admin":false},"created_at":"2018-09-23T15:03:09Z","updated_at":"2018-09-23T15:03:09Z","author_association":"OWNER","body":"I like this idea.\r\n\r\nIf it compacts code in a way that fits with the rest of the SDK, I'm interested.\r\n\r\nYou're correct that Demo_Disable_Elements has a lot of code dealing with enabling/disabling.  It comes to 41% of the code to be exact.  That kind of number can't be ignored.   Part of those would be removed if this multi-update existed.  Another group of calls would be removed is the Elements all had a `disabled` parameter that could be set when creating the element.\r\n\r\nI like the use of \"chained function calls\" too that you suggested (I think this is the correct term).  Those compact the code in a Pythonic-way.  I'm in the process of changing all of the Demos to use the new design pattern `form = sg.FlexForm('').Layout(layout)`.  The Cookbook has already be changed to reflect this format.\r\n\r\n"}}
{"actor":{"display_login":"MikeTheWatchGuy"}}