All pastes #3588803 Raw Edit

[PATCH] pyvcp_widgets.py

public unlisted text v1 · immutable
#3588803 ·published 2016-05-02 15:59 UTC
rendered paste body
From d24ee089b82082f9318f0578745255c2249ebbf3 Mon Sep 17 00:00:00 2001
From: Al Smart <al@smt.non>
Date: Mon, 2 May 2016 11:14:12 -0400
Subject: [PATCH] pyvcp_widgets.py

Signed-off-by: Al Smart <al@smt.non>
---
 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