Comments (3)
Hmn, I don't think Text
should be the place for this. It looks like a string
but it behaves like a method.
In general I think properties are not the place for non deterministic behaviours.
Consider the following example:
[Test]
public void TestTextSliderString()
{
var s1 = new Slider<string>();
var s2 = new Slider<string>();
s2.Text = "I've got a lovely bunch of coconuts, here they are sitting in a row!";
// This line does not do what it looks like
s1.Text = s2.Text;
TestContext.Out.WriteLine("Options:" + s1.Options.Count); //2
TestContext.Out.WriteLine("Options:" + s2.Options.Count); //6!
ClassicAssert.IsTrue(s1.Options.Count == s2.Options.Count );
}
from terminal.gui.
I think the Text
and Title
properties should be independent and have no relationship between them. By default, Text
will be drawn inside the view, with the exception of custom drawing. The Title
should only be used when a view has a border and is not an empty string.
Edit:
This exposition is just to warn you that in this case Options
and Text
should not have any relationship between them, with the exception that Text
can be used to reflect the string that will be displayed relative to the currently selected Options
.
from terminal.gui.
I wanted Slider to work in AllViewsTester so I made setting Text
to a comma delimited string equivalent to setting Options
.
Feel free to undo this, but I'd live ideas on how to make AllViewsTester support causing Views to be "useful/visible" without having custom logic per-view.
I did the same thing to RadioGroup
.
from terminal.gui.
Related Issues (20)
- Make the PowerShell modules arch-agnostic for now HOT 3
- Fail gracefully for impossible hosts HOT 4
- Rename `StateChangedEventArgs<T>` to `CancelEventArgs<T>` HOT 63
- A more reliable means of avoiding errors caused by stdin or stdout redirection
- (Internal) Better regexes for TODO-list items
- Clicking the StatusBar causes the event to be executed more than once. HOT 1
- `Dim.Auto (Content)` is broken if subviews use `Pos.Center` etc... HOT 3
- `StatusBar` should clip, not overwrite, when last item doesn't fit HOT 1
- `TextField` prevents default `Button` from working in some cases HOT 7
- Some more prep for revamped sourcegens and CI HOT 2
- Enabling trim mode breaks program at runtime (v2 only) HOT 16
- v1 - Example.cs does not work HOT 5
- `Button` with `ShadowStyle.Opaque` is broken HOT 5
- `DateField` unit tests fail on `macos.latest` HOT 4
- The exclusion of `.orig` files in `.gitignore` is no longer working
- Color ToString returns "Red" instead of "# HOT 4
- Release v1.17.1 HOT 1
- Localization not working on self-contained single-file. HOT 19
- Post-V2: Rewrite `TextFormatter`
- Feedback: Example HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from terminal.gui.