pygubu icon indicating copy to clipboard operation
pygubu copied to clipboard

some ideas for pygubu.

Open zaazbb opened this issue 9 years ago • 6 comments

  1. Create callback function automatically for every button,named as on_buttonname_clicked(). If have a option on menu button, it's better.
  2. Import variables to App class by a helper method, so do not need call get_variable() lots times.
  3. Make a layout design by Dragging widget on review panel directly. Maybe can use DndHandler class in dnd.py.
  4. Add align tool button or menu button.Add layout widget(eg:frame, grid) automatically, when a align button clicked. A better reference is QT gui designer.
  5. pygubu not just create ui file, also create App file. (Open source editer window and)Jump to the callback function directly when a button clicked on review panel.

zaazbb avatar Aug 19 '14 15:08 zaazbb

Hi zaazbb,

At the moment I'm rewriting parts of the properties management so I can add more features easily.

About your ideas:

  • Create callback function automatically for every button,named as on_buttonname_clicked(). If have a option on menu button, it's better.

I agree. But I think that is better to have a configuration option instead of by default. Something like "Atomatically add callback for buttons (yes/no)"

  • Import variables to App class by a helper method, so do not need call get_variable() lots times.

Mmm, I did not understand this requirement well. Do you mean an easy way to acces builder variables? Can you add some usage example pseudocode?

  • Make a layout design by Dragging widget on review panel directly. Maybe can use DndHandler class in dnd.py.

This is a hard one, and I don't think that it will be posible. I can research and analyze the possibility but this feature is not a priority for now.

  • Add align tool button or menu button.Add layout widget(eg:frame, grid) automatically, when a align button clicked. A better reference is QT gui designer.

I need more info here. Some usage example? I don't know qt-designer very well.

  • pygubu not just create ui file, also create App file. (Open source editer window and)Jump to the callback function directly when a button clicked on review panel.

This is another hard one, do you mean like an integrated IDE?. The initial concept was to only concentrate in the UI design part but, who knows, time will tell. To get started we can add another configuration option like "Generate application .py file" that will load and run the ui. That file will be created only once.

Regards Alejandro A.

alejandroautalan avatar Aug 20 '14 04:08 alejandroautalan

Mmm, I did not understand this requirement well. Do you mean an easy way to acces builder variables? Can you add some usage example pseudocode?

I want import all variables to App class namespace by a helper function, for example:

class MyApp(pygubu.TkApplication):      
    def _create_ui(self):
        self.builder = builder = pygubu.Builder()
        builder.add_from_file('main.ui')
        self.mainwindow = builder.get_object('mainwindow', self.master)
        builder.connect_callbacks(self)

        self.ivPktIndex = builder.get_variable('ivPktIndex')
        self.svPktDat = builder.get_variable('svPktDat')
        self.ivCount = builder.get_variable('ivCount')
        self.ivInterval = builder.get_variable('ivInterval')
        self.svSend = builder.get_variable('svSend')

I must call .get_variable() for every variable. I want a helper function, like builder.import_variables(), It can import all variable as the same name, or a fixed format name. "self.ivPktIndex" and "self.svPktDat" are created automatically. I only need call "builder.import_variables()" once. Those code can rewrite as below:

class MyApp(pygubu.TkApplication):      
    def _create_ui(self):
        self.builder = builder = pygubu.Builder()
        builder.add_from_file('main.ui')
        self.mainwindow = builder.get_object('mainwindow', self.master)
        builder.connect_callbacks(self)

        builder.import_variables()
        # now you can use self.ivPktIndex, self.svPktDat directly.

zaazbb avatar Aug 20 '14 06:08 zaazbb

I need more info here. Some usage example? I don't know qt-designer very well.

This is a part of "Layout on review panel(should rename as Layout panel or design panel)". I want drag, move and edite widget on a design panel like VC. Maybe, It is too hard to tkiner, TK only is a lightweight gui library.

zaazbb avatar Aug 20 '14 06:08 zaazbb

Is PyGuru supporting (or plan to support) the Python Mega Widget?

--- Regarding the proposal "pygubu not just create ui file, also create App file." of zaazbb --- This would indeed been a good idea to have some integration with a code editor (like it is the case for Delphi or "Lazarus Project" coder). For beginner and makers, it's is a real leak to have GUI builder separated from the code editor. May I suggest to "first" integrate with python "IDLE"? So everybody downloading Python would be able to start GUI designing by using PyGuru.

mchobby avatar Sep 23 '15 12:09 mchobby

Add an option to show/hide elements.

Maybe a checkbox in treeview1 that comment/uncomment the selected xml code.

nuno-andre avatar Dec 26 '16 19:12 nuno-andre

Should the unrealized suggestions be split into separate issues, and some put here?

matecsaj avatar Mar 18 '22 01:03 matecsaj