Bwidget Source Code
View Ticket
Not logged in
Ticket UUID: acbd67752a34aae10ad154662de43fa311e295e7
Title: NoteBook tab drawing not updated when used font changes
Type: Bug Version: trunk
Submitter: oehhar Created on: 2021-08-05 09:58:37
Subsystem: bwidget 1.x Assigned To: nobody
Priority: 5 Medium Severity: Minor
Status: Closed Last Modified: 2021-12-03 08:40:28
Resolution: Fixed Closed By: oehhar
    Closed on: 2021-12-03 08:40:28
Description:

The tab is not redrawn if the font used in the tab label changes.

Example

font create TitleFont -size 20
pack [NoteBook .n -font TitleFont] -fill both -expand true
.n insert 0 p1 -text ABC
update
font configure TitleFont -size 40

-----

This issue may be solved using the <<TkWorldChanged>> event in Tk ticket https://core.tcl-lang.org/tk/info/1e04d669539944b0.

The required patch in notebook.tcl is:

bind NoteBook <<TkWorldChanged>> [list NoteBook::_worldchanged  %W %d]
proc NoteBook::_worldchanged { path type} {
    if {$type == "FontChanged"} {
        _compute_height $path
        _compute_width $path
        _redraw $path
    }
}

User Comments: oehhar added on 2021-12-03 08:40:28:

MainFrame now fixed with commit [6b1f3c9f9b].

Closing bug. Thanks to Brian for implementing TkWorldChange in Tk.

This works from Tk 8.6.12 and later.


oehhar added on 2021-12-03 08:38:55:

Mainframe issue also solved by checkin [6b1f3c9f9b].

Closing bug. As a side note, this works starting with Tk 8.6.12 or Tk 8.7a6.

Thanks specially to Brian for implementing TkWorldChange in Tk.

Harald


oehhar added on 2021-09-20 11:29:35:

The MainFrame widget has a similar issue with the status line.


oehhar added on 2021-08-06 07:14:55:

The patch is now in branch bwidget with commit [16dd153a08].