• Using Tcl with electronic invoicing ?

    From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 09:30:00 2026
    From Newsgroup: comp.lang.tcl


    Hello,

    Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
    packages such an xlm parser ?

    Thanks, Olivier.

    ** UBL is the acronym for Universal Business Language, it becomes mandatory
    to use it to emit and receive invoices in B2B in some countries. It is xlm formated.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Mon Oct 5 11:46:00 2026
    From Newsgroup: comp.lang.tcl

    Am 05.10.2026 um 11:30 schrieb Olivier:

    Hello,

    Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
    packages such an xlm parser ?

    Thanks, Olivier.

    ** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.

    Alexander Schöpe has done some work here and embedded an elecronic
    invoice in two formats into a PDF.

    https://fossil.sowaswie.de/tclpdf/index
    Just an idea,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Mon Oct 5 11:50:14 2026
    From Newsgroup: comp.lang.tcl

    I am probably very blind.

    Buttons with multiple text lines:

    pack [button .b2 -justify center -text ABC\nD]

    may use the -justify option to center the lines.

    Now ttk:
    pack [ttk::button .b2 -justify center -text ABC\nD]
    no option justify

    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    no effect.

    Is there a way to center the text?

    This is Style Vista on MS-Windows...

    Thanks for any idea,
    Harald

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 12:58:28 2026
    From Newsgroup: comp.lang.tcl


    Harald Oehlmann <[email protected]> posted:

    Am 05.10.2026 um 11:30 schrieb Olivier:


    Alexander Schöpe has done some work here and embedded an elecronic
    invoice in two formats into a PDF.

    https://fossil.sowaswie.de/tclpdf/index
    Just an idea,
    Harald

    I was aware of tclpdf improvements, but I did not see there was invoicing included.
    It uses Factur-X format, which is in fact pdf + xlm in one document.
    UBL is simpler as it uses only xlm. But the structure of tclpdf, is interesting as a tool to manage a lot of things : proposal, specifications, invoices...
    I will have a look and see how it works.

    Thank you,

    Olivier
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 14:19:57 2026
    From Newsgroup: comp.lang.tcl


    Harald Oehlmann <[email protected]> posted:

    I am probably very blind.


    I don't know but I "moved" your question in a new thread ! It landed here by error ?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Mon Oct 5 16:44:20 2026
    From Newsgroup: comp.lang.tcl

    Am 05.10.2026 um 16:19 schrieb Olivier:

    Harald Oehlmann <[email protected]> posted:

    I am probably very blind.


    I don't know but I "moved" your question in a new thread ! It landed here by error ?

    Yes, it was me. I have replied on the Message and changed the title.
    But the (hidden) thread-ID was still there.
    Will do better next time.

    Soryy,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 15:30:46 2026
    From Newsgroup: comp.lang.tcl


    Harald Oehlmann <[email protected]> posted:


    Yes, it was me. I have replied on the Message and changed the title.
    But the (hidden) thread-ID was still there.
    Will do better next time.

    Soryy,
    Harald

    You are welcome. By the way in thread "Why I'm reverting from Tcl/Tk 9.1.0 to Tcl/Tk 9.0.3",

    it seems to have a clue for theproblem you encountered :

    "There are other blocking known bugs in 9.1.0 like the non-functioning "-justify" in ttk widgets."

    Olivier.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From saito@[email protected] to comp.lang.tcl on Mon Oct 5 11:54:16 2026
    From Newsgroup: comp.lang.tcl

    On 10/5/2026 5:30 AM, Olivier wrote:

    Hello,

    Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
    packages such an xlm parser ?



    Do you have a sample document? What exactly is it you are interested in? Parsing one, creating one, exchanging one, etc.?
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Mon Oct 5 19:13:54 2026
    From Newsgroup: comp.lang.tcl

    Am 05.10.26 um 11:50 schrieb Harald Oehlmann:
    I am probably very blind.

    Buttons with multiple text lines:

    pack [button .b2 -justify center -text ABC\nD]

    may use the -justify option to center the lines.

    Now ttk:
    pack [ttk::button .b2 -justify center -text ABC\nD]
    no option justify

    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    no effect.

    Is there a way to center the text?

    This is Style Vista on MS-Windows...

    Thanks for any idea,
    Harald

    Harald, your statements regarding the ttk::button widget are not
    correct. The following works for me as expected with the vista theme,
    with both Tk 9.0 and 9.1:

    # ttk::button has no -anchor option but supports the -justify option.
    pack [ttk::button .b2 -justify center -text ABC\nD]

    # The custom.Toolbutton style supports the -anchor option.
    ttk::style configure custom.Toolbutton -anchor center
    pack [ttk::button .b -style custom.Toolbutton -justify center -text centered\n2]

    Note that here we combine the -anchor *styling* option with the -justify *widget* option. With Tk 9.1 there is also a -justify *styling* option,
    hence the 2nd block above can be replaced with:

    # The custom.Toolbutton style supports the -anchor and -justify options. ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From =?UTF-8?Q?Alexander_Sch=C3=B6pe?=@[email protected] to comp.lang.tcl on Mon Oct 5 20:17:48 2026
    From Newsgroup: comp.lang.tcl

    Am 05.10.26 um 11:30 schrieb Olivier:

    Hello,

    Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
    packages such an xlm parser ?

    Thanks, Olivier.

    ** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.

    Hi Olivier,

    For XML in Tcl, tDOM is the first choice. It handles namespaced XML
    such as UBL well, both for parsing (XPath via selectNodes) and for
    generating documents.

    If you also need hybrid invoices: my package tclpdf supports embedding
    XML files into PDF/A in a standards-compliant way, e.g. ZUGFeRD /
    Factur-X. https://fossil.sowaswie.de/tclpdf/wiki?name=examples

    Alex
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 18:38:00 2026
    From Newsgroup: comp.lang.tcl


    saito <[email protected]> posted:


    Do you have a sample document? What exactly is it you are interested in? Parsing one, creating one, exchanging one, etc.?

    Hm, I did not want to take time from others as UBL is a fairly complex format : https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html

    I am interested to know if anyone has already edited such xlm document with standard extension or package, to try to replicate his/her approach and not reinvent
    the wheel. If not I will do it in pure Tcl.
    The problem is not technical, but the whole semantic around. Here is a simple example
    of an invoice taken from https://github.com/Tradeshift/tradeshift-ubl-examples/tree/master/src/main/resources/org/oasis-open/ubl/examples

    (UBL-Invoice-2.1-Example-Trivial.xml a very very simple example )

    <?xml version="1.0" encoding="UTF-8"?>
    <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2"
    xmlns:cac="urn:oasis:names:specification:ubl:schema:xsd:CommonAggregateComponents-2"
    xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2">

    <cbc:ID>123</cbc:ID>
    <cbc:IssueDate>2011-09-22</cbc:IssueDate>

    <cac:InvoicePeriod>
    <cbc:StartDate>2011-08-01</cbc:StartDate>
    <cbc:EndDate>2011-08-31</cbc:EndDate>
    </cac:InvoicePeriod>

    <cac:AccountingSupplierParty>
    <cac:Party>
    <cac:PartyName>
    <cbc:Name>Custom Cotter Pins</cbc:Name>
    </cac:PartyName>
    </cac:Party>
    </cac:AccountingSupplierParty>
    <cac:AccountingCustomerParty>
    <cac:Party>
    <cac:PartyName>
    <cbc:Name>North American Veeblefetzer</cbc:Name>
    </cac:PartyName>
    </cac:Party>
    </cac:AccountingCustomerParty>

    <cac:LegalMonetaryTotal>
    <cbc:PayableAmount currencyID="CAD">100.00</cbc:PayableAmount>
    </cac:LegalMonetaryTotal>

    <cac:InvoiceLine>
    <cbc:ID>1</cbc:ID>
    <cbc:LineExtensionAmount currencyID="CAD">100.00</cbc:LineExtensionAmount>
    <cac:Item>
    <cbc:Description>Cotter pin, MIL-SPEC</cbc:Description>
    </cac:Item>
    </cac:InvoiceLine>

    </Invoice>
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Mon Oct 5 18:49:12 2026
    From Newsgroup: comp.lang.tcl


    =?UTF-8?Q?Alexander_Sch=C3=B6pe?= <[email protected]> posted:

    Am 05.10.26 um 11:30 schrieb Olivier:

    Hello,

    Has anyone dealt, and succeeded, in interfacing Tcl with UBL** format using current extensions or
    packages such an xlm parser ?

    Thanks, Olivier.

    ** UBL is the acronym for Universal Business Language, it becomes mandatory to use it to emit and receive invoices in B2B in some countries. It is xlm formated.

    Hi Olivier,

    For XML in Tcl, tDOM is the first choice. It handles namespaced XML
    such as UBL well, both for parsing (XPath via selectNodes) and for
    generating documents.

    If you also need hybrid invoices: my package tclpdf supports embedding
    XML files into PDF/A in a standards-compliant way, e.g. ZUGFeRD /
    Factur-X. https://fossil.sowaswie.de/tclpdf/wiki?name=examples

    Alex

    Thank you, I will take more than a look !! The paradox is that the UBL
    format is easier to handle than pdf , since it is only text, but accountants are proposing layer of layer of tools, sometimes AI, and this makes
    me nervous about it. Factur-X could very useful for firms outside Europe,
    or consumers in France.

    Olivier.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Rich@[email protected] to comp.lang.tcl on Mon Oct 5 18:51:36 2026
    From Newsgroup: comp.lang.tcl

    Olivier <[email protected]d> wrote:

    saito <[email protected]> posted:


    Do you have a sample document? What exactly is it you are interested in?
    Parsing one, creating one, exchanging one, etc.?

    Hm, I did not want to take time from others as UBL is a fairly complex format :
    https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html

    I am interested to know if anyone has already edited such xlm document with standard extension or package, to try to replicate his/her approach and not reinvent
    the wheel. If not I will do it in pure Tcl.

    tDom (https://www.tdom.org/index.html/dir?ci=521ed5326479ed83) is an
    excellent extension for the handling/editing/creating of XML data.
    However it is a compiled extension so if you must have "pure Tcl" it
    won't match that requirement.

    Just be forwarned if you do go the "do it yourself" approach. XML
    appears simple on its face, but the totality of the spec. is anything
    but simple. Handling all the spec. compliant edge conditions is a lot
    of effort.

    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From saito@[email protected] to comp.lang.tcl on Mon Oct 5 15:22:18 2026
    From Newsgroup: comp.lang.tcl

    On 10/5/2026 2:38 PM, Olivier wrote:

    saito <[email protected]> posted:


    Do you have a sample document? What exactly is it you are interested in?
    Parsing one, creating one, exchanging one, etc.?

    Hm, I did not want to take time from others as UBL is a fairly complex format :
    https://docs.oasis-open.org/ubl/os-UBL-2.1/UBL-2.1.html

    I am interested to know if anyone has already edited such xlm document with standard extension or package, to try to replicate his/her approach and not reinvent
    the wheel. If not I will do it in pure Tcl.
    The problem is not technical, but the whole semantic around. Here is a simple example
    of an invoice taken from https://github.com/Tradeshift/tradeshift-ubl-examples/tree/master/src/main/resources/org/oasis-open/ubl/examples

    (UBL-Invoice-2.1-Example-Trivial.xml a very very simple example )


    Thanks. I didn't have time at the moment so some basic cursory info
    would have been helpful. I did look it up during lunch. I found these
    sites which you may be familiar with already: https://peppol.org/ and https://e-invoice.be/blog/ubl-format-guide#document-structure

    I have a tool that makes these operations quite easy. Unfortunately it
    is not a package or something that can be ripped out easily.

    BTW, you keep typing "xlm" vs. "xml". A typo or are we all missing
    something?


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Mon Oct 5 22:03:38 2026
    From Newsgroup: comp.lang.tcl

    Great, thanks!
    I was reading all the documentation and did not find this.

    Sorry and thanks again,
    Harald

    Am 05.10.2026 um 19:13 schrieb nemethi:
    Am 05.10.26 um 11:50 schrieb Harald Oehlmann:
    I am probably very blind.

    Buttons with multiple text lines:

    pack [button .b2 -justify center -text ABC\nD]

    may use the -justify option to center the lines.

    Now ttk:
    pack [ttk::button .b2 -justify center -text ABC\nD]
    no option justify

    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    no effect.

    Is there a way to center the text?

    This is Style Vista on MS-Windows...

    Thanks for any idea,
    Harald

    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista theme,
    with both Tk 9.0 and 9.1:

    # ttk::button has no -anchor option but supports the -justify option.
    pack [ttk::button .b2 -justify center -text ABC\nD]

    # The custom.Toolbutton style supports the -anchor option.
    ttk::style configure custom.Toolbutton -anchor center
    pack [ttk::button .b -style custom.Toolbutton -justify center -text centered\n2]

    Note that here we combine the -anchor *styling* option with the -justify *widget* option.  With Tk 9.1 there is also a -justify *styling* option, hence the 2nd block above can be replaced with:

    # The custom.Toolbutton style supports the -anchor and -justify options. ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 07:58:26 2026
    From Newsgroup: comp.lang.tcl

    Am 05.10.2026 um 19:13 schrieb nemethi:
    # The custom.Toolbutton style supports the -anchor and -justify options. ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]


    Great !

    Documentation of 9.1:
    https://www.tcl-lang.org/man/tcl9.1/TkCmd/ttk_button.html
    Under "STYLING OPTIONS".

    Is "-justify" missing here?

    Thanks for all,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 08:04:22 2026
    From Newsgroup: comp.lang.tcl



    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista theme,
    with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Olivier@[email protected] to comp.lang.tcl on Tue Oct 6 08:03:03 2026
    From Newsgroup: comp.lang.tcl


    Rich <[email protected]d> posted:


    Just be forwarned if you do go the "do it yourself" approach. XML
    appears simple on its face, but the totality of the spec. is anything
    but simple. Handling all the spec. compliant edge conditions is a lot
    of effort.


    I agree, and in that case I will approach differently than using forms, but editing a validated template and changing the content inside a
    <tag></tag> couple, but, yes, I am afraid that the "compliant edge conditions is a lot
    of effort." if this tag is not unique.
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 11:28:37 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.2026 um 08:04 schrieb Harald Oehlmann:


    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista theme,
    with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald
    Thanks Csaba. All this is now on:

    https://wiki.tcl-lang.org/page/ttk%3A%3Abutton?V=21

    Thanks for all,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 11:55:48 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.2026 um 11:28 schrieb Harald Oehlmann:
    Am 06.10.2026 um 08:04 schrieb Harald Oehlmann:


    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista
    theme, with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald
    Thanks Csaba. All this is now on:

    https://wiki.tcl-lang.org/page/ttk%3A%3Abutton?V=21

    Thanks for all,
    Harald

    And here is the tk ticket:

    https://core.tcl-lang.org/tk/info/6838d62c7088d6b9

    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Tue Oct 6 18:03:59 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.26 um 08:04 schrieb Harald Oehlmann:


    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista theme,
    with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald


    The TButton and Toolbutton styles have always supported the -justify
    styling option. Unfortunately, the vista theme ignored it in Tk
    versions 9.0.x (this was probably due to a bug). OTOH, most (or even
    all?) other built-in themes have always honored this option, and so did,
    e.g., awlight, awdark, and droid.

    Hence the answer to your question is: On AndroWish just use the
    -justify styling option.
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 20:25:55 2026
    From Newsgroup: comp.lang.tcl

    The TButton and Toolbutton styles have always supported the -justify
    styling option.  Unfortunately, the vista theme ignored it in Tk
    versions 9.0.x (this was probably due to a bug).  OTOH, most (or even
    all?) other built-in themes have always honored this option, and so did, e.g., awlight, awdark, and droid.

    Hence the answer to your question is:  On AndroWish just use the -
    justify styling option.


    Thanks, great !!!!
    This was never documented. I propose to document it.
    Is there a rationale why the command option -justify was added in Tk9.0?

    To many questions, sorry,
    Harald


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Tue Oct 6 20:51:08 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.2026 um 18:03 schrieb nemethi:
    Am 06.10.26 um 08:04 schrieb Harald Oehlmann:


    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista
    theme, with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald


    The TButton and Toolbutton styles have always supported the -justify
    styling option.  Unfortunately, the vista theme ignored it in Tk
    versions 9.0.x (this was probably due to a bug).  OTOH, most (or even
    all?) other built-in themes have always honored this option, and so did, e.g., awlight, awdark, and droid.

    Hence the answer to your question is:  On AndroWish just use the -
    justify styling option.


    I have made some tests:

    T1) vista theme, toolbutton

    ttk::style theme use vista
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T2) alt theme, toolbutton


    ttk::style theme use alt
    update
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T3) vista theme, button

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: no, 9.0: no, 9.1: no

    T4) alt theme, button

    ttk::style theme use alt
    update
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: no, 9.0: no, 9.1: no

    T5) vista theme, button, command line option

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2 -justify center]

    Tk 8.6: invalid option, 9.0: yes, 9.1: no effect

    So, to resume:
    - styling option, with Toolbutton: works except 9.0
    - styling option with TButton: no effect at all
    - command option: only effect in 9.0
    I think, a bug ticket would be great...

    Thanks,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Tue Oct 6 21:52:14 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.26 um 20:51 schrieb Harald Oehlmann:
    Am 06.10.2026 um 18:03 schrieb nemethi:
    Am 06.10.26 um 08:04 schrieb Harald Oehlmann:


    Am 05.10.2026 um 19:13 schrieb nemethi:
    Harald, your statements regarding the ttk::button widget are not
    correct.  The following works for me as expected with the vista
    theme, with both Tk 9.0 and 9.1:
    Yes, -justify was added in 9.0.

    Do you have any solution for 8.6 (I am on Androwish)?

    Thanks for all,
    Harald


    The TButton and Toolbutton styles have always supported the -justify
    styling option.  Unfortunately, the vista theme ignored it in Tk
    versions 9.0.x (this was probably due to a bug).  OTOH, most (or even
    all?) other built-in themes have always honored this option, and so
    did, e.g., awlight, awdark, and droid.

    Hence the answer to your question is:  On AndroWish just use the -
    justify styling option.


    I have made some tests:

    T1) vista theme, toolbutton

    ttk::style theme use vista
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T2) alt theme, toolbutton


    ttk::style theme use alt
    update
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T3) vista theme, button

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: no, 9.0: no, 9.1: no

    T4) alt theme, button

    ttk::style theme use alt
    update
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: no, 9.0: no, 9.1: no

    T5) vista theme, button, command line option

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2 -justify center]

    Tk 8.6: invalid option, 9.0: yes, 9.1: no effect

    So, to resume:
    - styling option, with Toolbutton: works except 9.0
    - styling option with TButton: no effect at all
    - command option: only effect in 9.0
    I think, a bug ticket would be great...

    Thanks,
    Harald

    Invoking "ttk::style configure custom.TButton ..." and then creating a
    button of the *different* style custom.Toolbutton doesn't make much
    sense! Make sure that the button has the same style!
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Wed Oct 7 08:59:48 2026
    From Newsgroup: comp.lang.tcl

    Am 06.10.2026 um 21:52 schrieb nemethi:
    Invoking "ttk::style configure custom.TButton ..." and then creating a button of the *different* style custom.Toolbutton doesn't make much
    sense!  Make sure that the button has the same style!


    Ok, next try, repeating the last three and correcting results:

    T1) vista theme, toolbutton

    ttk::style theme use vista
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T2) alt theme, toolbutton


    ttk::style theme use alt
    update
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T3) vista theme, button

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.TButton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T4) alt theme, button

    ttk::style theme use alt
    update
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.TButton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T5) vista theme, button, command line option

    ttk::style theme use vista
    pack [ttk::button .b -text centered\n2 -justify center]

    Tk 8.6: invalid option, 9.0: ok, 9.1: no effect

    So, the results are:
    -justify styling option: ok on 8.6 and 9.1, no effect on 9.0
    -justify command option: ok on 9.0, no effect on 9.1

    Does this sounds reasonable?

    Thanks for all,
    Harald


    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From nemethi@[email protected] to comp.lang.tcl on Wed Oct 7 12:19:52 2026
    From Newsgroup: comp.lang.tcl

    Am 07.10.26 um 08:59 schrieb Harald Oehlmann:
    Am 06.10.2026 um 21:52 schrieb nemethi:
    Invoking "ttk::style configure custom.TButton ..." and then creating a
    button of the *different* style custom.Toolbutton doesn't make much
    sense!  Make sure that the button has the same style!


    Ok, next try, repeating the last three and correcting results:

    T1) vista theme, toolbutton

    ttk::style theme use vista
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T2) alt theme, toolbutton


    ttk::style theme use alt
    update
    ttk::style configure custom.Toolbutton -anchor center -justify center
    pack [ttk::button .b -style custom.Toolbutton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T3) vista theme, button

    ttk::style theme use vista
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.TButton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T4) alt theme, button

    ttk::style theme use alt
    update
    ttk::style configure custom.TButton -anchor center -justify center
    pack [ttk::button .b -style custom.TButton -text centered\n2]

    Tk 8.6: ok, 9.0: no, 9.1: ok

    T5) vista theme, button, command line option

    ttk::style theme use vista
    pack [ttk::button .b -text centered\n2 -justify center]

    Tk 8.6: invalid option, 9.0: ok, 9.1: no effect

    So, the results are:
    -justify styling option: ok on 8.6 and 9.1, no effect on 9.0
    -justify command option: ok on 9.0, no effect on 9.1

    Does this sounds reasonable?

    Thanks for all,
    Harald

    Yes, this looks much better. But note that the upcoming Tk versions
    will improve some of these results, due to the many bugfixes of the last
    few weeks. For example, the -justify widget option is no longer ignored
    by the current trunk version of Tk 9.1, and the -justify styling option
    is no longer ignored by Tk 9.0 built from the current core-9-0-branch.
    --
    Csaba Nemethi https://www.nemethi.de mailto:[email protected]
    --- Synchronet 3.22a-Linux NewsLink 1.2
  • From Harald Oehlmann@[email protected] to comp.lang.tcl on Wed Oct 7 14:04:06 2026
    From Newsgroup: comp.lang.tcl

    Am 07.10.2026 um 12:19 schrieb nemethi:
    Yes, this looks much better.  But note that the upcoming Tk versions
    will improve some of these results, due to the many bugfixes of the last
    few weeks.  For example, the -justify widget option is no longer ignored
    by the current trunk version of Tk 9.1, and the -justify styling option
    is no longer ignored by Tk 9.0 built from the current core-9-0-branch.


    Dear Csaba,
    Thank you for all this! My personal issue is now solved.

    Dear all:

    The remaining points are:

    - why is only the command line option documented and not the styling option?

    - why was the command line option "-justify" added in 9.0, if there is a styling option? This makes IMHO little sense, if -anchor is only
    available via styling... Or is -justify seen as part of the label text?
    I think, this is the point.

    Thanks for all,
    Harald
    --- Synchronet 3.22a-Linux NewsLink 1.2