This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# tree_experiments.py | |
from rich.text import Text | |
from textual.app import App, ComposeResult | |
from textual.widgets import Tree | |
class TreeApp(App): | |
def compose(self) -> ComposeResult: | |
self.top_level_nodes: dict[str, int] = {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from textual.app import App, ComposeResult | |
from textual.widgets import Button, Label | |
from textual.screen import ModalScreen | |
from textual.containers import Grid | |
class WarningDialog(ModalScreen): | |
def compose(self) -> ComposeResult: | |
yield Grid( | |
Label("Are you sure you want to quit?", id="question"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TestNodes { | |
align: center middle; | |
} | |
#datatable { | |
height: 50%; | |
} | |
#remote_button, #tab-help-button { | |
background: green; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# simple_color_picker.py | |
from textual import on | |
from textual._color_constants import ANSI_COLORS, COLOR_NAME_TO_RGB | |
from textual.app import App, ComposeResult | |
from textual.containers import Center, Horizontal, Vertical | |
from textual.screen import ModalScreen | |
from textual.widgets import Button, Header, Select, Placeholder | |
class SimpleColorPickerDialog(ModalScreen): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# vehicle.py | |
from collections import namedtuple | |
class Vehicle: | |
def __init__(self, name, veh_type): | |
self.name = name | |
self.veh_type = veh_type | |
self.add_ons = [] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# password_generator_gui.py | |
import PySimpleGUI as sg | |
def main(): | |
layout = [ | |
[sg.Text("Password:"), sg.Input(size=(25, 1), key="-PASSWORD-")], | |
[ | |
sg.Text("Length:"), |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sys | |
from PIL import Image, ImageQt | |
from PyQt5.QtGui import QPixmap, QImage | |
from PyQt5.QtWidgets import QWidget, QLabel | |
from PyQt5.QtWidgets import QVBoxLayout, QApplication | |
class ImageViewer(QWidget): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# image_viewer.py | |
import io | |
import wx | |
class ImagePanel(wx.Panel): | |
def __init__(self, parent, image_size): | |
super().__init__(parent) | |
self.max_size = 240 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# kivy_image.py | |
from kivy.app import App | |
from kivy.uix.image import Image | |
class ImageViewer(App): | |
def build(self): | |
return Image(source="processed_flower.jpg") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import wx | |
class MainFrame(wx.Frame): | |
def __init__(self): | |
wx.Frame.__init__(self, None, title='') | |
panel = wx.Panel(self) | |
self.statusbar = self.CreateStatusBar( | |
1, style=wx.STB_SIZEGRIP|wx.STB_ELLIPSIZE_END|wx.FULL_REPAINT_ON_RESIZE) |
NewerOlder