Re: A TkPath question

Liste des GroupesRevenir à cl tcl 
Sujet : Re: A TkPath question
De : gregor.ebbing (at) *nospam* gmx.de (greg)
Groupes : comp.lang.tcl
Date : 11. Oct 2024, 05:20:51
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vea933$3hj2d$1@dont-email.me>
References : 1
User-Agent : Mozilla Thunderbird
Am 10.10.24 um 21:17 schrieb Helmut Giese:
Hello out there,
I very much like TkPath and am trying to implement some control
widgets based on it. But I stumbled upon a problem: It seems that
there is no TkPath equivalent to the 'arc' command of the regular Tk
canvas. Below is a simplified example from the TkLib's
'controlwidgets' package:
----
package require Tk
package require tkpath
 proc mkGUI {parent} {
     set dialcolor lightgreen
     set width   [$c cget -width]
     set xcentre [expr {$width*0.5}]
     set ycentre [expr {$width*1.4}]
     set  t 1.15
      set c [tkp::canvas $parent.c -width 250 -height 150 \
     -background gray50]
     pack $c
     $c create arc \
        [expr {$xcentre-$width*$t}] [expr {$ycentre-$width*$t}] \
        [expr {$xcentre+$width*$t}] [expr {$ycentre+$width*$t}] \
        -start 70.5 -extent 37 -style arc -outline $dialcolor \
        -width [expr {$ycentre*0.245}]
      return $c
}
set c [mkGUI ""]
----
Any ideas how to accomplish the same with TkPath would be highly
appreciated.
Helmut
Hello,
only the order changed
package require Tk
package require tkpath
proc mkGUI {parent} {
     set dialcolor lightgreen
     set c [tkp::canvas $parent.c -width 250 -height 150 -background gray50]
     pack $c
     set width   [$c cget -width]
     set xcentre [expr {$width * 0.5}]
     set ycentre [expr {$width*1.4}]
     set  t 1.15
      $c create arc \
        [expr {$xcentre-$width*$t}] [expr {$ycentre-$width*$t}] \
        [expr {$xcentre+$width*$t}] [expr {$ycentre+$width*$t}] \
        -start 70.5 -extent 37 -style arc -outline $dialcolor \
        -width [expr {$ycentre*0.245}]
     return $c
}
set c [mkGUI .]

Date Sujet#  Auteur
10 Oct 24 * A TkPath question3Helmut Giese
10 Oct 24 +- Re: A TkPath question1Helmut Giese
11 Oct 24 `- Re: A TkPath question1greg

Haut de la page

Les messages affichés proviennent d'usenet.

NewsPortal