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

IDLE: Switch search dialogs to ttk widgets, and other refinement #71664

Open
terryjreedy opened this issue Jul 10, 2016 · 9 comments
Open

IDLE: Switch search dialogs to ttk widgets, and other refinement #71664

terryjreedy opened this issue Jul 10, 2016 · 9 comments
Assignees
Labels
3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement

Comments

@terryjreedy
Copy link
Member

BPO 27477
Nosy @terryjreedy, @roseman
Dependencies
  • bpo-33987: IDLE: use ttk.Frame for ttk widgets
  • Files
  • ttk-search.diff
  • search.diff
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = 'https://github.com/terryjreedy'
    closed_at = None
    created_at = <Date 2016-07-10.20:19:37.524>
    labels = ['3.8', 'expert-IDLE', 'type-feature', '3.7']
    title = 'IDLE: Switch search dialogs to ttk widgets, and other refinement'
    updated_at = <Date 2021-01-22.08:27:50.787>
    user = 'https://github.com/terryjreedy'

    bugs.python.org fields:

    activity = <Date 2021-01-22.08:27:50.787>
    actor = 'terry.reedy'
    assignee = 'terry.reedy'
    closed = False
    closed_date = None
    closer = None
    components = ['IDLE']
    creation = <Date 2016-07-10.20:19:37.524>
    creator = 'terry.reedy'
    dependencies = ['33987']
    files = ['43680', '43968']
    hgrepos = []
    issue_num = 27477
    keywords = ['patch']
    message_count = 9.0
    messages = ['270131', '270141', '271653', '271752', '271791', '320804', '375094', '379302', '385484']
    nosy_count = 3.0
    nosy_names = ['terry.reedy', 'markroseman', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = None
    stage = 'needs patch'
    status = 'open'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue27477'
    versions = ['Python 3.7', 'Python 3.8']

    @terryjreedy
    Copy link
    Member Author

    Scrollbars and the new query module now use ttk widgets. Time to convert the other dialogs.

    Changing imports is straightforward.

    Use of an option that can only be changed in the style may be harder. There was one instance of this among the scrollbars (converted in bpo-24750) and I just skipped the minor tweak, and let the scrollbar in question look like all the rest.

    The most difficult issue is changes in allowed methods. For instance, the state of tk checkbuttons and radiobuttons can be controlled by either setting a control variable or by calling methods. For ttk, the methods are gone.

    First are the search dialog modules: searchbase, search, replace, and grep. The tk-only 'anchor' option is used but has no effect since the 'width' option is not used to allocate extra space for the buttons. The tk-only select method is used, but at least in searchbase, it has no effect, as it always sets the button to the state it already had. Its use in test files, however, has to be replaced, not deleted.

    IDLE does not control the common dialogs. But we could choose to replace them, I would not do that for the os file dialogs, but already replaced the 'ask' messagebox used for Open Module for behavioral reasons (bpo-27380).

    @terryjreedy terryjreedy added the type-feature A feature request or enhancement label Jul 10, 2016
    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Jul 11, 2016

    New changeset 91fe65e3d7bb by Terry Jan Reedy in branch 'default':
    Issue bpo-27477: Convert IDLE search dialogs to using ttk widgets.
    https://hg.python.org/cpython/rev/91fe65e3d7bb

    @roseman
    Copy link
    Mannequin

    roseman mannequin commented Jul 29, 2016

    Great start. Needs to have a ttk.Frame directly inside the toplevel window to avoid whitespace showing around grey widgets (like in query dialog shot).

    I'd also like to see the spacing adjusted (all platforms) and button positions changed on Mac to go at the bottom, as per http://www.tkdocs.com/tutorial/idle.html#idledialogs

    Open to a patch that does that?

    @terryjreedy
    Copy link
    Member Author

    I debated whether to open a new search style issue and copy a message or defer ttk for config to another issue and re-title this. I went with widget group rather than aspect (style) this time. There are multiple search behavior issues.

    I added Notepad, Workpad, Libre Office Write, Tortoise Hg, and browsers to Notepad++ for Find/Search and Replace dialog box comparisons. From top to bottom.

    0.1 De-modalize: The others are not modal and it is a nuisance. bpo-24760 is about same for Config dialog. bpo-24813 for Help stuff. I should look at your patches now.

    0.2 List under Windows menu so easier to bring to top to use or close. Currently, cannot access Windows menu or anything else do to modality. Fortunately, Windows does list on popup expansion of taskbar icon.

    1.0 Title: delete obvious "Dialog", add file base name. I sometime forget which file Search box is attached to and waste time searching wrong file. Will get worse with multiple boxes.

    1.1 With tk, can we delete [-] min and [[]] max buttons and leave [X] close button? They are not present for 4 apps with floating boxes. bpo-24039 is about inconsistent behavior of these buttons. If deleting them is a possible solution, I want to consider it.

    1. I do not see 'whitespace around gray widgets', but I don't think I need to. I do see widgets jammed against edges and agree space is needed. Framing will also be wanted, I expect, as a pane for future single big window version of IDLE.

    I just noticed that TortoiseHg has 4 options for its main pane, Search being one of them. The 'tabs' are icons in a vertical strip to the right. Search is a magnifying glass. Each has a mouse hover popup word.

    1. Regular expression, Match case, and Whole word modify What to search for, and belong together. Wraparound, Up, and Down modify How to search, and I think also belong together on a line. Grid would be 4 columns for these.

    4.1 Close button should be at bottom or to the right. L.O.Write has [Help] and [Close] to bottom left and right respectively. I want to consider this. We could add a new parameter 'start_at' to help.py classes, defaulting to the top. "if start_at: <simulate TOC click>" Then [Help] would display a new section "Search and Replace" added to the idle.rst and hence help.html. 'Find' is non-overlapping. 'Relational expression' uses patterns as defined in re doc. I have found 'whole word' not as obvious as I expected. It should have an explicit definition and behavior to match. Ditto for 'Match case' in a unicode world.

    4.2 Putting the 4 F & R buttons across the bottom on platforms where that is the norm is OK with me. I only see down the side so far on Windows. Search could (should?) have [Find all] in addition to [Find next]. The 4 F & R buttons could be Find, Find all, Replace, Replace all (L.O.Write). But behavior change should be different issue.

    @terryjreedy terryjreedy changed the title IDLE: Switch dialogs to ttk widgets. IDLE: Switch search dialogs to ttk widgets, and other refinement Jul 31, 2016
    @terryjreedy terryjreedy self-assigned this Jul 31, 2016
    @roseman
    Copy link
    Mannequin

    roseman mannequin commented Aug 1, 2016

    Have attached search.diff, which does an initial bit of cosmetics: adds inner frame with spacing, tweaks a couple labels, and for Mac and X11, puts the command buttons at the bottom of the dialog rather than on the right (where they remain on Windows).

    @terryjreedy
    Copy link
    Member Author

    By adding 'and other refinements' to the title and discussing them here, I made this an index issue, with dependencies, for search. I am leaving this open as that.

    bpo-33987 is about adding a ttk frame inside the top window. This is point 2 above. bpo-33987 has a Mac screen capture in which I can see the faint difference there.

    I am retracting 4.2 above, agreeing to move action buttons across the bottom on some systems. Given that there are people who use IDLE on multiple systems, either sequentially or more or less simultaneously, and there are, there is good reason for cross-platform consistency. This is the general IDLE policy, with limited exceptions. In any case, such a change would need to be discussed on a separate issue with more people involved.

    Besides this, horizontal arrangement does not work for more than about 4 action options, and I want to add more.

    @terryjreedy terryjreedy added 3.7 (EOL) end of life 3.8 only security fixes labels Dec 11, 2018
    @terryjreedy
    Copy link
    Member Author

    5.0 History list? 1 for all boxes; start fresh each session

    @roseman
    Copy link
    Mannequin

    roseman mannequin commented Oct 22, 2020

    Just noting that the current search dialogs (and others) do not have a ttk.Frame directly inside the toplevel which encloses all other widgets. They therefore still display the mismatched backgrounds on macOS.

    Given that, should bpo-33987 be reopened? The patches seem to change the existing frames to the ttk equivalent, but don't add the new intervening frame.

    @terryjreedy
    Copy link
    Member Author

    bpo-33987 was reopened, 4 patches merged and backported, and reclosed.
    This is only open for other possible refinements listed above.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.7 (EOL) end of life 3.8 only security fixes topic-IDLE type-feature A feature request or enhancement
    Projects
    Status: No status
    Development

    No branches or pull requests

    1 participant