Menu

#245 "Font" option configuration for selected page of NoteBook

open-postponed
bwidget 1.x (1)
5
2011-08-22
2011-07-29
No

In documentation for BWidget it is stated that with "itemconfigure" command user can query/modify any option that can be used during NoteBook widget creation.
With current version of BWidget (1.9.5) there is no possibility to change "-font" option for single page.
I've made few modifications to file "notebook.tcl", and right now it is possible to do that.
Modified file is attached to this report - maybe it is worth to include it in official release.

Best regards to all,
Michal.

Discussion

  • Michal Sosnowski

    Modified NoteBook script, which allows "-font" option manipulation for single NoteBook page.

     
  • Harald Oehlmann

    Harald Oehlmann - 2011-08-14

    Michal,
    thank you for the contribution.
    I was on holiday. Will look to your patch propably next week.
    Regards,
    Harald

     
  • Harald Oehlmann

    Harald Oehlmann - 2011-08-22

    I have tried the patch.
    Unfortunately, it breaks compatibility for me.
    - up to now, the font of the tabs was controled by the font attribute of the notebook or by the property *NoteBook.font

    Thus the font might be set by one of the following test scripts:
    <CODE>
    font create F16 -size 16
    pack [NoteBook .n -font F16] -fill both -expand true
    .n insert end a -text a
    </CODE>
    or
    <CODE>
    font create F16 -size 16
    option add *NoteBook.font F16
    pack [NoteBook .n] -fill both -expand true
    .n insert end a -text a
    </CODE>

    unfortunately, this is does not working any more.
    Instead, one may use:
    <CODE>
    font create F16 -size 16
    pack [NoteBook .n] -fill both -expand true
    .n insert end a -text a -font F16
    </CODE>

    I would favor for the change, if the current methods would still work and if the additional option may change the font from this default for the current tab only.

    IMHO, code should be added to transfer the default font, if the font option is not given.

    Sorry,
    Harald

     
  • Harald Oehlmann

    Harald Oehlmann - 2011-08-22
    • status: open --> open-postponed
     
  • Michal Sosnowski

    Hello Harald!
    Sorry for such late response - I was on vacation with limited access to the Internet.
    I was rather thinking about possibility to change font of each tab individaully - for example bolded font for currently selected tab.
    What you've wrote is true - with my modification property *NoteBook.font will not work - since it sets font for the whole widget - I didn't think about that.

    Anyway, thanks for looking into this issue.

    Best regards,
    Michal.

     
  • Harald Oehlmann

    Harald Oehlmann - 2011-09-05

    IMHO it is possible to make both work.
    Set and modify the default font of all tabs
    - by the -font option of the widget
    - by the option data base key (*NoteBook.font)
    Have an own font for a page as page option
    - If no page font is used, the default should be used
    (specially tricky, if the default font is changed later by widget configuration)
    - If a page font is used, use this one for this page.

    Prpably, an additional page property is needed, which is the empty string by default. In this case, use the default font, otherwise use this font.

    Please modify the patch to
    - keep compatibility
    - get your requirements work

    Thank you for your contribution!
    Harald

     
Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.