View Single Post
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: