Using Offsetpage Widget?

More
6 months 1 week ago #345676 by Todd Zuercher
Here is what it looks like.  All offsets show zero, even though they are not zero.

 

Attachment not found

Please Log in to join the conversation.

More
6 months 1 week ago #345734 by cmorley
Replied by cmorley on topic Using Offsetpage Widget?
As I expected, it's because offsetpage does not automatically find the var file.
You must make a handler file to set the var file  path.

Something like this (it assumes the offset widget is called 'offsetpage' and the var file is called 'sim.var')
Code:
import os varpath = os.path.join(os.getcwd(),'sim.var') def get_handlers(halcomp,builder,useropts):     return [HandlerClass(halcomp,builder,useropts)] class HandlerClass:     def __init__(self, halcomp,builder,useropts):         obj = builder.get_object('offsetpage')         obj.set_filename(varpath)         obj.set_col_visible("abcuvw", False)

Please Log in to join the conversation.

More
6 months 1 week ago #345759 by Todd Zuercher
I tried coping what you have above (with the appropriate name changes) to the handler file, but I still get all zeros in the table.

 

Attachment not found

Please Log in to join the conversation.

More
6 months 1 week ago #345762 by Todd Zuercher
Never mind, I had the name of my handler file wrong in the ini file.
It works! 

Thank you

Attachment not found

 

Attachment not found

 

Attachment not found



And the INI lines to add it to a tab in Axis.
Code:
EMBED_TAB_NAME=Work Offsets EMBED_TAB_COMMAND=gladevcp -u ./offsets.py -x {XID} ./offsets.ui

Please Log in to join the conversation.

More
6 months 1 week ago #345771 by cmorley
Replied by cmorley on topic Using Offsetpage Widget?
excellent.

Please Log in to join the conversation.

Time to create page: 0.171 seconds
Powered by Kunena Forum