{"id":22591980,"url":"https://github.com/ttytm/osdialog-odin","last_synced_at":"2025-04-10T23:23:47.058Z","repository":{"id":263459926,"uuid":"876446824","full_name":"ttytm/osdialog-odin","owner":"ttytm","description":"Cross-platform utility module for Odin to open native dialogs for the filesystem, message boxes, color-picking.","archived":false,"fork":false,"pushed_at":"2024-12-19T17:04:37.000Z","size":12,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-06T06:02:11.630Z","etag":null,"topics":["bindings","cross-platform","dialog","filesys","linux","macos","native","osx","windows","wrapper-library"],"latest_commit_sha":null,"homepage":"","language":"Odin","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-2-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ttytm.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-10-22T01:36:29.000Z","updated_at":"2025-03-23T23:02:09.000Z","dependencies_parsed_at":"2024-11-18T17:56:40.280Z","dependency_job_id":"4c4ec46b-a3c9-4c80-b3b9-37f74019a61f","html_url":"https://github.com/ttytm/osdialog-odin","commit_stats":null,"previous_names":["ttytm/osdialog-odin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttytm%2Fosdialog-odin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttytm%2Fosdialog-odin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttytm%2Fosdialog-odin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ttytm%2Fosdialog-odin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ttytm","download_url":"https://codeload.github.com/ttytm/osdialog-odin/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248313334,"owners_count":21082843,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","cross-platform","dialog","filesys","linux","macos","native","osx","windows","wrapper-library"],"created_at":"2024-12-08T09:14:46.907Z","updated_at":"2025-04-10T23:23:47.048Z","avatar_url":"https://github.com/ttytm.png","language":"Odin","funding_links":[],"categories":[],"sub_categories":[],"readme":"# osdialog-odin\n\n[badge__build-status]: https://img.shields.io/github/actions/workflow/status/ttytm/osdialog-odin/ci.yml?branch=main\u0026logo=github\u0026logoColor=C0CAF5\u0026labelColor=333\n[badge__version-lib]: https://img.shields.io/github/v/tag/ttytm/osdialog-odin?logo=task\u0026logoColor=C0CAF5\u0026labelColor=333\u0026color=\n\n[![][badge__build-status]](https://github.com/ttytm/osdialog-odin/actions?query=branch%3Amain)\n[![][badge__version-lib]](https://github.com/ttytm/osdialog-odin/releases/latest)\n\nCross-platform utility library for Odin to open native dialogs for the filesystem, message boxes, color-picking.\n\n## Quickstart\n\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Example](#example)\n- [Credits](#credits)\n\n## Showcase\n\n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eLinux\u003c/th\u003e\n    \u003cth\u003eWindows\u003c/th\u003e\n    \u003cth\u003emacOS\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"Linux File Dialog\" src=\"https://github.com/ttytm/dialog/assets/34311583/6ba6e96b-3581-4382-8074-79918a99dcbd\"\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"Windows File Dialog\" src=\"https://github.com/ttytm/dialog/assets/34311583/911e8c71-0cc1-4426-a62c-04714b6b071f\"\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"macOS File Dialog\" src=\"https://github.com/ttytm/dialog/assets/34311583/f7c4375e-d2e4-4121-ad34-db0473d8fabe\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003cdetails\u003e\n\u003csummary\u003e\u003cb\u003eMore Examples\u003c/b\u003e \u003csub\u003e\u003csup\u003eToggle visibility...\u003c/sup\u003e\u003c/sub\u003e\u003c/summary\u003e\u003cbr\u003e\n\n\u003ctable align=\"center\"\u003e\n  \u003ctr\u003e\n    \u003cth\u003eLinux\u003c/th\u003e\n    \u003cth\u003eWindows\u003c/th\u003e\n    \u003cth\u003emacOS\u003c/th\u003e\n  \u003c/tr\u003e\n  \u003ctr\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"Linux Color Picker GTK3\" src=\"https://github.com/ttytm/dialog/assets/34311583/8e587c8c-2f12-41ee-9a10-4c3f92e72885\"\u003e\n      \u003cimg alt=\"Linux Message\" src=\"https://github.com/ttytm/dialog/assets/34311583/42e1081b-ee52-4286-abfd-ad9eda63d282\"\u003e\n      \u003cimg alt=\"Linux Message with Yes and No Buttons\" src=\"https://github.com/ttytm/dialog/assets/34311583/07aa26bd-f887-417b-9c1a-56724ceb2589\"\u003e\n      \u003cimg alt=\"Linux Input Prompt\" src=\"https://github.com/ttytm/dialog/assets/34311583/bc5e3ec1-88b5-4e1a-b46e-381b322b8a6c\"\u003e\n      \u003cimg alt=\"Linux Color Picker GTK2\" src=\"https://github.com/ttytm/dialog/assets/34311583/37619ed0-8fe2-4e5c-af11-70d7f2304b2b\"\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"Windows Color Picker\" src=\"https://github.com/ttytm/dialog/assets/34311583/966b1395-55ac-45b8-aa1b-516f673b64e8\"\u003e\n      \u003cimg alt=\"Windows Message\" src=\"https://github.com/ttytm/dialog/assets/34311583/a73e0eaf-e56b-44e6-bcc5-31bb381c6e37\"\u003e\n      \u003cimg alt=\"Windows Message with Yes and No Buttons\" src=\"https://github.com/ttytm/dialog/assets/34311583/16a1ad65-571e-4183-8c0b-119cbf126aec\"\u003e\n      \u003cimg alt=\"Windows Input Prompt\" src=\"https://github.com/ttytm/dialog/assets/34311583/54e4a708-de38-44ea-ae61-be39c1bdbff9\"\u003e\n    \u003c/td\u003e\n    \u003ctd width=\"400\"\u003e\n      \u003cimg alt=\"macOS Color Picker\" src=\"https://github.com/user-attachments/assets/551ac8d6-406d-4b01-9095-d0a357cc8250\"\u003e\n      \u003c!-- \u003cimg alt=\"macOS Message\" src=\"https://github.com/ttytm/dialog/assets/34311583/15920c46-e529-405f-9731-3ac57ce46449\"\u003e --\u003e\n      \u003cimg alt=\"macOS Message with Yes and No Buttons\" src=\"https://github.com/ttytm/dialog/assets/34311583/11cba10b-3190-4114-b1ad-e49e56d4498c\"\u003e\n      \u003cimg alt=\"macOS Input Prompt\" src=\"https://github.com/ttytm/dialog/assets/34311583/e6d496b4-3c20-4ece-8808-0eba99a59a45\"\u003e\n    \u003c/td\u003e\n  \u003c/tr\u003e\n\u003c/table\u003e\n\n\u003c/details\u003e\n\n## Installation\n\n1. Add it as a submodule to your Odin Git project\n\n   ```sh\n   # \u003cprojects-path\u003e/your-awesome-odin-project\n   git submodule add https://github.com/ttytm/osdialog-odin.git osdialog\n   ```\n\n2. Prepare the C Binding\n\n   _Unix-like_\n\n   ```sh\n   cd osdialog \u0026\u0026 make \u0026\u0026 cd -\n   ```\n\n   _Windows_\n\n   ```sh\n   cd osdialog\n   nmake\n   cd ..\n   ```\n\n## Usage\n\nRef.: [`osdialog-odin/osdialog.odin`](https://github.com/ttytm/osdialog-odin/blob/main/osdialog.odin)\n\n```odin\n// Opens a message box and returns `true` if \"OK\" or \"Yes\" was pressed.\nmessage :: proc(message: string, level: MessageLevel = .Info, buttons: MessageButtons = .Ok) -\u003e bool\n\n// Opens an input prompt with an \"OK\" and \"Cancel\" button and returns the entered text and `true`,\n// or `false` if the dialog was cancelled. `text` optionally sets the initial content of the input box.\nprompt :: proc(message: string, text: string = \"\", level: MessageLevel = .Info) -\u003e (string, bool) #optional_ok\n\n// Opens a file dialog and returns the selected path and `true` or `false` if the selection was canceled.\npath :: proc(action: PathAction, path: string = \"\", filename: string = \"\") -\u003e (string, bool) #optional_ok\n\n// Opens an RGBA color picker and returns the selected `Color` and `true`, or `false` if the selection was canceled.\n// Optionally, it takes a `color` and `opacity` argument. `color` sets the dialogs initial color. `opacity` can be\n// set to `false` to disable the opacity slider on unix-like systems. It has no effect on Windows.\ncolor :: proc(color: Color = {255, 255, 255, 255}, opacity: bool = true) -\u003e (Color, bool) #optional_ok\n```\n\n### Example\n\nRef.: [`osdialog-odin/examples/main.odin`](https://github.com/ttytm/osdialog-odin/blob/main/examples/main.odin)\n\n```odin\npackage main\n\nimport osd \"osdialog\"\nimport \"core:fmt\"\n\nmain :: proc() {\n\tosd.message(\"Hello, World!\")\n\n\tinput := osd.prompt(\"Give me some input\")\n\tfmt.println(\"Input:\", input)\n\n\tif color, ok := osd.color(); ok {\n\t\tfmt.println(\"Selected color\", color)\n\t}\n\n\tif path, ok := osd.path(.Open); ok {\n\t\tfmt.println(\"Selected file:\", path)\n\t}\n\n\tif path, ok := osd.path(.Open_Dir); ok {\n\t\tfmt.println(\"Selected dir\", path)\n\t}\n\n\tif path, ok := osd.path(.Save); ok {\n\t\tfmt.println(\"Selected save path\", path)\n\t}\n}\n```\n\nFor a simple local run:\n\n_Unix-like_\n\nOne-shot copy pasta to perform a lighter, filtered development clone and build the C binding target.\n\n```sh\ngit clone --recursive --filter=blob:none --also-filter-submodules \\\n  https://github.com/ttytm/osdialog-odin \\\n  \u0026\u0026 cd osdialog-odin \u0026\u0026 make\n```\n\n_Windows_\n\n```sh\ngit clone --recursive --filter=blob:none --also-filter-submodules https://github.com/ttytm/osdialog-odin\n```\n\n```sh\ncd osdialog-odin\nnmake\n```\n\nRun the example\n\n```sh\nodin run examples/main.odin -file\n```\n\n## Credits\n\n- [AndrewBelt/osdialog](https://github.com/AndrewBelt/osdialog) - The C project this library is leveraging\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttytm%2Fosdialog-odin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fttytm%2Fosdialog-odin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fttytm%2Fosdialog-odin/lists"}