Last night was using a pyglet for creating some good graphical applications ,it was my first introduction with the pyglet,so just went on <a href="http://pyglet.org">pyglet.org</a> and downloaded a pdf file .<br><br>Now simply made two programs that is mentioned in the pdf of the pyglet <br>
<br><br><br>program 1.It is simple program that prints &#39;HELLO WORLD&#39;<br><br><br>program2.It is simple takes the keyboard and mouse events <br><br><br>Now I am going to write both the code then regarding queries also.<br>
<br>1.import pyglet <br>window=pyglet.window.Window()<br><br>lable=pyglet.text.Lable(&#39;Hello, world&#39;,<br> font_name=&#39;Times New Roman&#39;,<br> font_size=36,<br> x=window.width//2, y=window.height//2,<br> anchor_x=&#39;center&#39;, anchor_y=&#39;center&#39;)<br>
<b style="color: rgb(255, 0, 0);">@window.event  </b><br><span style="color: rgb(255, 0, 0);">def on_draw():</span><br style="color: rgb(255, 0, 0);"><span style="color: rgb(255, 0, 0);">    window.clear()</span><br style="color: rgb(255, 0, 0);">
<span style="color: rgb(255, 0, 0);">    label.draw()</span><br><span style="color: rgb(255, 0, 0);">pyglet.app.run()</span><br><br>okay I just drop second example just tell me why we are using that all the code that is showed in RED color .<br>
<br><br>2What is Event Handlers as well as What is DECORATORS TELL ME ALSO <br><br>regards <br>sudhanshu <br><br><br>