Coder Social home page Coder Social logo

What means MinSize() of Entry? about fyne HOT 5 CLOSED

gksrb4 avatar gksrb4 commented on June 14, 2024
What means MinSize() of Entry?

from fyne.

Comments (5)

andydotxyz avatar andydotxyz commented on June 14, 2024

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.

gksrb4 avatar gksrb4 commented on June 14, 2024
	// 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.

gksrb4 avatar gksrb4 commented on June 14, 2024
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)

image

I was considering using TextGrid, but it seems unsuitable for a log viewer as it does not support drag and select functionality

from fyne.

andydotxyz avatar andydotxyz commented on June 14, 2024

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.

Jacalz avatar Jacalz commented on June 14, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.