Skip to content

[Question]How to fix a container that changes position when a button is pressed #1939

Answered by plugeit
AngelCard asked this question in Q&A
Discussion options

You must be logged in to vote
#the window height and window width was not persitent so simply i delcared a global window height and width variable and passed it to all widgets wherever needed to specify window height and width
import flet
from flet import*
global page_width, page_height
class Herramientas(UserControl):
    def __init__(self, text, icon, on_click):
        super().__init__()
        self.button=Container(
            Row(
                vertical_alignment=CrossAxisAlignment.CENTER,
                spacing=0,
                controls=[
                    TextButton(
                        expand=True,
                        height=40,
                        content=Row(
                            …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@plugeit
Comment options

Answer selected by AngelCard
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
help wanted Extra attention is needed
2 participants