On Monday, May 2, 2016 11:38 AM, Al Smart <[email protected]>
wrote:sorry if this is better
http://pastebin.ca/3588803
Here is a patch for consideration to the radiobutton widget pyvcp.It lets
you select horizontal orientation.I'm sure there is a better way of achieving
this, but here it is.I think it adds to the flexibility of the radiobutton
class.I use it and hope others can too.Thank you Al Smart
From d24ee089b82082f9318f0578745255c2249ebbf3 Mon Sep 17 00:00:00 2001
From: Al Smart <[email protected]>
Date: Mon, 2 May 2016 11:14:12 -0400
Subject: [PATCH] pyvcp_widgets.py
Signed-off-by: Al Smart <[email protected]>
---
lib/python/pyvcp_widgets.py | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/lib/python/pyvcp_widgets.py b/lib/python/pyvcp_widgets.py
index a9d5b1f..50c9b9d 100644
--- a/lib/python/pyvcp_widgets.py
+++ b/lib/python/pyvcp_widgets.py
@@ -586,17 +586,21 @@ class pyvcp_jogwheel(Canvas):
<choices>["one","two","three"]</choices> labels next to each button
<halpin>"radio"</halpin> pin giving index of active button
<initval>0</initval> index of button pin to set true at start
+ <orient>HORIZONTAL</orient> add horizontal tag default is vertical
</radiobutton>
"""
################################################################################
class pyvcp_radiobutton(Frame):
n=0
- def __init__(self,master,pycomp,halpin=None,initval=0,choices=[],**kw):
+ def __init__(self,master,pycomp,halpin=None,initval=0,orient=0,choices=[],**kw):
f=Frame.__init__(self,master,bd=2,relief=GROOVE)
self.v = IntVar()
self.v.set(1)
self.choices=choices
+ self.side = 'top'
+ if orient > 0:
+ self.side = 'left'
if halpin == None:
halpin = "radiobutton."+str(pyvcp_radiobutton.n)
pyvcp_radiobutton.n += 1
@@ -605,7 +609,7 @@ class pyvcp_radiobutton(Frame):
n=0
for c in choices:
b=Radiobutton(self,f, text=str(c),variable=self.v, value=pow(2,n))
- b.pack()
+ b.pack(side=self.side)
if n==initval:
b.select()
c_halpin=halpin+"."+str(c)
--
1.7.9.5
------------------------------------------------------------------------------
Find and fix application performance issues faster with Applications Manager
Applications Manager provides deep performance insights into multiple tiers of
your business applications. It resolves application problems quickly and
reduces your MTTR. Get your free trial!
https://ad.doubleclick.net/ddm/clk/302982198;130105516;z
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers