I started with a simple RPM calculator and ran into a small glitch with the entry box not showing the | to indicate that the box has focus... not a deal breaker but a bit strange to get used to. It might just be a bug I don't know.
Does anyone know what the debug line is for and if there are any options?
calc.py
import hal
import glib
import time
import math
debug = 1
class HandlerClass:
def on_calc_sfm_clicked(self, widget, data=None):
self.sfm = float(self.builder.get_object('entry_sfm').get_text())
self.diameter = float(self.builder.get_object('entry_diameter').get_text())
self.rpm = str(int(self.sfm * (12/math.pi) / self.diameter))
self.builder.get_object('label_rpm').set_text(self.rpm)
def __init__(self, halcomp,builder,useropts):
self.halcomp = halcomp
self.builder = builder
self.nhits = 0
def get_handlers(halcomp,builder,useropts):
return [HandlerClass(halcomp,builder,useropts)]
The [DISPLAY] ini entry
# add GladeVCP panel as a tab next to Preview/DRO:
EMBED_TAB_NAME=GladeVCP demo
EMBED_TAB_COMMAND=halcmd loadusr -Wn gladevcp gladevcp -c gladevcp -u calc.py -x {XID} calc.glade
This attachment is hidden for guests. Please log in or register to see it.
John