Python Xlib . Looking for basis docs or tut.

Please support our Python advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Jul 2009
Posts: 8
Reputation: DrakeMagi is an unknown quantity at this point 
Solved Threads: 1
DrakeMagi DrakeMagi is offline Offline
Newbie Poster

Python Xlib . Looking for basis docs or tut.

 
0
  #1
Sep 22nd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,606
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

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

 
0
  #2
Sep 22nd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 8
Reputation: DrakeMagi is an unknown quantity at this point 
Solved Threads: 1
DrakeMagi DrakeMagi is offline Offline
Newbie Poster

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

 
0
  #3
Sep 22nd, 2009
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.
Reply With Quote Quick reply to this message  
Join Date: Feb 2007
Posts: 1,606
Reputation: scru has a spectacular aura about scru has a spectacular aura about 
Solved Threads: 130
Featured Poster
scru's Avatar
scru scru is offline Offline
Posting Virtuoso

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

 
0
  #4
Sep 22nd, 2009
Reply With Quote Quick reply to this message  
Join Date: Jul 2009
Posts: 8
Reputation: DrakeMagi is an unknown quantity at this point 
Solved Threads: 1
DrakeMagi DrakeMagi is offline Offline
Newbie Poster

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

 
0
  #5
Sep 23rd, 2009
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.

  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()
Reply With Quote Quick reply to this message  
Reply

Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC