<?xml version="1.0" encoding="utf-8"?><rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
<title>Forum Bauen und Umwelt - Programmierdemo Python 3, Eventhandler von Canvas-Objekten</title>
<link>https://bauforum.wirklichewelt.de/</link>
<description>Das Bauforum</description>
<language>de</language>
<item>
<title>Programmierdemo Python 3, Eventhandler von Canvas-Objekten</title>
<content:encoded><![CDATA[<p>Dieses kleine Pythonprogramm zeigt, wie man diverse Mausereignisse an einzelne Objekte einer Canvasgrafik binden kann. Jedes einzelne Kreisobjekt reagiert auf Mausklicks, erkennt, wann es von der Maus berührt oder wieder verlassen wird, ob es doppelgeklickt oder rechtsgeklickt wird und kontrolliert nebenbei einige Male pro Sekunde, ob es mit einem der anderen Kreisobjekte oder dem Canvasrand kollidiert, selbst wenn dieser sich bei Größenänderungen des Fensters verschiebt. Alle Events werden protokolliert und „live“ angezeigt.</p>
<p><img src="https://bauforum.wirklichewelt.de/images/uploaded/Bild_0I44SA1B1.png" alt="[image]"  /></p>
<p>Download: <a href="images/uploaded/ZIP-Archiv_CHC1LODZ1.zip" target="_blank"><img src="img/zip.png" alt="[image]"  />ZIP-Archiv_CHC1LODZ1.zip</a></p>
<pre class="python" style="font-family:monospace;"><ol><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#!/usr/bin/python3</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Demo für diverse Maus-Events. Auf einer tkinter-Canvas werden einige</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Kreise angeordnet, die jeder für sich auf eine Reihe von Events reagieren.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Zusätzlich wird der Event abgefragt, der bei einer Größenänderung des</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Programmfensters ausgelöst wird und der Inhalt der Canvas entsprechend</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># angepasst.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># In einem zehnzeiligen Textfenster unterhalb der Canvas werden die</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># ausgewerteten Events protokolliert.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Version vom 27. Dezember 2016</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Autor: Martin Vogel, martinvogel.de</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Lizenz: cc-by-3.0 https://creativecommons.org/licenses/by/3.0/de/</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;">#</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> tkinter <span style="color: #ff7700;">import</span> Tk<span style="color: #000;">,</span> Canvas</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> tkinter.<span style="color: black;">scrolledtext</span> <span style="color: #ff7700;">import</span> <span style="color: #dc143c;">ScrolledText</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> <span style="color: #dc143c;">random</span> <span style="color: #ff7700;">import</span> randint</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">from</span> <span style="color: #dc143c;">math</span> <span style="color: #ff7700;">import</span> hypot</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Das Hauptfenster ist in der Größe veränderlich, soll aber eine Mindestgröße</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># von 400×400 Pixeln nicht unterschreiten.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T <span style="color: #000;">=</span> Tk<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">title</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;Bewege die Kreise mit der Maus!&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">minsize</span><span style="color: black;">&#40;</span>width<span style="color: #000;">=</span><span style="color: #008;">400</span><span style="color: #000;">,</span> height<span style="color: #000;">=</span><span style="color: #008;">400</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Die Zeichenfläche ist anfangs 600×300 Pixel groß, hat einen weißen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Hintergrund und soll keinen Rand für die Fokusanzeige reservieren.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">C <span style="color: #000;">=</span> Canvas<span style="color: black;">&#40;</span>T<span style="color: #000;">,</span> width<span style="color: #000;">=</span><span style="color: #008;">600</span><span style="color: #000;">,</span> height<span style="color: #000;">=</span><span style="color: #008;">300</span><span style="color: #000;">,</span> bg<span style="color: #000;">=</span><span style="color: #080;">&quot;white&quot;</span><span style="color: #000;">,</span> highlightthickness<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Bei Änderungen des Hauptfensters soll sich die Canvas anpassen.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">C.<span style="color: black;">pack</span><span style="color: black;">&#40;</span>expand<span style="color: #000;">=</span><span style="color: #808;">True</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span><span style="color: #080;">&quot;both&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Das Textfenster unterhalb der Canvas ist 10 Zeilen hoch.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Protokoll <span style="color: #000;">=</span> <span style="color: #dc143c;">ScrolledText</span><span style="color: black;">&#40;</span>T<span style="color: #000;">,</span> height<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Der Text soll immer die ganze Fensterbreite einnehmen.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Protokoll.<span style="color: black;">pack</span><span style="color: black;">&#40;</span>fill<span style="color: #000;">=</span><span style="color: #080;">&quot;x&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> protokolliere<span style="color: black;">&#40;</span>s<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;Hängt eine neue Zeile ans Protokoll an.&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Kurioserweise lässt sich die Zeilenzahl des Textfensters nicht</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># einfach auslesen. Wir ermitteln sie durch Abfragen der Position</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># der Endemarke.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    zeilenzahl <span style="color: #000;">=</span> <span style="color: #808;">int</span><span style="color: black;">&#40;</span>Protokoll.<span style="color: black;">index</span><span style="color: black;">&#40;</span><span style="color: #080;">'end'</span><span style="color: black;">&#41;</span>.<span style="color: black;">split</span><span style="color: black;">&#40;</span><span style="color: #080;">'.'</span><span style="color: black;">&#41;</span><span style="color: black;">&#91;</span><span style="color: #008;">0</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>-<span style="color: #008;">1</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Ans Ende scrollen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Protokoll.<span style="color: black;">see</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;end&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Einfügen der neuen Zeile am Ende des Textfeldes.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Protokoll.<span style="color: black;">insert</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;end&quot;</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;Event %i: %sn&quot;</span> % <span style="color: black;">&#40;</span>zeilenzahl<span style="color: #000;">,</span> s<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Alle Kreis-Instanzen werden in dieser Liste gespeichert.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">Kreise <span style="color: #000;">=</span> <span style="color: black;">&#91;</span><span style="color: black;">&#93;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">class</span> Kreis:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Ein Canvas-Objekt, das auf Mausereignisse reagiert und Kollisionen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">    mit anderen Kreisen oder den Canvasgrenzen erkennt.&quot;&quot;&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> x<span style="color: #000;">,</span> y<span style="color: #000;">,</span> farbe<span style="color: #000;">=</span><span style="color: #080;">&quot;red&quot;</span><span style="color: #000;">,</span> radius<span style="color: #000;">=</span><span style="color: #008;">10</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">x</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">y</span> <span style="color: #000;">=</span> x<span style="color: #000;">,</span> y</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">radius</span> <span style="color: #000;">=</span> radius</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">farbe</span> <span style="color: #000;">=</span> farbe</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Der Kreis merkt sich seine Canvas-ID.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">ID</span> <span style="color: #000;">=</span> C.<span style="color: black;">create_oval</span><span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">0</span><span style="color: #000;">,</span> fill<span style="color: #000;">=</span>farbe<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Lage und Größe festlegen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">aktualisiere_position</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Der Kreis reagiert auf acht verschiedene Mausereignisse:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 1. Bewegung der Maus, während der Mauszeiger den Kreis berührt</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Motion&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">ber</span>ühren<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 2. Klicken der linken Maustaste</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Button-1&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">anklicken</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 3. Ziehen mit gedrückter linker Maustaste</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;B1-Motion&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">bewegen</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 4. Loslassen der linken Maustaste</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;ButtonRelease-1&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">loslassen</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 5. Drücken der rechten Maustaste</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Button-3&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">rechtsklicken</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 6. Beginn der Berührung durch den Mauszeiger</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Enter&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">betreten</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 7. Ende der Berührung durch den Mauszeiger</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Leave&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">verlassen</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># 8. Doppelklick mit der linken Maustaste</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">tag_bind</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> <span style="color: #080;">&quot;&lt;Double-Button-1&gt;&quot;</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">doppelklicken</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Wenn demnächst mal nichts los ist, bitte einen Test auf Kollision</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># mit den anderen Kreisen durchführen:</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">after_idle</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">kollisionstest</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> aktualisiere_position<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;&quot;&quot;Setzt den Kreis auf seine neuen Koordinaten self.x und self.y.&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Die Koordinaten ggf. auf die Zeichenfläche zurückholen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">randkontrolle</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Canvas-Objekt umsetzen.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Der Kreis wird durch sein umhüllendes Quadrat definiert.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">coords</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 <span style="color: #808;">self</span>.<span style="color: black;">x</span>-<span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">y</span>-<span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                 <span style="color: #808;">self</span>.<span style="color: black;">x</span>+<span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">y</span>+<span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> randkontrolle<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;&quot;&quot;Setzt die Kreiskoordinaten auf einen Punkt innerhalb der Canvas.&quot;&quot;&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Die Canvas darf vom Kreis nicht verlassen werden. Der Mittelpunkt</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># muss also mindestens um Radiuslänge vom Rand entfernt sein.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">x</span> <span style="color: #000;">=</span> <span style="color: #808;">min</span><span style="color: black;">&#40;</span><span style="color: #808;">max</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">x</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span> C.<span style="color: black;">winfo_width</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>-<span style="color: #808;">self</span>.<span style="color: black;">radius</span>-<span style="color: #008;">1</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">y</span> <span style="color: #000;">=</span> <span style="color: #808;">min</span><span style="color: black;">&#40;</span><span style="color: #808;">max</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">y</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">radius</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span> C.<span style="color: black;">winfo_height</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>-<span style="color: #808;">self</span>.<span style="color: black;">radius</span>-<span style="color: #008;">1</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> kollisionstest<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;&quot;&quot;Schaut nach, ob sich dieser Kreis mit irdendwelchen anderen Kreisen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">        überschneidet und schiebt in dem Fall beide ein Stückchen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">        auseinander. Wenn die Kreise unterschiedlich groß sind, wird der</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">        kleinere der beiden weiter geschoben als der größere.&quot;&quot;&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Leider kann die Canvas nicht selbst Objektkollisionen erkennen.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Wir müssen uns da in mehreren Schritten annähern.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Die Canvas kann uns mit der Methode &quot;find_overlapping&quot; ein Tupel</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># aller Canvas-Objekte liefern, die ein bestimmtes Rechteck berühren</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># oder sich darin befinden.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Alle zu überprüfenden Kandidaten berühren zunächst das umhüllende</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Rechteck &quot;bbox&quot; dieser Kreis-Instanz. Einige von denen berühren</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># vielleicht auch den Kreis selbst.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        bbox <span style="color: #000;">=</span> C.<span style="color: black;">bbox</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Weil es in diesem Programm möglich ist, Kreise zu löschen, kann</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># es sein, dass diese Methode hier (kollisionstest) nach dem Löschen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># von &quot;self&quot; noch einmal aufgerufen wird. Dann hat bbox den Wert None.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">if</span> bbox:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Falls dieser Kreis nicht gerade von der Canvas gelöscht wurde,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># lassen wir uns die Liste der Canvas-ID-Nummern aller</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Kollisionskandidaten geben.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            Kandidaten <span style="color: #000;">=</span> C.<span style="color: black;">find_overlapping</span><span style="color: black;">&#40;</span>*bbox<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">else</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Ansonsten können wir uns alles weitere sparen.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">return</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Möglicherweise gibt es gar keine Kollisionen. Das sehen wir später</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># daran, dass die Variable &quot;Kollision&quot; immer noch den Wert &quot;False&quot; hat.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Kollision <span style="color: #000;">=</span> <span style="color: #808;">False</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Wir erzeugen eine Liste mit den Instanzen aller Kollisionskandidaten,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># indem wir nachschauen, welche Kreise eine Canvas-ID haben, die sich</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># in der Kandidatenliste befindet, wobei dieser Kreis selbst natürlich</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># nicht eingeschlossen sein darf, und iterieren uns anschließend da</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># durch.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">for</span> K <span style="color: #ff7700;">in</span> <span style="color: black;">&#91;</span>k <span style="color: #ff7700;">for</span> k <span style="color: #ff7700;">in</span> Kreise</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                  <span style="color: #ff7700;">if</span> k.<span style="color: black;">ID</span> <span style="color: #ff7700;">in</span> Kandidaten <span style="color: #ff7700;">and</span> k.<span style="color: black;">ID</span> <span style="color: #000;">!=</span> <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: black;">&#93;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Wie weit sind die Kreismittelpunkte in x- und y-Richtung</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># voneinander entfernt?</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            dx <span style="color: #000;">=</span> <span style="color: #808;">self</span>.<span style="color: black;">x</span>-K.<span style="color: black;">x</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            dy <span style="color: #000;">=</span> <span style="color: #808;">self</span>.<span style="color: black;">y</span>-K.<span style="color: black;">y</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Wie nah dürfen sie sich ohne Berührung kommen?</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            radien <span style="color: #000;">=</span> <span style="color: #808;">self</span>.<span style="color: black;">radius</span>+K.<span style="color: black;">radius</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Wie weit sind die Kreismittelpunkte tatsächlich entfernt?</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            abstand <span style="color: #000;">=</span> hypot<span style="color: black;">&#40;</span>dx<span style="color: #000;">,</span> dy<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Wie weit überlappen sie sich also?</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            überlappung <span style="color: #000;">=</span> radien-abstand</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Wenn sie sich um mindestens ein halbes Pixel überlappen …</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #ff7700;">if</span> überlappung <span style="color: #000;">&gt;=</span> <span style="color: #008;">0.5</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># … dann haben wir eine Kollision.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Das merken wir uns für später.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                Kollision <span style="color: #000;">=</span> <span style="color: #808;">True</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Beide Kreise, self und K, werden nun zurückgeschoben.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Je kleiner der Radius, desto stärker die Verschiebung.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                überlappung_relativ <span style="color: #000;">=</span> überlappung/radien</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                eigenanteil <span style="color: #000;">=</span> überlappung_relativ*<span style="color: black;">&#40;</span>K.<span style="color: black;">radius</span>/radien<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                fremdanteil <span style="color: #000;">=</span> überlappung_relativ*<span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">radius</span>/radien<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Die Verschiebung erfolgt getrennt nach x- und y-Wert.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #808;">self</span>.<span style="color: black;">x</span> +<span style="color: #000;">=</span> dx*eigenanteil</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #808;">self</span>.<span style="color: black;">y</span> +<span style="color: #000;">=</span> dy*eigenanteil</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Der andere Kreis wird entgegengesetzt verschoben.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                K.<span style="color: black;">x</span> -<span style="color: #000;">=</span> dx*fremdanteil</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                K.<span style="color: black;">y</span> -<span style="color: #000;">=</span> dy*fremdanteil</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #800; font-style: italic;"># Grafik nachführen:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                <span style="color: #808;">self</span>.<span style="color: black;">aktualisiere_position</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                K.<span style="color: black;">aktualisiere_position</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">if</span> Kollision:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Falls es eine Kollision gab, so schnell wie möglich noch einmal</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># testen:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            C.<span style="color: black;">after_idle</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">kollisionstest</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #ff7700;">else</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Ansonsten erst nach 1/25s nachschauen, ob sich hier</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># vielleicht zwischendurch irgendwas getan hat.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># Bei sehr langsamen Rechnern sollte dieser Wert erhöht werden,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #800; font-style: italic;"># falls es Darstellungsprobleme gibt.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            C.<span style="color: black;">after</span><span style="color: black;">&#40;</span><span style="color: #008;">40</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">kollisionstest</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> anklicken<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für das Klicken der linken Maustaste&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Diesen Kreis über alle anderen Canvasobjekte legen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">lift</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Mauscursor als zupackende Hand (Mac OS, Linux) oder</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Verschiebepfeilkreuz (Windows) darstellen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">config</span><span style="color: black;">&#40;</span>cursor<span style="color: #000;">=</span><span style="color: #080;">&quot;fleur&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde bei (%i, %i) angeklickt.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> berühren<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für Bewegung mit der Maus (ohne Tastendruck)&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wird auf (%i, %i) berührt.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> bewegen<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für Bewegung mit der Maus mit gedrückter Maustaste&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Aktuelle Mauskoordinaten werden zum neuen Kreismittelpunkt.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">x</span><span style="color: #000;">,</span> <span style="color: #808;">self</span>.<span style="color: black;">y</span> <span style="color: #000;">=</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Canvasobjekt wird umgesetzt.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">aktualisiere_position</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zusätzlich im Protokoll zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wird zu (%i, %i) bewegt.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> loslassen<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für das Loslassen der linken Maustaste&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Mauscursor als Hand darstellen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">config</span><span style="color: black;">&#40;</span>cursor<span style="color: #000;">=</span><span style="color: #080;">&quot;hand1&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde an (%i, %i) losgelassen.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> betreten<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für das Berühren mit dem Mauszeiger&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Mauscursor als Hand darstellen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">config</span><span style="color: black;">&#40;</span>cursor<span style="color: #000;">=</span><span style="color: #080;">&quot;hand1&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde an (%i, %i) betreten.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> verlassen<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für das Verlassen durch den Mauszeiger&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Mauscursor als Pfeil darstellen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">config</span><span style="color: black;">&#40;</span>cursor<span style="color: #000;">=</span><span style="color: #080;">&quot;arrow&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde an (%i, %i) verlassen.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> rechtsklicken<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für das Klicken der rechten Maustaste&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Mauscursor als Pfeil darstellen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">config</span><span style="color: black;">&#40;</span>cursor<span style="color: #000;">=</span><span style="color: #080;">&quot;arrow&quot;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Canvas-Objekt löschen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">delete</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Sich selbst aus der Kreise-Liste löschen</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        Kreise.<span style="color: black;">remove</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Zeigen, dass dieser Event ausgelöst wurde</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde von (%i, %i) gelöscht.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">def</span> doppelklicken<span style="color: black;">&#40;</span><span style="color: #808;">self</span><span style="color: #000;">,</span> event<span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #080;">&quot;Event-Handler für Doppelklick mit der linken Maustaste&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #800; font-style: italic;"># Diesen Kreis umfärben</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        <span style="color: #808;">self</span>.<span style="color: black;">farbe</span> <span style="color: #000;">=</span> zufallsfarbe<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        C.<span style="color: black;">itemconfig</span><span style="color: black;">&#40;</span><span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span>fill<span style="color: #000;">=</span><span style="color: #808;">self</span>.<span style="color: black;">farbe</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        protokolliere<span style="color: black;">&#40;</span><span style="color: #080;">&quot;Kreis %i wurde auf (%i, %i) gedoppelklickt.&quot;</span> % <span style="color: black;">&#40;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">            <span style="color: #808;">self</span>.<span style="color: black;">ID</span><span style="color: #000;">,</span> event.<span style="color: black;">x</span><span style="color: #000;">,</span> event.<span style="color: black;">y</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> zufallsfarbe<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;Erzeugt einen zufälligen RGB-Farbwert&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">return</span> <span style="color: #080;">&quot;#%02x%02x%02x&quot;</span> % <span style="color: black;">&#40;</span>randint<span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">255</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                              randint<span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">255</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">                              randint<span style="color: black;">&#40;</span><span style="color: #008;">0</span><span style="color: #000;">,</span> <span style="color: #008;">255</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> zufallspunkt<span style="color: black;">&#40;</span>r<span style="color: #000;">=</span><span style="color: #008;">0</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Erzeugt zufällige Koordinaten eines Punktes auf der Canvas, ggf. mit</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">    einem Randabstand r.&quot;&quot;&quot;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">return</span> randint<span style="color: black;">&#40;</span>r<span style="color: #000;">,</span> C.<span style="color: black;">winfo_width</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>-r-<span style="color: #008;">1</span><span style="color: black;">&#41;</span><span style="color: #000;">,</span> randint<span style="color: black;">&#40;</span>r<span style="color: #000;">,</span> C.<span style="color: black;">winfo_height</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>-r-<span style="color: #008;">1</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> zufallsradius<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Erzeugt einen zufälligen Radiuswert zwischen 4 und 24.&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">return</span> randint<span style="color: black;">&#40;</span><span style="color: #008;">4</span><span style="color: #000;">,</span> <span style="color: #008;">24</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">def</span> größenänderung<span style="color: black;">&#40;</span>event<span style="color: #000;">=</span><span style="color: #808;">None</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #080;">&quot;&quot;&quot;Event, der bei Änderungen der Größe oder der Position des Hauptfensters</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #080;">    ausgelöst wird.&quot;&quot;&quot;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Uns interessieren dabei die Größenänderungen, weil bei Verkleinerungen</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># des Fensters einige Kreise in den neuen sichtbaren Bereich der Canvas</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># zurückgeschoben werden sollen.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #ff7700;">for</span> K <span style="color: #ff7700;">in</span> Kreise:</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">        K.<span style="color: black;">aktualisiere_position</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Wir binden den gerade definierten Eventhandler an sein auslösendes Ereignis:</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">bind</span><span style="color: black;">&#40;</span><span style="color: #080;">&quot;&lt;Configure&gt;&quot;</span><span style="color: #000;">,</span> größenänderung<span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Vor der Erzeugung der Kreise müssen wir dafür sorgen, dass das Hauptfenster</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># aufgebaut wird, damit die Canvas Auskunft über ihre eigene Größe geben kann</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># um wiederum zufällige Koordinaten innerhalb ihrer Grenzen ermitteln zu</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># können.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">update</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># Wir wollen 200 Kreise erzeugen …</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #ff7700;">for</span> i <span style="color: #ff7700;">in</span> <span style="color: #808;">range</span><span style="color: black;">&#40;</span><span style="color: #008;">200</span><span style="color: black;">&#41;</span>:</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># … die einen zufälligen Radius …</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    r <span style="color: #000;">=</span> zufallsradius<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># … sowie eine zufällige Farbe haben …</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    f <span style="color: #000;">=</span> zufallsfarbe<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># und irgendwo auf der Canvas liegen.</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    x<span style="color: #000;">,</span> y <span style="color: #000;">=</span> zufallspunkt<span style="color: black;">&#40;</span>r<span style="color: black;">&#41;</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    <span style="color: #800; font-style: italic;"># Jede neue Kreisinstanz wird an die Liste &quot;Kreise&quot; angehängt.</span></div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">    Kreise.<span style="color: black;">append</span><span style="color: black;">&#40;</span>Kreis<span style="color: black;">&#40;</span>x<span style="color: #000;">,</span> y<span style="color: #000;">,</span> f<span style="color: #000;">,</span> r<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">&nbsp;</div></li><li style="background:#f9f9f9;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;"><span style="color: #800; font-style: italic;"># … und hopp!</span></div></li><li style="background:#f5f5f5;"><div style="font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;">T.<span style="color: black;">mainloop</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span></div></li></ol></pre>]]></content:encoded>
<link>https://bauforum.wirklichewelt.de/index.php?id=11457</link>
<guid>https://bauforum.wirklichewelt.de/index.php?id=11457</guid>
<pubDate>Tue, 27 Dec 2016 17:04:45 +0000</pubDate>
<category>Software</category><dc:creator>Martin Vogel</dc:creator>
</item>
</channel>
</rss>
