Panel
Panel
A layout container with a single slot that automatically renders a background widget behind its content.
Specific kwargs
| Argument |
Type |
Description |
slot |
NevuObject / None |
the child element placed inside the panel (maps to cell 1, 1). |
bg_widget |
Widget / None |
custom widget to draw as the background. If None, a default Widget is created. |
Getters
| Name |
ReturnType |
Description |
style |
Style |
current style of the panel and its background widget. |
Setters
| Name |
Kwargs |
Description |
style |
style: Style |
overwrites the style of the panel and updates the background widget style. |
Panel is a subclass of: Grid
Use case
from nevu_ui import *
import pygame
pygame.init()
window = Window((500, 500), title = "Panel example")
menu = Menu(window, (100%vw, 100%vh))
layout = Panel((100%vw, 100%vh), slot = Label("Centered Content", (250, 100)))
menu.layout = layout
while True:
window.begin_frame()
window.update()
menu.update()
menu.draw()
window.end_frame()
from nevu_ui import *
import pyray
window = Window((500, 500), title = "Panel example", backend = Backend.RayLib)
menu = Menu(window, (100%vw, 100%vh))
layout = Panel((100%vw, 100%vh), slot = Label("Centered Content", (250, 100)))
menu.layout = layout
while True:
window.begin_frame()
window.update()
menu.update()
menu.draw()
window.end_frame()
Created with GGen v1.3.0 for nevu_ui v0.8.2