Active Topics

 


Reply
Thread Tools
Posts: 87 | Thanked: 98 times | Joined on Oct 2007 @ Austria
#21
Well, thanks go right back to you! I connect to the tablet via SSH all the time, and even though it's always the same 2 or 3 addresses, this little widget has made my life so much easier.
 

The Following User Says Thank You to hns For This Useful Post:
Posts: 35 | Thanked: 5 times | Joined on Sep 2007
#22
Hey thanks for yet another great example! I too will use it for sure.

Can you explain a bit this code? Is it so that the method screen_changed is executed every time the window or widget is moved on the desktop? The background method is activated once the screen dims and the IT goes to power save mode? And the foreground is activated once the user does something which brings the IT out of the power save mode? Is that unrealize method used for cleanup when terminating the widget? update is used to periodically fetch the IP.

Ok... how would I execute my separate python program and wait for it to output a dictionary? It can take some time before there is any output. I use the dictionary for setting text to the labels on the desktop plugin.

Found out howto display an image, though I have tested this in desktop PC and don't have access to the IT atm... anyway here's the code:
Code:
        image = cairo.ImageSurface.create_from_png("image.png")
        cr.set_source_surface(image, 10, 10)
        cr.paint()
Really simple. Next need to try it on IT and move on trying out image compositing and coding the main program integration.

Almost forgot to mention that this piece of code is inserted in the expose event method.

... and compositing works so that I just draw the second image over first image. Dunno if that is really compositing but I get the desired effect done.

Last edited by icer; 2008-03-09 at 21:11.
 
Posts: 11 | Thanked: 1 time | Joined on Feb 2008
#23
Hi all,
your examples are amazing. I would want to create a application with a transparent background, but not a widget. I mean, not only on the desktop. Is it possible with python and cairo?
Thanks
 
Posts: 35 | Thanked: 5 times | Joined on Sep 2007
#24
Why not. Go see www.cairographics.org
I think they have examples there.
 
Posts: 11 | Thanked: 1 time | Joined on Feb 2008
#25
Yes I tried cairo but it needs a compositing manager to manage the transparency, so impossible on maemo.
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#26
I hope it is not considered 'stealing' of this thread, but I have a question that is very close to the one that was posed here -- I simply want to create a button and supply my own image for it. Techniques in pygtk that I use on my desktop work just fine, but when I run them on my N800, the image is not shown (and no errors). I have tried various techniques with no luck. For example, this works on my desktop but not my N800:

path = os.path.dirname(os.path.abspath(sys.argv[0]))
image_file = os.path.join(path, "mephem_672x422.jpg")
image = gtk.Image()
image.set_from_file(image_file)
image.show

b=gtk.Button()
window.add(b)
b.connect("clicked",chart_object_info_basic,object ,local)
b.set_image(image)
#b.set_image(gtk.image_new_from_file(image_file))
b.set_size_request(672,422)
b.set_label('')
b.show()

One interesting thing I noticed is that the 'set_size_request' command is not needed on my desktop, but it is needed on the N800 -- otherwise an error occurs:

GtkWarning: gtk_widget_size_allocate(): attempt to allocate widget with width -8 and height 0

Thanks

EDIT: It looks like the "set_label('')" was messing me up, so I took it out! Strange that there are these subtle behavior differences between the desktop and N800...

Last edited by darethehair; 2008-03-20 at 18:38. Reason: Found solution?
 
Posts: 1 | Thanked: 0 times | Joined on Jul 2008
#27
Hi, I'm starting working with N800 device.

I have read this post and I've a little trouble. I'm trying to make a desktop applet with transparent background, but it fails when I try to start it. I create a box (instead of the label in the IP example) and I fill it with gtk.Entry() and gtk.Button() objects. If I fill it with labels and no one of that objects it runs fine.

Can anyone help me?
Thanks!
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#28
I was also looking into the exactly same thing of adding buttons to the view. With labels, it runs fine, but with buttons, it crashes the desktop.
 
Posts: 5 | Thanked: 0 times | Joined on Apr 2008
#29
The same problem for me, It only works well with labels: No buttons, no TreeView

What could be the problem?
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#30
Hi folks:

I am also trying to write a desktop Python applet, and the 'cairo' stuff works fine -- but I want to add some 'buttons' to the application. Can anyone give me some *simple* code to show a mixture of the two in the same applet? Or am I going to run into the same label/button problem as is being mentioned above?

It *appears* as though my request to add buttons is being totally ignored -- but I have noticed strange behavior (sometimes) when something is wong on an applet i.e. it almost looks like it uses a previously-worked 'cached' version instead of the current one in that case (????).
 
Reply


 
Forum Jump


All times are GMT. The time now is 12:23.