-1

Hi I am new to this whole coding thing I was suggested to use Python. The version I have now is 2.7. I need help with making a transparent window to the copacity of 100 so that you can actually see through it and I also want to know how to make a fairy thick, out line of a rectangle in the colour red.

Help me please :S Thanks!

Aryan H
  • 11
  • 3
    What have you tried so far? Have you been following a tutorial of some kind? – André Caron Mar 19 '12 at 12:23
  • Your question, as written, might get some negative attention. This is mainly because you listed a series of requirements and have not shown any of your attemps to solve the problem. This sounds a lot like ["plz send me teh codez"](http://thedailywtf.com/Articles/plz-email-me-teh-codez.aspx) (please do my work for me), which is not in the spirit of StackOverflow. You should edit your question, otherwise it will get closed. – André Caron Mar 19 '12 at 12:35

1 Answers1

0

Unfortunatelly, there is not such an easy thing as sa "trasnparent window" - althougmodern widnow managaers do have various opacity controls for the windows, those just affect the windows as a whole - and do not integrate at all with the program running "inside" the windows. There may even be, for some of them, a way to call functions to explicitly set up the opacity level of a given window, but I don't think it willbe possible for all of them.

That said, it is possible to get grab of the "root" window and draw directly on the screen - -bypassing the window manager. There are APIs for that at least on Windows and Linux (you have to mention in what operating system you need that working) - but it will amount to not a trivial research work, since this is not what is expected of a "well behaved app" - for which the GUI toolkits are written and documented. You will need to write xlib code in Linux, and directly call win32 api's on windows - both are possible from Python - as possible as under-documented.

And once you get to draw the rectangle, since you are bypassing the window manager, you willhave to care about every low-level detail of your app: mouse event handling, screen-redrawing (and notifying the system of drawing taking effect over other windows), and so on.

jsbueno
  • 99,910
  • 10
  • 151
  • 209