Git Product home page Git Product logo

Comments (4)

FlorianJacta avatar FlorianJacta commented on June 14, 2024

Duplicate of #526?

from taipy.

AlexandreSajus avatar AlexandreSajus commented on June 14, 2024

Duplicate of #526?

Yes it is

from taipy.

AlexandreSajus avatar AlexandreSajus commented on June 14, 2024

Here is a list of functioning tgb code as reference:

from taipy import Gui
import taipy.gui.builder as tgb

# slider_value needs to be initialized first
slider_value = 5

with tgb.Page() as page:
    tgb.slider('{slider_value}', min=0, max=10)
    tgb.text('slider_value: {slider_value}')

if __name__ == '__main__':
    Gui(page).run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb


with tgb.Page() as page:
    tgb.status('Any text will be displayed this way')
    tgb.status('')
    # some keywords will change the color of your status
    tgb.status('warning')
    tgb.status('success')
    tgb.status('secondary')

if __name__ == '__main__':
    Gui(page).run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

choice = 'No'


def toggle_func(state, var_name, value):
    print(f'state.choice: {state.choice}')
    print(f'var_name: {var_name}')
    print(f'value: {value}')


with tgb.Page() as page:
    tgb.text('Current choice: {choice}')
    tgb.toggle(value='{choice}', lov=['Yes', 'No'], on_change=toggle_func)


if __name__ == '__main__':
    Gui(page).run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

# the variable used to open/close the dialog
dialog_status = False


def open_dialog(state):
    state.dialog_status = not state.dialog_status


with tgb.Page() as dialog_content:
    tgb.html('p', 'Inside the dialog')


with tgb.Page() as page:
    tgb.button("Open dialog", on_action=open_dialog)
    tgb.dialog('{dialog_status}', on_action=open_dialog, partial='{dialog_partial}')


if __name__ == "__main__":
    gui = Gui(page=page)
    dialog_partial = gui.add_partial(dialog_content)
    gui.run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

# The variable used to open/close the expandable
expand_status = False


with tgb.Page() as partial_content:
    tgb.html('p', 'Inside the expandable')


def change_status(state):
    print(state.expand_status)
    state.expand_status = not state.expand_status


with tgb.Page() as page:
    #  You can click both the button or the expandable to open it
    tgb.button('Open Expandable', on_action=change_status)
    tgb.expandable(title='Expandable title', partial='{expandable_content}', expanded='{expand_status}', on_action=change_status)

if __name__ == '__main__':
    gui = Gui(page)
    expandable_content = gui.add_partial(partial_content)
    gui.run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

# input_value needs to be initialized first
input_value = '...'

with tgb.Page() as page:
    tgb.input('{input_value}')
    tgb.text('input_value: {input_value}')

if __name__ == '__main__':
    Gui(page).run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

choice = 'B'  # the variable displayed by the selector

with tgb.Page() as page:
    tgb.selector(value='{choice}', lov=['A', 'B', 'C'], dropdown=True)
    tgb.html('p', 'Not displayed alone:')
    tgb.text('{choice}')
    tgb.html('p', 'Displayed when added some text:')
    tgb.text('You selected: {choice}')

if __name__ == '__main__':
    Gui(page).run(use_reloader=True)
from taipy import Gui
import taipy.gui.builder as tgb

status = {"status": "error", "message": "This is an error message"}

with tgb.Page() as page:
    tgb.status("{status}")

if __name__ == "__main__":
    Gui(page).run(use_reloader=True)

from taipy.

FlorianJacta avatar FlorianJacta commented on June 14, 2024

Closing this issue because it is a duplicate of #526

from taipy.

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.