andlabs / andlabs/libui

uiLinkLabel Control

Offen
#363 10 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
C
Sterne
10.9k
Forks
612
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

Currently there is no support for this, but it would be beneficial as a basic control. It would allow to get and set the text, as well as support an event which would happen when the user clicks the uiLinkLabel.

Some form of public API could look like this:

```c
typedef struct uiLinkLabel uiLinkLabel;
#define uiLinkLabel(this) ((uiLinkLabel *) (this))
_UI_EXTERN char *uiLinkLabelText(uiLinkLabel *l);
_UI_EXTERN void uiLinkLabelSetText(uiLinkLabel *l, const char *text);
_UI_EXTERN void uiLinkLabelOnClicked(uiLinkLabel *l, void (*f)(uiLinkLabel *l, void *data), void *data);
_UI_EXTERN uiLinkLabel *uiNewLinkLabel(const char *text);
```

This would allow for the developer to have a choice of a uiButton, or a uiLinkLabel to convey text that is linked to a clickable event.

I know that there is a LinkLabel control on Windows, but I'm not sure how this would be done using Cocoa or GTK.

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.