{"id":30277174,"url":"https://github.com/ysdragon/dialog","last_synced_at":"2026-02-09T07:03:02.146Z","repository":{"id":307433472,"uuid":"1029482500","full_name":"ysdragon/dialog","owner":"ysdragon","description":"Ring bindings for osdialog, a cross-platform library for native OS dialogs","archived":false,"fork":false,"pushed_at":"2025-07-31T06:02:51.000Z","size":1109,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-31T08:40:29.763Z","etag":null,"topics":["dialog","gui","osdialog","ring-programming-language"],"latest_commit_sha":null,"homepage":"","language":"Ring","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ysdragon.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,"zenodo":null}},"created_at":"2025-07-31T05:48:59.000Z","updated_at":"2025-07-31T06:10:53.000Z","dependencies_parsed_at":"2025-07-31T08:55:52.183Z","dependency_job_id":null,"html_url":"https://github.com/ysdragon/dialog","commit_stats":null,"previous_names":["ysdragon/dialog"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ysdragon/dialog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fdialog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fdialog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fdialog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fdialog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ysdragon","download_url":"https://codeload.github.com/ysdragon/dialog/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ysdragon%2Fdialog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270702562,"owners_count":24630877,"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","status":"online","status_checked_at":"2025-08-16T02:00:11.002Z","response_time":91,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["dialog","gui","osdialog","ring-programming-language"],"created_at":"2025-08-16T11:14:13.638Z","updated_at":"2026-02-09T07:03:02.140Z","avatar_url":"https://github.com/ysdragon.png","language":"Ring","readme":"# RingDialog\n\nSimple Ring bindings for [osdialog](https://github.com/AndrewBelt/osdialog), a cross-platform library for native OS dialogs.\n\n### Installation\n\nThere are two primary ways to install RingDialog: using the Ring Package Manager (RingPM) or by building from source.\n\n#### 1. Using Ring Package Manager (Recommended)\n\nRingPM is the official package manager for the Ring programming language. It simplifies the process of installing and managing libraries.\n\n- **Install the library:**\n  ```sh\n  ringpm install dialog from ysdragon\n  ```\n\nThis command will automatically download and install the correct version of the library for your system.\n\n#### 2. Building from Source\n\nIf you prefer to build the library manually or want to contribute to its development, please see the [Development](#development) section for detailed instructions.\n\n## Usage\n\nFirst, load the library in your Ring script:\n\n```ring\nload \"dialog.ring\"\n```\n\n### Message Dialog\n\nDisplay a simple message box.\n\n```ring\ndialog_message(DIALOG_INFO, DIALOG_OK, \"Hello, World!\")\n```\n\n**Function:** `dialog_message(level, buttons, message)`\n\n-   `level`: The message level (e.g., `DIALOG_INFO`, `DIALOG_WARNING`, `DIALOG_ERROR`).\n-   `buttons`: The button set (e.g., `DIALOG_OK`, `DIALOG_OK_CANCEL`, `DIALOG_YES_NO`).\n-   `message`: The text to display in the dialog.\n\nReturns `1` for OK/Yes, `0` for Cancel/No.\n\n### Prompt Dialog\n\nAsk the user for a text input.\n\n```ring\ntext = dialog_prompt(DIALOG_INFO, \"What is your name?\", \"Ring User\")\nsee \"User entered: \" + text + nl\n```\n\n**Function:** `dialog_prompt(level, message, default_text)`\n\n-   `level`: The message level.\n-   `message`: The prompt message.\n-   `default_text`: The initial text in the input field.\n\nReturns the entered string, or an empty string if cancelled.\n\n### File Dialog\n\nOpen a file-picker dialog.\n\n```ring\n// File open dialog\nfilters = \"Source:c,h;Image:jpg,png,gif;Text:txt\"\nfilepath = dialog_file(DIALOG_OPEN, \".\", \"\", filters)\nif len(filepath) \u003e 0\n    see \"Selected file: \" + filepath + nl\nok\n\n// Directory open dialog\ndirpath = dialog_file(DIALOG_OPEN_DIR, \".\", \"\", \"\")\nif len(dirpath) \u003e 0\n    see \"Selected directory: \" + dirpath + nl\nok\n```\n\n**Function:** `dialog_file(action, directory, filename, filters)`\n\n-   `action`: The dialog action (`DIALOG_OPEN`, `DIALOG_OPEN_DIR`, `DIALOG_SAVE`).\n-   `directory`: The initial directory.\n-   `filename`: The default filename.\n-   `filters`: A semicolon-separated list of file filters (e.g., `\"Source:c,h;Image:jpg,png\"`).\n\nReturns the selected file path, or an empty string if cancelled.\n\n### Color Picker\n\nOpen a color picker dialog.\n\n```ring\ncolor = [255, 0, 0, 255]  // [r, g, b, a]\nopacity = 1\n\nif dialog_color_picker(color, opacity)\n    see \"Selected color: \" + color[1] + \",\" + color[2] + \",\" + color[3] + \",\" + color[4] + nl\nelse\n    see \"Color selection cancelled.\" + nl\nok\n```\n\n**Function:** `dialog_color_picker(color_list, opacity)`\n\n-   `color_list`: A list of 4 numbers `[r, g, b, a]` representing the initial color. The list is updated with the selected color.\n-   `opacity`: A number from 0-1 to enable/disable opacity support.\n\nReturns `1` if a color is selected, `0` if cancelled.\n\n### Constants\n\n**Levels:**\n- `DIALOG_INFO`\n- `DIALOG_WARNING`\n- `DIALOG_ERROR`\n\n**Buttons:**\n- `DIALOG_OK`\n- `DIALOG_OK_CANCEL`\n- `DIALOG_YES_NO`\n\n**File Actions:**\n- `DIALOG_OPEN`\n- `DIALOG_OPEN_DIR`\n- `DIALOG_SAVE`\n\n## Development\n\nIf you want to contribute to the development of Ring Dialog or build it from source, follow these steps.\n\n### Prerequisites\n\n*   **CMake**: Version 3.16 or higher.\n*   **C Compiler**: A C compiler compatible with your platform (e.g., GCC, Clang, MSVC).\n*   **Ring**: You need to have the Ring language source code available on your machine.\n\n### Build Steps\n\n1.  **Clone the Repository**: Clone the Dialog repository to your local machine.\n\n    ```bash\n    git clone https://github.com/ysdragon/dialog.git --recursive\n    ```\n    \u003e **NOTE**: Skip this step if you have already installed the library using RingPM.\n\n2.  **Set the `RING` Environment Variable:** Before running CMake, you must set the `RING` environment variable to point to the root directory of the Ring language source code.\n    - Windows\n      - Command Prompt\n          ```cmd\n          set RING=X:\\path\\to\\ring\n          ```\n      - PowerShell\n          ```powershell\n          $env:RING = \"X:\\path\\to\\ring\"\n          ```\n\n    - Unix\n      ```bash\n      export RING=/path/to/ring\n      ```\n\n3.  **Configure with CMake**: Create a `build` directory and run CMake from within it.\n    ```bash\n    mkdir build\n    cd build\n    cmake ..\n    ```\n\n4.  **Build the Project**: Compile the source code using the build toolchain configured by CMake (e.g., Make, Ninja).\n    ```bash\n    cmake --build .\n    ```\nThe compiled library will be placed in the `lib/\u003cos\u003e/\u003carch\u003e` directory.\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysdragon%2Fdialog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fysdragon%2Fdialog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fysdragon%2Fdialog/lists"}