Python Forum
ComboBox example?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ComboBox example?
#2
I don't know pyforms, so I don't know if this fits with the "flow" of how it works, but I cobbled this together using the "base app" and the docs for the combo control (https://pyforms-gui.readthedocs.io/en/v4...ntrolcombo), and it seems to work:
from pyforms.basewidget import BaseWidget
from pyforms.controls import ControlCombo

class ComboTest(BaseWidget):
    def __init__(self, *args, **kwargs):
        super().__init__('Combo Box example')

        self._combo = ControlCombo()
        items = ["first", "second"]
        for item in items:
            self._combo.add_item(item)

if __name__ == '__main__':
    from pyforms import start_app
    start_app(ComboTest)
Reply


Messages In This Thread
ComboBox example? - by JP_ROMANO - Jan-07-2019, 04:34 PM
RE: ComboBox example? - by nilamo - Jan-07-2019, 04:50 PM
RE: ComboBox example? - by JP_ROMANO - Jan-07-2019, 05:04 PM
RE: ComboBox example? - by JP_ROMANO - Jan-07-2019, 06:17 PM
RE: ComboBox example? - by nilamo - Jan-07-2019, 06:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] How can I sync Combobox index to other combobox index? nickzsche 2 2,422 Jan-03-2022, 12:29 PM
Last Post: Axel_Erfurt

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020