GithubHelp home page GithubHelp logo

Comments (6)

almarklein avatar almarklein commented on August 11, 2024

Do you perhaps have a minimal code example to demonstrate what you mean?

from flexx.

1751660300 avatar 1751660300 commented on August 11, 2024

ok, this example, you will know problem click btn for box css, result

element.style {
    max-height: 1080px;
    min-width: 12px;
    max-width: 1e9px;
    min-height: 2798px;
    flex-grow: 0;
    flex-shrink: 1;
    margin-top: 4px;
    padding: 1px;
}
from flexx import flx


class MyApp(flx.Widget):

    def init(self):
        with flx.VBox():
            self.btn = flx.Button(text="测试")
            self.box = flx.VBox(style="max-height: 1080px")
            flx.VBox(flex=1)

    @flx.action
    def add_div(self, text):
        flx.Label(text=text, parent=self.box)

    @flx.reaction("btn.pointer_click")
    def add_ra(self, *event):
        for i in range(100):
            self.add_div(str(i))

app = flx.App(MyApp)
app.launch('app')
flx.run()

from flexx.

almarklein avatar almarklein commented on August 11, 2024

Well, you're applying two conflicting constraints. On the one hand you want the max-height to be 1080, but on the other hand the vbox contains content that requires more space than that to be shown. The latter wins.

from flexx.

1751660300 avatar 1751660300 commented on August 11, 2024

emmm~,now, i want to set max-height, how to do ?

from flexx.

almarklein avatar almarklein commented on August 11, 2024

What do you think should happen? Should the content be compressed in some way? Should it be hidden? Should it scroll?

Perhaps what you're looking for is a scrollable container. There are a few exaples of that in the flexxamples folder.

Other than that, you may be able to achieve what you want with the right CSS, but the way Flexx works (and CSS too, mostly) is that stuff takes up the space it needs to show the contents.

from flexx.

1751660300 avatar 1751660300 commented on August 11, 2024

ok, i find a example in the flexxamples,this is ok, I will also understand it deeply,thanks xixi。

from flexx.

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.