Re: Patch: export more methods to python



It should be possible to get a WorkbookControl from a Workbook with code
such as:

view=workbook.wb_views[0]
control=view.wb_controls[0]

but it currently does not work becaus we did not tell introspection what
objects are stored in the arrays (this can be easily fixed), and I don't
think it is possible to cast an int to an object when using Python.

Anyway, if you have a WBCGtk, you can directly get the current Sheet or
the current SheetView:

sheet=Gnm.wb_control_cur_sheet(wbcg)
sheet_view=Gnm.wb_control_cur_sheet_view(wbcg)

Note that it should actually be:
sheet=wbcg.cur_sheet()

but introspection does not understand our naming conventions. We should
fix that in the future, IMHO.

Regards,
Jean

Le mardi 05 novembre 2013 à 14:04 +0200, Anatoly Asviyan a écrit :



2013/11/5 Jean Bréfort <jean brefort normalesup org>
        I suppose it should work the same way, but I'm not an expert.


In old python API, WokbookControl was never exposed to python. It
(WBCGtk) was  used within C code to get correct sheet, then only sheet
object was exported back to python


Is it possible to get WorkbookControl object from given Workbook using
python introspection API only?

Or some helper C code should be written?



        
        



-- 
Regards, Anatoly




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]