Reply
Thread Tools
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#1
Over the past few hours I've been, unsuccessfully, trying to integrate hildonhelp into my Python application.

The problem is that I'm unsure what exactly needs to be done to initialize the help system because all the documentation is in C, and I'm not familiar with C at all (hate it).

This is the documentation I've found:

http://maemo.org/api_refs/4.1/libhil...og-help-enable

http://maemo.org/maemo_release_docum...00000000000000

This is my not-yet-working example:
Code:
   def help_test_function(self, widget, data=None):
      dialog = gtk.Dialog("Help!",None,gtk.DIALOG_MODAL)
      dialog.set_size_request(500, 300)
      ok_button = dialog.add_button(gtk.STOCK_OK, gtk.RESPONSE_OK)
      
      hildonhelp.help_dialog_help_enable(dialog, "osso_quickclip_help", <an "osso.Context" arguement here>)
      
      dialog.show_all()
      dialog.run()     
      dialog.destroy()
This should open a gtk.Dialog that has a little "?" at the top, that when clicked, should open another popup dialog to a certain section in a help file named quickclip.xml.

Problem is, I don't even know what a valid osso.Context arguement is. If I put None there, the dialog will open, but clicking the "?" does nothing.

Any help greatly appreciated.
 
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#2
Osso context refers to registering the app from DBUS, I don't know how it works for python but for transmission, I did things like:

/* exit the gtk main loop & osso_deinitalize*/
osso_context_t* context = NULL;
context = osso_initialize ("com.transmissionbt.Transmission", VERSION, FALSE, NULL);
osso_deinitialize(context);
(I had previously initialized it with:
osso_initialize ("com.transmissionbt.Transmission", VERSION, FALSE, NULL);
)

In python, it's something like:
import osso
osso.Context('com.whatever.whatever','<version>', False)

(Last param is always false - true is depreciated)

Sorry if this has confused you even more, I'm only familiar with C and I can't even code in C.
 

The Following User Says Thank You to qwerty12 For This Useful Post:
BrentDC's Avatar
Posts: 903 | Thanked: 632 times | Joined on Apr 2008
#3
Originally Posted by qwerty12 View Post
Osso context refers to registering the app from DBUS, I don't know how it works for python but for transmission, I did things like:



(I had previously initialized it with:
osso_initialize ("com.transmissionbt.Transmission", VERSION, FALSE, NULL);
)

In python, it's something like:
import osso
osso.Context('com.whatever.whatever','<version>', False)

(Last param is always false - true is depreciated)
I added my program as a global variable:

Code:
osso_context = osso.Context('com.quickclip.Quickclip','.21', False)
Then just slipped osso_context in as the third argument in my help function, and it....drum roll....WORKED! Yay!

Thanks a lot qwerty12!

Sorry if this has confused you even more, I'm only familiar with C and I can't even code in C.
You should learn Python I spent 6 months trying to learn C/C++, and nothing. My biggest achievement was a terminal program that computed Heat Index/Wind Chill/Dew Point from the necessary information. Then one day I came across a very informal Python tutorial (it was maybe 6-7 short chapters), spent 30 minutes reading that. The very next day, I wrote my Weather program in Python, the same one it took me 6 months to figure out how to do in C. I immediately began programming in Python. It just makes sense
 

The Following User Says Thank You to BrentDC For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 13:36.