Active Topics

 


Reply
Thread Tools
Posts: 5 | Thanked: 0 times | Joined on Apr 2008
#31
All the code samples that I've seen on the net are using only labels. If I just replace the label for a simple bottom it crash, and for now, nobody reply with any solution, so maybe it's a bug on Python libhildondesktop bindings and can't be done with current version.
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#32
Hmmm...unless I am mistaken, this current 'limitation' of the Python libhildondesktop bindings means that there is no way to 'influence' the behavior of a desktop applet once it is running i.e. no buttons, menus, etc. to change settings. True?
 
yerga's Avatar
Posts: 696 | Thanked: 1,012 times | Joined on Mar 2006 @ Asturies, Spain
#33
Originally Posted by Sergio View Post
All the code samples that I've seen on the net are using only labels. If I just replace the label for a simple bottom it crash, and for now, nobody reply with any solution, so maybe it's a bug on Python libhildondesktop bindings and can't be done with current version.
I had this experiment running some time ago: http://www.flickr.com/photos/yerga/2265719734/


It has a button but it hasn't transparency. I have the code in somewhere, I will have to search and test it. If it works I will come here with an example (on the weekend).
__________________
Daniel Martín Yerga
maemo.org profile
Twitter
 
Posts: 1,038 | Thanked: 737 times | Joined on Nov 2005 @ Helsinki
#34
It might either be bug in the python implementation or in the actual implementation. Can't tell. I can try to ask Rodrigo though.
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#35
While we are waiting (hopefully) for a solution to this matter, I was wondering if it was possible to have the transparent widgets respond to *other* events e.g. mouse clicks, mouse drags, focus, etc.?

I am a total newbie at this stuff, but I tried adding this code to my app and it was (apparently) ignored:

self.connect("button-press-event", self.toggle_text)
self.connect("drag-begin", self.toggle_text)
self.connect("enter-notify-event", self.toggle_text)
self.connect("focus", self.toggle_text)

def toggle_text(self, widget, event):

if text_flag == "on":
text_flag = "off"
else:
text_flag = "on"

self.update()

return

Even though I could click, drag, etc the widget, it didn't appear as though my 'text_toggle' module was being called. I also tried adding this:

self.add_events(gtk.gdk.KEY_PRESS_MASK |
gtk.gdk.POINTER_MOTION_MASK |
gtk.gdk.BUTTON_PRESS_MASK |
gtk.gdk.SCROLL_MASK)

...but that didn't work either. You folks are a lot smarter than me, so what am I doing wrong? Or is this another limitation?

Thanks
 
yerga's Avatar
Posts: 696 | Thanked: 1,012 times | Joined on Mar 2006 @ Asturies, Spain
#36
I tested it and here are my conclusions:

* You can add buttons when you have a bored applet without transparency.
* Same problem of yours if the applet have transparency.
__________________
Daniel Martín Yerga
maemo.org profile
Twitter
 

The Following User Says Thank You to yerga For This Useful Post:
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#37
Yerga:

Using the examples of 'transparent shaped widgets' from this current thread, can you tell me (offhand) what minimal amount would need to be *removed* (i.e. 'transparency') in order for buttons to work? Also, can you post an example (code) of such a widget?

My own applet is stalled out -- waiting for some sort of resolution. Otherwise, I would need to release it without any 'controls' at all (buttons, menus, etc).
 
yerga's Avatar
Posts: 696 | Thanked: 1,012 times | Joined on Mar 2006 @ Asturies, Spain
#38
Originally Posted by darethehair View Post
Yerga:

Using the examples of 'transparent shaped widgets' from this current thread, can you tell me (offhand) what minimal amount would need to be *removed* (i.e. 'transparency') in order for buttons to work? Also, can you post an example (code) of such a widget?

My own applet is stalled out -- waiting for some sort of resolution. Otherwise, I would need to release it without any 'controls' at all (buttons, menus, etc).
The not-transparent applet was written from scratch, not from the transparent examples, is the following code, is a simple label+button gtk example:
Code:
import gtk
import hildondesktop

class IPPlugin(hildondesktop.HomeItem):
	def __init__(self):
		hildondesktop.HomeItem.__init__(self)

		self.vbox = gtk.VBox()
		self.vbox.set_size_request(200, 100)
		self.label = gtk.Label()
		self.label.set_text('A label')
		self.vbox.pack_start(self.label, 8)
		
		self.button = gtk.Button('Press')	
		self.button.connect("clicked", self.press_button)
		self.vbox.pack_start(self.button, True, True, 0)
		
		self.add(self.vbox)
		self.show_all()
		
	def press_button(self, widget):
		self.label.set_text('Button pressed!')    

def hd_plugin_get_objects():
	plugin = IPPlugin()
	return [plugin]
I think if you decide not use transparency to have buttons (or other widgets) is better write it with simple gtk without use the cairo examples.

Other thing you could look, is add an option in the Home menu to control the applet settings but I don't know how it works.
__________________
Daniel Martín Yerga
maemo.org profile
Twitter
 

The Following User Says Thank You to yerga For This Useful Post:
Khertan's Avatar
Posts: 1,012 | Thanked: 817 times | Joined on Jul 2007 @ France
#39
You can look in source code of the last HomeIP or other Home* applet i ve made. Source is available in extras repository.

If you need explain just ask, but it s in fact very easy to do.
 

The Following User Says Thank You to Khertan For This Useful Post:
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#40
Khertan:

I think I briefly looked at your apps in the past for the 'secret' -- but do your apps use 'shaped' widgets? I definitely want to integrate Cairo (drawing) into my own.
__________________
There is nothing more dangerous than a bored cat.
 
Reply


 
Forum Jump


All times are GMT. The time now is 21:43.