943,648 Members | Top Members by Rank

Ad:
  • Python Discussion Thread
  • Unsolved
  • Views: 1436
  • Python RSS
Sep 22nd, 2009
0

Python Xlib . Looking for basis docs or tut.

Expand Post »
Just want to create a flexible desktop that is independent from system. For my linux system.
Like to have Clean Window and Transparent.

1. Looking for the basic on Xlib. Most of what i found is unclear where i start.
I like to start simple and expand.

a. Want to just open a clear transparent(150) window at size(400,300) with darken borders.

b. Set graphics myself. No Titlebar or Close.

c. Have it set in System tray for quick recall.

d. have it launch it own apps from icons.

2. Any other options with easy documents ?

3. Is gtk slow for this. I know many light window manger don't like including gtk libs. .
or am i wrong.

4. Can this be done with wxpython.
Last edited by DrakeMagi; Sep 22nd, 2009 at 12:57 pm.
Similar Threads
Reputation Points: 16
Solved Threads: 2
Newbie Poster
DrakeMagi is offline Offline
10 posts
since Jul 2009
Sep 22nd, 2009
0

Re: Python Xlib . Looking for basis docs or tut.

You'd think that before trying to write a desktop environment, one would actually learn up a bit about xlib and how it works. I can answer your question, but I don't want to. Feels a bit like fanning the flames that will eventually blow up in your face.
Featured Poster
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
scru is offline Offline
1,624 posts
since Feb 2007
Sep 22nd, 2009
0

Re: Python Xlib . Looking for basis docs or tut.

One i'm looking for docs or other options. For xlib
Most docs i find are for c.

Two not making an Desktop that take over the other .
Just something small i want to add.

Three it fine it blows up in my face.
Learning is about failures.
in time i will succeed.

I'm self taught. And i learned from reading different docs.
Start off simple and expand.

All i'm asking for where can i find good docs or tutorials.
Point me in the right direction. Thanks.
Last edited by DrakeMagi; Sep 22nd, 2009 at 7:35 pm.
Reputation Points: 16
Solved Threads: 2
Newbie Poster
DrakeMagi is offline Offline
10 posts
since Jul 2009
Sep 22nd, 2009
0

Re: Python Xlib . Looking for basis docs or tut.

Featured Poster
Reputation Points: 975
Solved Threads: 140
Posting Virtuoso
scru is offline Offline
1,624 posts
since Feb 2007
Sep 23rd, 2009
0

Re: Python Xlib . Looking for basis docs or tut.

Still looking for python docs.

reading some docs. and some source code.
This is what i come up with so far.
Still don't know if there some stuff i could get rid of for the basic.
understand about what half i did.

Python Syntax (Toggle Plain Text)
  1. import sys , os
  2.  
  3. # Change path so we find Xlib
  4. sys.path.insert(1, os.path.join(sys.path[0], '..'))
  5.  
  6. from Xlib import X, display, Xutil
  7.  
  8. class Bluebird:
  9. def __init__(self,display):
  10.  
  11. self.dis = display
  12. self.screen = self.dis.screen()
  13. self.window = self.screen.root.create_window(
  14. 50, 50, 400, 300, 2,
  15. self.screen.root_depth,
  16. X.InputOutput,
  17. X.CopyFromParent,
  18.  
  19. background_pixel = self.screen.white_pixel,
  20. event_mask = (X.ExposureMask |
  21. X.StructureNotifyMask |
  22. X.ButtonPressMask |
  23. X.ButtonReleaseMask |
  24. X.Button1MotionMask),
  25. colormap = X.CopyFromParent,
  26. )
  27. self.window.map()
  28.  
  29. self.WM_DELETE_WINDOW = self.dis.intern_atom('WM_DELETE_WINDOW')
  30. self.WM_PROTOCOLS = self.dis.intern_atom('WM_PROTOCOLS')
  31.  
  32. self.window.set_wm_protocols([self.WM_DELETE_WINDOW])
  33.  
  34. def loop(self):
  35. while 1:
  36. e = self.dis.next_event()
  37.  
  38. if e.type == X.ClientMessage:
  39. if e.client_type == self.WM_PROTOCOLS:
  40. fmt, data = e.data
  41. if fmt == 32 and data[0] == self.WM_DELETE_WINDOW:
  42. sys.exit(0)
  43.  
  44. if __name__ == '__main__':
  45.  
  46. Desktop = Bluebird(display.Display())
  47. Desktop.loop()
Reputation Points: 16
Solved Threads: 2
Newbie Poster
DrakeMagi is offline Offline
10 posts
since Jul 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Python Forum Timeline: racquetball simulation program
Next Thread in Python Forum Timeline: Moving an object with control keys in a sprite





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC