Write Extension Help (Glade UI file)

Hello all;

I hoping someone can point me in the right direction.

I am trying to convert a macro I wrote to an extension. I am learning as I go, but things are a little muddy.

The macro runs as a dialog, and the idea is put it into the sidebar. Using some prebuilt extensions (LibreOffice Sidebar Sample - Othello Game), and a little google-fu I have gotten as far as making a blank sidebar appear, naming it, and I have created a Glade XML file that looks like it should do what I want. That said, I will make it work after I get it to draw at all.

The next step, as I am learning by trial an error here, has me stumped. I am trying to get the glade UI file into the blank sidebar.

My preferred language is basic, but google tells me that invoking a glade XML via basic is impossible. It told me to use python and gave me some examples that did exactly nothing useful.

My Python is nascent at best, but I could follow the general idea. Basically, it is binding the XML to the panel using the built in mechanisms. I’m not looking at it right now, so my terminology here will be off.

What I am looking for is an example of the python code that tells UNO to load the a Glade XML file into a side bar defined in Sidebar.xcu. From there I can stitch it all together. Does anyone know if such a thing exists?

TIA;

Ken

Just updating this:

Everything I have tried so far failed. I can get as far as a blank side panel then it all falls apart. I have also officially spent too much time on this. :upside_down_face:

I am not even 100% sure what I am trying to is possible. Google will intermittently say that is is, then it is not.

I even tired this: GitHub - hanya/SidebarByMacros but it is quite old and I don’t think it works anymore. At least I couldn’t get it to work.

Anyway, I am going leave the files I have so far here as a zip. If anyone feels charitable, or bored, and feels like looking at it, please do. If dies here, that’s okay too. The general idea is to get bob.ui to draw in the sidepanel defined by Sidebar.xcu via the Python script in Scripts/Python/PythonBridge.py I fully admit to vibe coding the python, in the hope I could tease out what Gemini was saying so that I could make it work. That approach worked well for Basic, not so much for Python :grin:

All that said, the macro version runs like a top. I did the final edits on a whole book with it. I just got a bee in my bonnet to stick the UI in the Sidebar because it would be neat.

That’s all she wrote. Time to go do other things. :slight_smile:

Ken
Archive.zip (21.8 KB)