-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5de2b1b
commit 8173bf8
Showing
26 changed files
with
154 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
##Label | ||
--- | ||
*Labels* are used for displaying text in the GUI. | ||
|
||
* They are great for titles, at the top of the GUI, usually spanning multiple columns. | ||
* They are really useful before *Entries* and *Drop-downs* to explain their purpose. | ||
* And, they're very helpful at the bottom of the GUI, to show the results of an action. | ||
![Label](../img/1_labels.gif) | ||
```python | ||
from appJar import gui | ||
|
||
app = gui() | ||
|
||
app.addLabel("l1", "Label 1") | ||
app.addLabel("l2", "Label 2") | ||
app.addLabel("l3", "Label 3") | ||
app.addLabel("l4", "Label 4") | ||
# common set functions | ||
app.setLabelBg("l1", "red") | ||
app.setLabelBg("l2", "yellow") | ||
app.setLabelBg("l3", "purple") | ||
app.setLabelBg("l4", "orange") | ||
|
||
app.go() | ||
``` | ||
|
||
####Add Labels | ||
* `.addLabel(title, text=None)` | ||
This will create a label widget to display text in the GUI. | ||
The `title` is used to uniquely identify the label, in case you want to change it later, and the `text` is what gets displayed. | ||
If `text` is set to None, or no `text` is provided, the `title` will be displayed in the label. | ||
|
||
* `.addEmptyLabel(title)` | ||
Does the same as add a *label*, except there's no parameter to set any text. | ||
|
||
* `.addSelectableLabel(title, text=None)` | ||
This adds a label whose text can be selected with the mouse. | ||
This is really just a *read-only* Entry, disguised to look like a label. | ||
But it seems to do the trick... | ||
|
||
* `.addFlashLabel(title, text=None)` | ||
This adds a flashing *label*, that will alternate between the foreground and background colours. | ||
|
||
![FlashLabel](../img/1_flash.gif) | ||
```python | ||
from appJar import gui | ||
|
||
app = gui() | ||
|
||
app.addFlashLabel("f1", "This is flashing") | ||
app.addLabel("f2", "This is not flashing") | ||
app.addFlashLabel("f3", "This is also flashing") | ||
|
||
app.go() | ||
``` | ||
|
||
####Set Labels | ||
* `.setLabel(title, text)` | ||
Change the contents of the *label*. | ||
|
||
* `.clearLabel(title)` | ||
Clear the contents of the *label*. | ||
|
||
####Get Labels | ||
* `.getLabel(title)` | ||
Get the contents of the *label*. | ||
|
||
##Auto-Labelled Widgets | ||
___ | ||
|
||
It's possible to automatically include a *label* alongside a lot of the widgets. | ||
Both the label and widget will be placed in the same grid space. | ||
Simply add the word `Label` to the command when adding the widget: | ||
|
||
* `.addLabelEntry(title)` | ||
* `.addLabelNumericEntry(title)` | ||
* `.addLabelSecretEntry(title)` | ||
* `.addLabelAutoEntry(title, words)` | ||
* `.addLabelScale(title)` | ||
* `.addLabelOptionBox(title, values)` | ||
* `.addLabelTickOptionBox(title, values)` | ||
* `.addLabelSpinBox(title, values)` | ||
* `.addLabelSpinBoxRange(title, from, to)` | ||
|
||
See the relevant section for a description of what the widget does. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.