Skip to content

docs: standardize and expand documentation for all widgets with constructors, methods, and examples.#14

Merged
developersharif merged 1 commit into
mainfrom
docv1.5
Mar 30, 2026
Merged

docs: standardize and expand documentation for all widgets with constructors, methods, and examples.#14
developersharif merged 1 commit into
mainfrom
docv1.5

Conversation

@developersharif

Copy link
Copy Markdown
Owner

No description provided.

@developersharif
developersharif merged commit 372d781 into main Mar 30, 2026
3 checks passed

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request significantly expands the documentation for the php-gui library, providing detailed guides for all widgets including constructors, configuration options, code examples, and method references. It also introduces a 'Common Behaviours' page to centralize information on layout managers and shared styling. The review feedback identifies critical issues where the documentation describes functionality that is currently broken in the underlying PHP implementation, specifically regarding space-separated values in Comboboxes and text handling in Canvas drawings. Additionally, a correction was provided to remove an incorrect reference to a 'command' option in the Input widget documentation.

Comment thread docs/Combobox.md

| Key | Type | Description |
|----------|----------|--------------------------------------------------------------------------------------|
| `values` | `string` | **Space-separated** list of items shown in the dropdown. Defaults to `''` (empty). |

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

The documentation for the values option (here and in the 'Notes' section on line 62) is misleading. It states that a space-separated string will create multiple items, but the current implementation in Combobox.php will treat the entire string as a single item. This is due to incorrect quoting in the Tcl command (-values {{$values}} instead of -values {$values}).

As a result, the widget does not function as described for its primary use case. For this documentation to be accurate, the underlying code in Combobox.php must be fixed.

Comment thread docs/Canvas.md

### Notes

- `drawText()` uses `-text {text}` so the text string is passed as a Tk list element — it can contain spaces.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

This note is incorrect. It claims that drawText() handles spaces because the text is passed as a Tk list element. However, the implementation in Canvas.php (... -text {$text} ...) does not quote the text, which will cause an error if the text contains spaces.

For the documentation to be correct, the implementation needs to be changed to properly quote the text for Tcl, for example: ... -text {{$text}} .... As it is, this part of the documentation describes a feature that is broken.

Comment thread docs/Input.md
| `font` | `string` | Font string, e.g. `'Arial 14'`. |
| `show` | `string` | If set to `'*'`, masks characters (useful for password fields). |

Any option other than `text` and `command` is forwarded as a Tk `-key "value"` pair to the underlying `entry` command.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

The Input widget does not handle a command option; it uses the onEnter() method for event handling. This sentence seems to be a leftover from another widget's documentation and could be confusing. Please remove the reference to command.

Suggested change
Any option other than `text` and `command` is forwarded as a Tk `-key "value"` pair to the underlying `entry` command.
Any option other than `text` is forwarded as a Tk `-key "value"` pair to the underlying `entry` command.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant