Title: Allow passing parameters to form constructors · Issue #54 · ProgramMax/maxGUI · GitHub
Open Graph Title: Allow passing parameters to form constructors · Issue #54 · ProgramMax/maxGUI
X Title: Allow passing parameters to form constructors · Issue #54 · ProgramMax/maxGUI
Description: Is your feature request related to a problem? Please describe. A few times now, I have wanted to pass parameters into a form's constructor. An example of this might be a settings form which should by default display the current settings....
Open Graph Description: Is your feature request related to a problem? Please describe. A few times now, I have wanted to pass parameters into a form's constructor. An example of this might be a settings form which should ...
X Description: Is your feature request related to a problem? Please describe. A few times now, I have wanted to pass parameters into a form's constructor. An example of this might be a settings form which sho...
Opengraph URL: https://github.com/ProgramMax/maxGUI/issues/54
X: @github
Domain: patch-diff.githubusercontent.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Allow passing parameters to form constructors","articleBody":"**Is your feature request related to a problem? Please describe.**\r\nA few times now, I have wanted to pass parameters into a form's constructor.\r\nAn example of this might be a settings form which should by default display the current settings.\r\nAnother example might be a file/buffer to display.\r\n\r\n**Describe the solution you'd like**\r\nI would like a method of passing parameters to the form's constructor.\r\nThis isn't as simple as just that because it gets routed through several components.\r\nThe construction happens in the allocator, which happens inside the platform's form creation callback, which is triggered by the form factory.\r\n\r\nWe could use a template parameter pack. It will get a tad hairy because each parameter needs to be stored so it can survive through the callbacks. It might be better to just have a void* or type erased *.\r\n\r\n**Describe alternatives you've considered**\r\nRather than constructor parameters, these could also be parameters to OnCreated().\r\nIt isn't clear to me which option is better.\r\nA constructor likely stores the values for later use, such as creating the child controls. In this case, maybe it would be better to pass them during OnCreated() so they don't need to be stored after they are needed.\r\nAlternatively, maybe the values are indeed stored and used beyond OnCreated(), in which case they'll hold garbage values prior to OnCreated() which could lead to bugs.\r\n\r\nGiven the OnCreate() acts sort of like Init() anyway, I think the constructor idea is already circumvented.\r\nMaybe that is the thing that should change? Or maybe there should be a factory function rather than a constructor/OnCreated().\r\n\r\nThe problem is inherently a multi-staged construction since the platform decides when the actual form is created.","author":{"url":"https://github.com/ProgramMax","@type":"Person","name":"ProgramMax"},"datePublished":"2022-10-16T02:50:17.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/54/maxGUI/issues/54"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8d785fd5-ed40-e01f-288b-471f33355eed |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | A326:1DFAA9:1660861:1CBEFC5:697449C4 |
| html-safe-nonce | a1ab34e759af1962cfe56badb500b9d1209e6ba23406996d8abe773e0445d1ef |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBMzI2OjFERkFBOToxNjYwODYxOjFDQkVGQzU6Njk3NDQ5QzQiLCJ2aXNpdG9yX2lkIjoiNDI1NTUwMjc4ODkwNjQ2OTgyOCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | a7532a23c4ca5a10233727f9a5c942b3d371b35bd17c71d512049c9b72bfe330 |
| hovercard-subject-tag | issue:1410353471 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/ProgramMax/maxGUI/54/issue_layout |
| twitter:image | https://opengraph.githubassets.com/5188c9f6eb75254de76c921a3f319e5cf13003e39fbe063727508079ae3be0c3/ProgramMax/maxGUI/issues/54 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/5188c9f6eb75254de76c921a3f319e5cf13003e39fbe063727508079ae3be0c3/ProgramMax/maxGUI/issues/54 |
| og:image:alt | Is your feature request related to a problem? Please describe. A few times now, I have wanted to pass parameters into a form's constructor. An example of this might be a settings form which should ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | ProgramMax |
| hostname | github.com |
| expected-hostname | github.com |
| None | e0b95d743b7672c9ac0e1032d5f117950182dc164a83434a7db86510e8f0b37c |
| turbo-cache-control | no-preview |
| go-import | github.com/ProgramMax/maxGUI git https://github.com/ProgramMax/maxGUI.git |
| octolytics-dimension-user_id | 975115 |
| octolytics-dimension-user_login | ProgramMax |
| octolytics-dimension-repository_id | 280728790 |
| octolytics-dimension-repository_nwo | ProgramMax/maxGUI |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 280728790 |
| octolytics-dimension-repository_network_root_nwo | ProgramMax/maxGUI |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 56fe7e2e8de6e57740bca50402351ea656f7a4bf |
| ui-target | canary-2 |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width