Wiki page (incomplete): http://wiki.awn-project.org/index.php?title=AWNLib
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Now does:
Icon: set or get icon
Title: set the title, AWNLib does the rest
Dialogs: register dialog to automatically pop up or not when the user clicks the icon (handles focus-out and everything)
Modules: import a module, warn the user if they don't have it
Settings: GConf the easy way
Timing: Set a function to run on a timer
Notification: send stuff to libnotify
Keychain: store passwords securely
Effects: Use the cool awn effects easily.
Icon: set or get icon
Title: set the title, AWNLib does the rest
Dialogs: register dialog to automatically pop up or not when the user clicks the icon (handles focus-out and everything)
Modules: import a module, warn the user if they don't have it
Settings: GConf the easy way
Timing: Set a function to run on a timer
Notification: send stuff to libnotify
Keychain: store passwords securely
Effects: Use the cool awn effects easily.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Developing with the AWN Python module is quite a pain. The new developer needs to keep quite a few things in mind. Even the experienced developer needs to keep a few thousand small helper functions in memory. Instead, I present you an alternative: AWNLib, and AWN applet API. It's written in Python, and it simply wraps around the default AWN API.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
if __name__ == "__main__":
applet = AWN.initiate()
applet.icon.set(applet.icon.getTheme("gtk-apply")) # Get icon from a theme
applet.title.set("Test Case Applet") # Setting a title
dlog = applet.dialog.new() # Get a dialog
button = gtk.Button(stock="gtk-apply") # C&P from python-test
dlog.add(button)
button.show_all()
applet.dialog.register(dlog, "main") # Set as the main dialog
AWN.start(applet) # Start the applet
applet = AWN.initiate()
applet.icon.set(applet.icon.getTheme("gtk-apply")) # Get icon from a theme
applet.title.set("Test Case Applet") # Setting a title
dlog = applet.dialog.new() # Get a dialog
button = gtk.Button(stock="gtk-apply") # C&P from python-test
dlog.add(button)
button.show_all()
applet.dialog.register(dlog, "main") # Set as the main dialog
AWN.start(applet) # Start the applet
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Download: http://www.mediafire.com/?8ylobzrdcbm
This contains both the library and the test applet
This contains both the library and the test applet
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
This is a natural outgrowth of the AWN GMail Applet 2.0. Currently it wraps around Icon, Dialog, and Title:
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Icon: get and set icons. Use icon.getFile or icon.getTheme and pass that to icon.set
Title: title.set the title and AWNLib does the rest
Dialogs: dialog.new to make a new dialog and then dialog.register("main" or "secondary") to apply it. Optionally, pass "main" or "secondary" to dialog.new. AWNLib handles Style-Guide compatible clicking on icon and also focus-out.
Title: title.set the title and AWNLib does the rest
Dialogs: dialog.new to make a new dialog and then dialog.register("main" or "secondary") to apply it. Optionally, pass "main" or "secondary" to dialog.new. AWNLib handles Style-Guide compatible clicking on icon and also focus-out.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
Hopefully, this will grow to encompass even more, such as settings, timing, and all the other things that will help developers write better applets faster.
![Click to quote this passage; Click again to jump to bottom [Q]](engine/grafts/newdefault/images/qq.png)
*Edited at 2:15pm, 04/06/08