Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

some ideas for pygubu. #29

Open
zaazbb opened this issue Aug 19, 2014 · 6 comments
Open

some ideas for pygubu. #29

zaazbb opened this issue Aug 19, 2014 · 6 comments

Comments

@zaazbb
Copy link
Contributor

zaazbb commented Aug 19, 2014

  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.
@alejandroautalan
Copy link
Owner

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.

@zaazbb
Copy link
Contributor Author

zaazbb commented Aug 20, 2014

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
Copy link
Contributor Author

zaazbb commented Aug 20, 2014

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.

@mchobby
Copy link

mchobby commented Sep 23, 2015

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.

@nuno-andre
Copy link
Contributor

Add an option to show/hide elements.

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

@matecsaj
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants