DEV Community

Ybrahin Martinez
Ybrahin Martinez

Posted on • Edited on

1 1

Post #5: Everything almost done

Hi everyone! This is my 5th blog post, and it is the last before the coding phase ends. I can't believe that almost 2 months have passed, the whole experience has been awesome, however, I am going deeper into it in the next post.

Last week I was working on modifying the graphical user interface. This change was necessary to improve the lesson's context, with this information the future students of the course can know more about the interfaces and the basic differences between them. In addition, I changed the initial position of dialogs to the left upper corner, this change helps to a better experience when creating the dialogs. I made a PR with this change and it is awaiting the mentors' review. Below there is a result of this change.

Code


from browser import document, html
from browser.widgets.dialog import Dialog

# Creación de un dialogo con el título
d = Dialog("Show de preguntas Zombis", top=20, left=20)

# Agrega elementos como botones y títulos
d.panel <= html.H3(
    "Aprieta los botones",
    id="titulo_ventana",
    style=dict(textAlign="center")
)
d.panel <= html.BUTTON("Correcto", id="btn_correcto")

d.panel <= html.BUTTON("Incorrecto",
    id="btn_incorrecto",
    style=dict(marginLeft="5em")
)

Enter fullscreen mode Exit fullscreen mode

Result
Result Dialog

I made a few Proof of Concepts with different approaches until I found the best solution for my problem, however, one of the approaches that I used was inherited from the Brython class dialog and overwrote the methods that I needed. This approach was the optimal solution but I had a problem, the Brython interpreter did not allow me to do it and I had several issues with this, then I changed it to a simple solution, which can not be optimal, but remember...

Better done than perfect

Qodo Takeover

Introducing Qodo Gen 1.0: Transform Your Workflow with Agentic AI

While many AI coding tools operate as simple command-response systems, Qodo Gen 1.0 represents the next generation: autonomous, multi-step problem-solving agents that work alongside you.

Read full post

Top comments (0)

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay