Home Forums Wiki Doc Install Extras Screenshots Source Code Projects Blog Users Groups Register
Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Hack in
The latest stable release is the *3.4.0* : How to install it here.
Note: We just switched from BZR to Git on Github! (only to host the code and your future pull requests)
Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Hack in
jesuisbenjamin English 5 jesuisbenjamin [Read]
13 April 2011 à 16:34

jesuisbenjamin, Tuesday 12 April 2011 à 18:00


Subscription date : 28 October 2009
Messages : 415
Hi,

my knowledge of programming is sporadic, but i'd like to play around with Cairo.
I'd like to focus on graphical elements like sub-docks and dialogues (appearance and behaviour).

How can i go about that?

Cheers,
Benjamin

taiebot65, Tuesday 12 April 2011 à 19:28


Subscription date : 26 October 2008
Messages : 1904
Have you tried the doncky applet? it could be a start. this is what you can do with it

http://uppix.net/5/0/5/b0f93c32c826ef7c3801e95c18c07.png

information can be displayed in the dock as well.

But if you want proper hacking your will have to hack directly on the code.

jesuisbenjamin, Wednesday 13 April 2011 à 12:40


Subscription date : 28 October 2009
Messages : 415
OK well,

i was impatient and started from the python_demo applet. But it didn't work to start with. I copied the files from launchpad into the third-party folder. After rebooting Cairo, i can add the applet but has no behaviour.
From the python script i believe it should show a counter as well as it should open up some dialogues.
Also the script has various functions which show the "print" function, where is this suppose to print (isn't print working in an IDE or terminal only?)?

Thanks.
B.

jesuisbenjamin, Wednesday 13 April 2011 à 14:16


Subscription date : 28 October 2009
Messages : 415
I tried another third party applet (Transmission), which is functioning.
I copy-pasted its folder, renamed it and changed the icon.
Then i went on editing the python file, by cleaning it up and keeping the minimum.

I created a counter and an on-click dialogue, but it doesn't seem to work. Running from Terminal gives me no error. When clicking on the icon an error messages appear claiming i supplied too many arguments to "on_click(). My programming skills are rusty, so i may be really committing some obvious mistake

Code:
#!/usr/bin/python

# This is a part of the blablabla...

####################
### dependancies ###
####################

from CDApplet import CDApplet

####################
### Applet class ###
####################
class Applet(CDApplet):
    def __init__(self):
        # define internal variables
        self.count = 1
        # call high-level init
        CDApplet.__init__(self)
        
    ##### private methods #####
    
    def set_counter(self,count):
        self.count = count
        self.icon.SetQuickInfo(format(self.count))
        
    ##### callbacks #####
    def on_click(self):
        self.icon.ShowDialog("Cairo-Dock is great!",4)
############
### main ###
############
if __name__ == '__main__':
    Applet().run()


The error returned is:
ERROR:dbus.connection:Exception in handler for D-Bus signal:
Traceback (most recent call last):
File "/usr/lib/pymodules/python2.6/dbus/connection.py", line 214, in maybe_handle_message
self._handler(*args, **kwargs)
TypeError: on_click() takes no arguments (2 given)


Please help me to start?

fabounet, Wednesday 13 April 2011 à 16:27


Subscription date : 30 November 2007
Messages : 17118
def on_click(self, iState):

the state is for if you hold a key while clicking (which is not really useful I admit)

but I think the code from the demo should work (it is located in cairo-dock-plug-ins/Dbus/demo, is it the one you tried ?)

as for playing with the C code, the doc on the site should give you a starting point.

jesuisbenjamin, Wednesday 13 April 2011 à 16:34


Subscription date : 28 October 2009
Messages : 415
I downloaded the file from Bazaar Viewer, put them in a folder and in the /third-party folder.
There is no cairo-dock-plug-ins/Dbus/demo folder on my machine :s

Technical discussions | Discussions techniques

Subjects Author Language Messages Last message
[Locked] Hack in
jesuisbenjamin English 5 jesuisbenjamin [Read]
13 April 2011 à 16:34


Glx-Dock / Cairo-Dock List of forums Technical discussions | Discussions techniques Hack in Top

Online users :

Powered by ElementSpeak © 2007 Adrien Pilleboue, 2009-2013 Matthieu Baerts.
Dock based on CSS Dock Menu (Ndesign) with jQuery. Icons by zgegball
Cairo-Dock is a free software under GNU-GPL3 licence. First stable version created by Fabounet.
Many thanks to TuxFamily for the web Hosting and Mav for the domain name.