# encoding: utf8 from pygubu import BuilderObject, register_widget, register_property from pygubu.builder.ttkstdwidgets import TTKCombobox from pygubu.widgets.combobox import Combobox class ComboboxBuilder(TTKCombobox): OPTIONS_SPECIFIC = tuple(set(TTKCombobox.OPTIONS_SPECIFIC) - set(('state',))) OPTIONS_CUSTOM = TTKCombobox.OPTIONS_CUSTOM + ('keyvariable',) properties = (TTKCombobox.OPTIONS_STANDARD + TTKCombobox.OPTIONS_SPECIFIC + OPTIONS_CUSTOM) tkvar_properties = TTKCombobox.tkvar_properties + ('keyvariable',) class_ = Combobox register_widget('pygubu.builder.widgets.combobox', ComboboxBuilder, 'Combobox', ('ttk', 'Pygubu Widgets')) props = { 'keyvariable': { 'editor': 'tkvarentry' } } for p in props: register_property(p, props[p])
# file: tkcalendarwidgets.py from tkcalendar import DateEntry from pygubu import BuilderObject, register_widget class DateEntryBuilder(BuilderObject): class_ = DateEntry register_widget('tkcalendarwidgets.dateentry', DateEntryBuilder, 'DateEntry', ('ttk', 'My Tkcalendar widgets'))
# encoding: utf8 from pygubu import BuilderObject, register_widget, register_property from pygubu.widgets.pathchooserinput import PathChooserInput class PathChooserInputBuilder(BuilderObject): class_ = PathChooserInput OPTIONS_CUSTOM = ('type', 'path', 'image', 'textvariable') properties = OPTIONS_CUSTOM register_widget('pygubu.builder.widgets.pathchooserinput', PathChooserInputBuilder, 'PathChooserInput', ('ttk', 'Pygubu Widgets')) props = { 'type': { 'editor': 'choice', 'params': { 'values': (PathChooserInput.FILE, PathChooserInput.DIR), 'state': 'readonly' }, 'default': PathChooserInput.FILE }, 'path': { 'editor': 'entry' }, 'image': { 'editor': 'imageentry' }, 'textvariable': {
# encoding: utf8 from pygubu import BuilderObject, register_widget, register_property from pygubu.builder.ttkstdwidgets import TTKFrame from pygubu.widgets.calendarframe import CalendarFrame class CalendarFrameBuilder(BuilderObject): class_ = CalendarFrame OPTIONS_STANDARD = TTKFrame.OPTIONS_STANDARD OPTIONS_SPECIFIC = TTKFrame.OPTIONS_SPECIFIC OPTIONS_CUSTOM = ('firstweekday', 'year', 'month', 'calendarfg', 'calendarbg', 'headerfg', 'headerbg', 'selectbg', 'selectfg', 'state', 'markbg', 'markfg') properties = OPTIONS_STANDARD + OPTIONS_SPECIFIC + OPTIONS_CUSTOM register_widget('pygubu.builder.widgets.calendarframe', CalendarFrameBuilder, 'CalendarFrame', ('ttk', 'Pygubu Widgets')) props = { 'state': { 'editor': 'choice', 'pygubu.builder.widgets.calendarframe': { 'params': { 'values': ('', 'normal', 'disabled'), 'state': 'readonly'}}, }, 'firstweekday': { 'editor': 'choice', 'params': { 'values': ('0', '6'), 'state': 'readonly'}, 'default': '6' },
from pygubu import BuilderObject, register_widget, register_property from pygubu.widgets.pathchooserinput import PathChooserInput class PathChooserInputBuilder(BuilderObject): class_ = PathChooserInput OPTIONS_CUSTOM = ('type', 'path', 'image', 'textvariable') properties = OPTIONS_CUSTOM register_widget('pygubu.builder.widgets.pathchooserinput', PathChooserInputBuilder, 'PathChooserInput', ('ttk', 'Pygubu Widgets')) props = { 'type': { 'editor': 'choice', 'params': { 'values': (PathChooserInput.FILE, PathChooserInput.DIR), 'state': 'readonly'}, 'default': PathChooserInput.FILE }, 'path': { 'editor': 'entry' }, 'image': { 'editor': 'imageentry' }, 'textvariable': { 'editor': 'tkvarentry' } } for p in props:
from pygubu import BuilderObject, register_widget from timewidget import TimeWidget class TimeWidgetBuilder(BuilderObject): class_ = TimeWidget register_widget('timerappwidgets.timewidget', TimeWidgetBuilder, 'TimeWidget', ('ttk', 'Timer App Widgets'))