Skip to content

Commit d71fa11

Browse files
committed
Fixed README, Showcase, and images
1 parent 3e598e7 commit d71fa11

5 files changed

Lines changed: 148 additions & 13 deletions

File tree

‎README.md‎

Lines changed: 115 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,19 +35,123 @@ dotnet run
3535
* [API Documentation](https://gui-cs.github.io/Terminal.GuiV2Docs/api/Terminal.Gui.html)
3636
* [Documentation Home](https://gui-cs.github.io/Terminal.GuiV2Docs)
3737

38+
_The Documentation matches the most recent Nuget release from the `v2_develop` branch. The documentation for v1 is here: ([![Version](https://img.shields.io/nuget/v/Terminal.Gui.svg)](https://www.nuget.org/packages/Terminal.Gui))_
39+
40+
See the [`Terminal.Gui/` README](https://github.com/gui-cs/Terminal.Gui/tree/master/Terminal.Gui) for an overview of how the library is structured.
41+
3842
## Showcase & Examples
3943

40-
* **[UI Catalog](./UICatalog/README.md)** - The UI Catalog project provides an easy to use and extend sample illustrating the capabilities of **Terminal.Gui**. Run `dotnet run --project UICatalog` to run the UI Catalog.
41-
* **[C# Example](./Example/README.md)** - Run `dotnet run` in the `Example` directory to run the C# Example.
42-
* **[F# Example](./FSharpExample/)** - An example showing how to build a Terminal.Gui app using F#.
43-
* **[Reactive Example](./ReactiveExample/README.md)** - A sample app that shows how to use `System.Reactive` and `ReactiveUI` with `Terminal.Gui`. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI `WhenAnyValue` syntax and [Pharmacist](https://github.com/reactiveui/pharmacist) — a tool that converts all events in a NuGet package into observable wrappers.
44-
* **[CommunityToolkit Example](./CommunityToolkitExample/README.md)** - A example of using the `CommunityToolkit.MVVM` framework's `ObservableObject`, `ObservableProperty`, and `IRecipient<T>` in conjunction with `Microsoft.Extensions.DependencyInjection`.
45-
* **[C# SelfContained](./SelfContained/README.md)** - An example showing how to publish a Terminal.Gui app using C# self-contained single file.
46-
* **[PowerShell's `Out-ConsoleGridView`](https://github.com/PowerShell/GraphicalTools)** - `OCGV` sends the output from a command to an interactive table.
47-
* **[F7History](https://github.com/gui-cs/F7History)** - Graphical Command History for PowerShell (built on PowerShell's `Out-ConsoleGridView`).
48-
* **[PoshRedisViewer](https://github.com/En3Tho/PoshRedisViewer)** - A compact Redis viewer module for PowerShell written in F#.
49-
* **[PoshDotnetDumpAnalyzeViewer](https://github.com/En3Tho/PoshDotnetDumpAnalyzeViewer)** - dotnet-dump UI module for PowerShell.
50-
* **[TerminalGuiDesigner](https://github.com/tznind/TerminalGuiDesigner)** - Cross platform view designer for building Terminal.Gui applications.
44+
**Terminal.Gui** can be used with any .Net language to create feature rich and robust applications.
45+
[Showcase](https://github.com/gui-cs/Terminal.Gui/blob/develop/Showcase.md) is a place where you can find all kind of projects from simple examples to advanced real world apps that fully utilize capabilities of the toolkit.
46+
The team is looking forward to seeing new amazing projects made by the community to be added there!
47+
48+
## Sample Usage in C#
49+
50+
The following example shows a basic Terminal.Gui application in C#:
51+
52+
```csharp
53+
// This is a simple example application. For the full range of functionality
54+
// see the UICatalog project
55+
56+
// A simple Terminal.Gui example in C# - using C# 9.0 Top-level statements
57+
58+
using System;
59+
using Terminal.Gui;
60+
61+
Application.Run<ExampleWindow> ().Dispose ();
62+
63+
// Before the application exits, reset Terminal.Gui for clean shutdown
64+
Application.Shutdown ();
65+
66+
// To see this output on the screen it must be done after shutdown,
67+
// which restores the previous screen.
68+
Console.WriteLine ($@"Username: {ExampleWindow.UserName}");
69+
70+
// Defines a top-level window with border and title
71+
public class ExampleWindow : Window
72+
{
73+
public static string UserName;
74+
75+
public ExampleWindow ()
76+
{
77+
Title = $"Example App ({Application.QuitKey} to quit)";
78+
79+
// Create input components and labels
80+
var usernameLabel = new Label { Text = "Username:" };
81+
82+
var userNameText = new TextField
83+
{
84+
// Position text field adjacent to the label
85+
X = Pos.Right (usernameLabel) + 1,
86+
87+
// Fill remaining horizontal space
88+
Width = Dim.Fill ()
89+
};
90+
91+
var passwordLabel = new Label
92+
{
93+
Text = "Password:", X = Pos.Left (usernameLabel), Y = Pos.Bottom (usernameLabel) + 1
94+
};
95+
96+
var passwordText = new TextField
97+
{
98+
Secret = true,
99+
100+
// align with the text box above
101+
X = Pos.Left (userNameText),
102+
Y = Pos.Top (passwordLabel),
103+
Width = Dim.Fill ()
104+
};
105+
106+
// Create login button
107+
var btnLogin = new Button
108+
{
109+
Text = "Login",
110+
Y = Pos.Bottom (passwordLabel) + 1,
111+
112+
// center the login button horizontally
113+
X = Pos.Center (),
114+
IsDefault = true
115+
};
116+
117+
// When login button is clicked display a message popup
118+
btnLogin.Accept += (s, e) =>
119+
{
120+
if (userNameText.Text == "admin" && passwordText.Text == "password")
121+
{
122+
MessageBox.Query ("Logging In", "Login Successful", "Ok");
123+
UserName = userNameText.Text;
124+
Application.RequestStop ();
125+
}
126+
else
127+
{
128+
MessageBox.ErrorQuery ("Logging In", "Incorrect username or password", "Ok");
129+
}
130+
};
131+
132+
// Add the views to the Window
133+
Add (usernameLabel, userNameText, passwordLabel, passwordText, btnLogin);
134+
}
135+
}
136+
```
137+
138+
When run the application looks as follows:
139+
140+
![Simple Usage app](./docfx/images/Example.png)
141+
142+
## Installing
143+
144+
Use NuGet to install the `Terminal.Gui` NuGet package: https://www.nuget.org/packages/Terminal.Gui
145+
146+
### Installation in .NET Core Projects
147+
148+
To install Terminal.Gui into a .NET Core project, use the `dotnet` CLI tool with this command.
149+
150+
```
151+
dotnet add package Terminal.Gui
152+
```
153+
154+
Or, you can use the [Terminal.Gui.Templates](https://github.com/gui-cs/Terminal.Gui.templates).
51155

52156
## Contributing
53157

‎Release.ps1‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ param(
55
[int]$Version
66
)
77

8-
$branch = "v2_develop"
9-
$tag = "v2.0.0-alpha.$Version"
8+
$branch = "v2_release"
9+
$tag = "$Version-prealpha"
1010
$releaseMessage = "Release $tag"
1111

1212
try {

‎Showcase.md‎

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
# Showcase #
2+
3+
* **[UI Catalog](https://github.com/gui-cs/Terminal.Gui/tree/master/UICatalog)** - The UI Catalog project provides an easy to use and extend sample illustrating the capabilities of **Terminal.Gui**. Run `dotnet run --project UICatalog` to run the UI Catalog.
4+
![Sample app](docfx/images/sample.gif)
5+
6+
* **[PowerShell's `Out-ConsoleGridView`](https://github.com/PowerShell/GraphicalTools)** - `OCGV` sends the output from a command to an interactive table.
7+
![OutConsoleGridView.png](docfx/images/OutConsoleGridView.png)
8+
9+
* **[F7History](https://github.com/gui-cs/F7History)** - Graphical Command History for PowerShell (built on PowerShell's `Out-ConsoleGridView`).
10+
![F7History.gif](docfx/images/F7History.gif)
11+
12+
* **[PoshRedisViewer](https://github.com/En3Tho/PoshRedisViewer)** - A compact Redis viewer module for PowerShell written in F#.
13+
![PoshRedisViewer.png](docfx/images/PoshRedisViewer.png)
14+
15+
* **[PoshDotnetDumpAnalyzeViewer](https://github.com/En3Tho/PoshDotnetDumpAnalyzeViewer)** - dotnet-dump UI module for PowerShell.
16+
![PoshDotnetDumpAnalyzerViewer.png](docfx/images/PoshDotnetDumpAnalyzerViewer.png)
17+
18+
* **[TerminalGuiDesigner](https://github.com/tznind/TerminalGuiDesigner)** - Cross platform view designer for building Terminal.Gui applications.
19+
![TerminalGuiDesigner.gif](docfx/images/TerminalGuiDesigner.gif)
20+
21+
* **[Capital and Cargo](https://github.com/dhorions/Capital-and-Cargo)** - A retro console game where you buy, sell, produce and transport goods built with Terminal.Gui
22+
![image](https://github.com/gui-cs/Terminal.Gui/assets/1682004/ed89f3d6-020f-4a8a-ae18-e057514f4c43)
23+
24+
25+
# Examples #
26+
27+
* **[C# Example](https://github.com/gui-cs/Terminal.Gui/tree/master/Example)** - Run `dotnet run` in the `Example` directory to run the C# Example.
28+
29+
* **[F# Example](https://github.com/gui-cs/Terminal.Gui/tree/master/FSharpExample)** - An example showing how to build a Terminal.Gui app using F#.
30+
31+
* **[Reactive Example](https://github.com/gui-cs/Terminal.Gui/tree/master/ReactiveExample)** - A sample app that shows how to use `System.Reactive` and `ReactiveUI` with `Terminal.Gui`. The app uses the MVVM architecture that may seem familiar to folks coming from WPF, Xamarin Forms, UWP, Avalonia, or Windows Forms. In this app, we implement the data bindings using ReactiveUI `WhenAnyValue` syntax and [Pharmacist](https://github.com/reactiveui/pharmacist) — a tool that converts all events in a NuGet package into observable wrappers.

‎docfx/images/Example.png‎

749 Bytes
Loading

‎docfx/images/sample.gif‎

3.94 MB
Loading

0 commit comments

Comments
 (0)