Reply
Thread Tools
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#1
For those that can assist with with a 'hildondesktop.HomeItem' applet programming challenge, I refer you to an older thread:

http://talk.maemo.org/showthread.php?t=16720

In that thread, all participants (including myself) had tried and given up trying to implement any 'clickable' widgets inside these 'transparent' desktop widgets.

With one of my own applets, many months later, I was able to put some basic 'clickable' behavior into my applet by defining a 'button_press_event' routine:

...
self.connect ("button_press_event", self.button_press_event)
...
def button_press_event(self, widget, event):
...

This works OK, but has the *undesirable* side-effect of negating all other 'click' action -- namely being able to 'click & drag' the applet to another location on the desktop. Can anyone help to suggest other event callbacks that I need to include to re-establish that functionality?

It is so annoying to be able to (finally) establish some level of 'clickability' into my applet, but sacrificing something so important

Thanks

Programmatic
__________________
There is nothing more dangerous than a bored cat.
 

The Following User Says Thank You to darethehair For This Useful Post:
thp's Avatar
Posts: 1,391 | Thanked: 4,272 times | Joined on Sep 2007 @ Vienna, Austria
#2
Originally Posted by darethehair View Post
This works OK, but has the *undesirable* side-effect of negating all other 'click' action -- namely being able to 'click & drag' the applet to another location on the desktop. Can anyone help to suggest other event callbacks that I need to include to re-establish that functionality?
Maybe you have to return True or False from that signal handler depending on whether you handled the signal or not. For several signals in GTK, the return value of the signal handler decides whether the event is propagated further or not. Just a guess, though...
 

The Following User Says Thank You to thp For This Useful Post:
Bundyo's Avatar
Posts: 4,708 | Thanked: 4,649 times | Joined on Oct 2007 @ Bulgaria
#3
Tis true. And by default it stops the handler (if there's no return value).
__________________
Technically, there are three determinate states the cat could be in: Alive, Dead, and Bloody Furious.
 
darethehair's Avatar
Posts: 273 | Thanked: 104 times | Joined on Mar 2007 @ Manitoba, Canada
#4
Thanks to thp and Bundyo!

Could you elaborate a bit more on the Python syntax/technique required to do as you suggest? Or direct me to an example?

UPDATE: I now understand what you guys meant.

http://www.pygtk.org/pygtk2tutorial/sec-Events.html

The answer was to do a 'return False' in order for the normal mouse click event handling (like click & drag) to continue!
__________________
There is nothing more dangerous than a bored cat.

Last edited by darethehair; 2009-06-15 at 12:54. Reason: Solution discovered
 
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 11:02.