Comments (5)
If you turn off scrolling then the returned minimum size will be different.
Items that have scrolling turned on will always return a minsize that represents the smallest area that is usable.
from fyne.
// Scroll can be used to turn off the scrolling of our entry when Wrapping is WrapNone.
//
// Since: 2.4
Scroll widget.ScrollDirection
entry.Wrapping = fyne.TextWrapBreak
testE := widget.Entry{
Text: "test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n",
MultiLine: true,
Wrapping: fyne.TextWrapBreak,
}
s := testE.MinSize()
log.Debug("testE MinSize: %v", s)
testE2 := widget.Entry{
Text: "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest",
MultiLine: true,
Wrapping: fyne.TextWrapBreak,
}
s = testE2.MinSize()
log.Debug("testE2 MinSize: %v", s)
2024/04/24 11:37:25.842972 DEBG: testE MinSize: {36.703125 73.234375}
2024/04/24 11:37:25.843474 DEBG: testE2 MinSize: {36.703125 73.234375}
I turn off scroll of the entry. but, The function of Entry.MinSize() still return same size.
from fyne.
testE := widget.Entry{
Text: "test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n",
MultiLine: true,
// Wrapping: fyne.TextWrapWord,
}
s := testE.MinSize()
log.Debug("testE MinSize: %v", s)
testE2 := widget.Entry{
Text: "test\ntest\ntest\ntest\ntest\ntest\ntest\ntest",
MultiLine: true,
Wrapping: fyne.TextWrapWord,
}
s = testE2.MinSize()
log.Debug("testE2 MinSize: %v", s)
testTg := widget.NewTextGridFromString("test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n")
s2 := testTg.MinSize()
log.Debug("testGrid MinSize: %v", s2)
testTg = widget.NewTextGridFromString("test\r\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\ntest\n\r\n")
s2 = testTg.MinSize()
log.Debug("testGrid2 MinSize MinSize: %v", s2)
I was considering using TextGrid, but it seems unsuitable for a log viewer as it does not support drag and select functionality
from fyne.
I turn off scroll of the entry. but, The function of Entry.MinSize() still return same size.
No, you didn't turn off scrolling.
from fyne.
Moving this to a discussion as it is a question. Please use the issue tracker for bugs and feature requests.
from fyne.
Related Issues (20)
- Licence has self conflicting wording, possible typo HOT 3
- Is there a separate window.Run function HOT 2
- Production app running a test app when importing Appearance Screen HOT 4
- SetIcon don't work HOT 1
- App freezes when rapidly modifying content of container HOT 5
- fyne package does not work with main package not in the current directory HOT 2
- Android packaging fails: could not determine kind of name for C.ALooper_pollAll HOT 6
- binding.Untyped crashes when set to nil HOT 1
- AppTab does not display blue indicator line if you create it empty and then Append items to it later. HOT 1
- Automatically remove focus from a widget that is no longer in the object tree HOT 6
- Internal support for custom colored fyne.Resource theming. HOT 10
- widget not have Date Picker HOT 2
- blured scaled zoom gui HOT 1
- Form layout allocates a new 2d slice on each MinSize and Layout call HOT 6
- Add an API to get the "min" width of text widgets with wrapping that would be needed to show the text without wrapping HOT 6
- App Crash on IOS Simulator HOT 6
- Add SizeName property to Hyperlink widget HOT 1
- widget.Entry insert some word is very log HOT 10
- when dialog.ShowFileOpen then click cancel,window quit and program terminated HOT 1
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 fyne.