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

Merge tkinterpp-notebook into tkinterpp-merger to add Notebook widget #43

Open
wants to merge 13 commits into
base: tkinterpp-merger
Choose a base branch
from

Conversation

sbordeyne
Copy link
Member

@sbordeyne sbordeyne commented Dec 1, 2019

PR Details:

  • Widget name: Notebook
  • Author: Dogeek (based on @j4321 's work)

Description

A Notebook widget that includes functionnality to close and reorder tabs

Checklist

  • Widget in a separate file in the appropriate folder
  • Widget functions properly on both Windows and Linux
  • Widget code includes docstrings with parameter descriptions
  • Included an example file in /examples
  • Widget is covered by unitttests in /tests
  • Widget includes required assets files
  • Reference to widget in AUTHORS.md
  • Entry in sphinx documentation

@sbordeyne sbordeyne changed the title Tkinterpp notebook Merge tkinterpp-notebook into tkinterpp-merger to add Notebook widget Dec 2, 2019
@sbordeyne sbordeyne requested a review from j4321 December 2, 2019 00:47
@sbordeyne
Copy link
Member Author

Largely based on your work @j4321 , but I'm also working on integrating "drag to new toplevel" functionality", as well as adding traversal with the mousewheel when hovering the tab row.

Copy link
Member

@j4321 j4321 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to my comments on specific lines, there are still some issues with the style. Especially, when I execute setup_style() after creating the notebook, I get (even running directly the example without using any interactive console)

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/media/DATA/Divers/ttkwidgets/ttkwidgets/notebook.py", line 388, in setup_style
    style.element_create('close', 'image', "img_close",
  File "/usr/lib/python3.8/tkinter/ttk.py", line 465, in element_create
    self.tk.call(self._name, "element", "create", elementname, etype,
_tkinter.TclError: image "img_close" doesn't exist

Also the widget does not adapt totally to changes of theme after its creation, an feature I had not worked on in my app since the theme was chosen once and for all.

Finally, with some themes (e.g. 'clam' and 'alt') the tabs don't have visible borders. This seems to come from l. 424

style.configure('Notebook.Tab', relief='raised', borderwidth=1,
                        **style_config)

from the style_config, however I don't understand why since the default lightcolor and darkcolor are different. I can help you look into it.

examples/example_notebook.py Show resolved Hide resolved
ttkwidgets/notebook.py Show resolved Hide resolved
ttkwidgets/notebook.py Show resolved Hide resolved
ttkwidgets/notebook.py Show resolved Hide resolved
ttkwidgets/notebook.py Outdated Show resolved Hide resolved
ttkwidgets/notebook.py Outdated Show resolved Hide resolved
ttkwidgets/notebook.py Outdated Show resolved Hide resolved
ttkwidgets/notebook.py Outdated Show resolved Hide resolved
@RedFantom RedFantom added this to In progress in Merging tkinterpp widgets via automation Dec 2, 2019
Dogeek added 2 commits December 2, 2019 17:09
- dropped `dont_setup_style` in favor of the Notebook._initialized class attribute

- defined images now have a proper defined master

- PEP8 compliance

- `ba.ckground` typo fix

- Removed theme change on 'Left.Notebook.TButton' and 'Right.Notebook.TButton'
@sbordeyne
Copy link
Member Author

A number of these should be fixed now

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

Successfully merging this pull request may close these issues.

None yet

3 participants