Python Forum
ComboBox example?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
ComboBox example?
#1
Hi all - I have to rebuild a little utility I created because my source code was wiped out, and I cannot extract the original script from the .exe I converted it to. The original tool was built using tkinter for the GUI, but I really never liked it, so I wanted to try something else.

After a little reading, I decided to try PYFORMS, but I can't seem to get my hands on a basic example of a form with a populated combo box.

Would any of you have an example of something like that? Something super simple, like a small form with a combo box or two, with any values at all.

Thanks for any guidance.
Reply
#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
#3
It does indeed, thank you so much
Reply
#4
Nilamo (or anybody else kind enough to get this far) - since I'm just getting started, and am HORRIBLE at python, do you think PySimpleGUI would be a better approach? I'm wide open to suggestions.

The GUI will basically be 10-12 rows, where each row will have:
A) Text Entry
B) Text Entry 2
C) Combo Box 1
D) Combo Box 2
E) Text Entry 3

All 10-12 ComboBox 1's will have the same options. All 10-12 Combobox 2's will have the same options, which differ from combobox 1
Reply
#5
I normally work with websites, and not guis, so I can't really say. But I do know that there are a few people here who really like PyQT.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] How can I sync Combobox index to other combobox index? nickzsche 2 2,332 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