How to use the flexx.flx.LineEdit function in flexx

To help you get started, we’ve selected a few flexx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github nilsbore / flexxros / src / flexxros / widgets.py View on Github external
if self.is_init:
            for c in ev:
                for child in self.vbox.children:
                    print(child.title, child.text)
                    if child.title == c:
                        child.set_text(str(ev[c]))
                        break
            return

        print("Event: ", ev)

        with self.vbox:
            for c in ev:
                if c in ["groups", "type", "source"]:
                    continue
                l = flx.LineEdit(title=c, text=str(ev[c]))
            flx.Button(text="Set")
            flx.Widget(minsize=60)

        self.is_init = True
github nilsbore / flexxros / src / flexxros / sam_widgets.py View on Github external
flx.Widget(minsize=20)
                self.heading = flx.LineEdit(title="Heading", text="")
                self.pitch = flx.LineEdit(title="Pitch", text="")
                self.roll = flx.LineEdit(title="Roll", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.depth = flx.LineEdit(title="Depth", text="")
                self.xpos = flx.LineEdit(title="X", text="")
                self.ypos = flx.LineEdit(title="Y", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.xvel = flx.LineEdit(title="X vel", text="")
                self.yvel = flx.LineEdit(title="Y vel", text="")
                self.zvel = flx.LineEdit(title="Z vel", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.gps_status = flx.LineEdit(title="GPS Status", text="")
                self.dvl_status = flx.LineEdit(title="DVL Status", text="")
                self.battery_status = flx.LineEdit(title="Battery level", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.vbs_fb = flx.LineEdit(title="VBS fb", text="")
                self.lcg_fb = flx.LineEdit(title="LCG fb", text="")
                self.rpm_fb = flx.LineEdit(title="RPM fb", text="")
                flx.Widget(minsize=40)
            
        # We subscribe to these topics at full frquency (no extra arg)
        self.subscribe("/sam/core/gps", "sensor_msgs/NavSatFix", self.gps_callback)
github nilsbore / flexxros / src / flexxros / sam_widgets.py View on Github external
flx.Widget(minsize=20)
                self.xvel = flx.LineEdit(title="X vel", text="")
                self.yvel = flx.LineEdit(title="Y vel", text="")
                self.zvel = flx.LineEdit(title="Z vel", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.gps_status = flx.LineEdit(title="GPS Status", text="")
                self.dvl_status = flx.LineEdit(title="DVL Status", text="")
                self.battery_status = flx.LineEdit(title="Battery level", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.vbs_fb = flx.LineEdit(title="VBS fb", text="")
                self.lcg_fb = flx.LineEdit(title="LCG fb", text="")
                self.rpm_fb = flx.LineEdit(title="RPM fb", text="")
                flx.Widget(minsize=40)
            
        # We subscribe to these topics at full frquency (no extra arg)
        self.subscribe("/sam/core/gps", "sensor_msgs/NavSatFix", self.gps_callback)
        self.subscribe("/sam/core/battery_fb", "sensor_msgs/BatteryState", self.battery_callback)
        # We only subscribe to these topics at 1hz
        self.subscribe("/sam/dr/odom", "nav_msgs/Odometry", self.odom_callback, 1.)
        self.subscribe("/sam/core/vbs_fb", "sam_msgs/PercentStamped", self.vbs_callback, 1.)
        self.subscribe("/sam/core/lcg_fb", "sam_msgs/PercentStamped", self.lcg_callback, 1.)
        self.subscribe("/sam/ctrl/depth_feedback", "std_msgs/Float64", self.depth_callback, 1.)
        self.subscribe("/sam/ctrl/pitch_feedback", "std_msgs/Float64", self.pitch_callback, 1.)
        self.subscribe("/sam/ctrl/roll_feedback", "std_msgs/Float64", self.roll_callback, 1.)
        self.subscribe("/sam/ctrl/yaw_feedback", "std_msgs/Float64", self.yaw_callback, 1.)
github nilsbore / flexxros / src / flexxros / sam_widgets.py View on Github external
with flx.HBox(flex=1, style="background: #e6e6df;"):
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.heading = flx.LineEdit(title="Heading", text="")
                self.pitch = flx.LineEdit(title="Pitch", text="")
                self.roll = flx.LineEdit(title="Roll", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.depth = flx.LineEdit(title="Depth", text="")
                self.xpos = flx.LineEdit(title="X", text="")
                self.ypos = flx.LineEdit(title="Y", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.xvel = flx.LineEdit(title="X vel", text="")
                self.yvel = flx.LineEdit(title="Y vel", text="")
                self.zvel = flx.LineEdit(title="Z vel", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.gps_status = flx.LineEdit(title="GPS Status", text="")
                self.dvl_status = flx.LineEdit(title="DVL Status", text="")
                self.battery_status = flx.LineEdit(title="Battery level", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.vbs_fb = flx.LineEdit(title="VBS fb", text="")
                self.lcg_fb = flx.LineEdit(title="LCG fb", text="")
                self.rpm_fb = flx.LineEdit(title="RPM fb", text="")
                flx.Widget(minsize=40)
github flexxui / flexx / flexxamples / howtos / cookies.py View on Github external
def init(self):

        with flx.Widget():
            flx.Label(text='Refreshing the page should '
                           'maintain the value of the line edit.')
            self.edit = flx.LineEdit(placeholder_text='username',
                                     text=self.session.get_cookie('username', ''))
github flexxui / flexx / flexxamples / demos / themed_form.py View on Github external
def init(self):

        with flx.HFix():
            with flx.FormLayout() as self.form:
                self.b1 = flx.LineEdit(title='Name:', text='Hola')
                self.b2 = flx.LineEdit(title='Age:', text='Hello world')
                self.b3 = flx.LineEdit(title='Favorite color:', text='Foo bar')
                flx.Button(text='Submit')
            with flx.FormLayout() as self.form:
                self.b4 = flx.LineEdit(title='Name:', text='Hola')
                self.b5 = flx.LineEdit(title='Age:', text='Hello world')
                self.b6 = flx.LineEdit(title='Favorite color:', text='Foo bar')
                flx.Button(text='Submit')
                flx.Widget(flex=1)  # Add a spacer
github flexxui / flexx / flexxamples / demos / themed_form.py View on Github external
def init(self):

        with flx.HFix():
            with flx.FormLayout() as self.form:
                self.b1 = flx.LineEdit(title='Name:', text='Hola')
                self.b2 = flx.LineEdit(title='Age:', text='Hello world')
                self.b3 = flx.LineEdit(title='Favorite color:', text='Foo bar')
                flx.Button(text='Submit')
            with flx.FormLayout() as self.form:
                self.b4 = flx.LineEdit(title='Name:', text='Hola')
                self.b5 = flx.LineEdit(title='Age:', text='Hello world')
                self.b6 = flx.LineEdit(title='Favorite color:', text='Foo bar')
                flx.Button(text='Submit')
                flx.Widget(flex=1)  # Add a spacer
github nilsbore / flexxros / src / flexxros / sam_widgets.py View on Github external
flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.xvel = flx.LineEdit(title="X vel", text="")
                self.yvel = flx.LineEdit(title="Y vel", text="")
                self.zvel = flx.LineEdit(title="Z vel", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.gps_status = flx.LineEdit(title="GPS Status", text="")
                self.dvl_status = flx.LineEdit(title="DVL Status", text="")
                self.battery_status = flx.LineEdit(title="Battery level", text="")
                flx.Widget(minsize=40)
            with flx.FormLayout(flex=1):
                flx.Widget(minsize=20)
                self.vbs_fb = flx.LineEdit(title="VBS fb", text="")
                self.lcg_fb = flx.LineEdit(title="LCG fb", text="")
                self.rpm_fb = flx.LineEdit(title="RPM fb", text="")
                flx.Widget(minsize=40)
            
        # We subscribe to these topics at full frquency (no extra arg)
        self.subscribe("/sam/core/gps", "sensor_msgs/NavSatFix", self.gps_callback)
        self.subscribe("/sam/core/battery_fb", "sensor_msgs/BatteryState", self.battery_callback)
        # We only subscribe to these topics at 1hz
        self.subscribe("/sam/dr/odom", "nav_msgs/Odometry", self.odom_callback, 1.)
        self.subscribe("/sam/core/vbs_fb", "sam_msgs/PercentStamped", self.vbs_callback, 1.)
        self.subscribe("/sam/core/lcg_fb", "sam_msgs/PercentStamped", self.lcg_callback, 1.)
        self.subscribe("/sam/ctrl/depth_feedback", "std_msgs/Float64", self.depth_callback, 1.)
        self.subscribe("/sam/ctrl/pitch_feedback", "std_msgs/Float64", self.pitch_callback, 1.)
        self.subscribe("/sam/ctrl/roll_feedback", "std_msgs/Float64", self.roll_callback, 1.)
        self.subscribe("/sam/ctrl/yaw_feedback", "std_msgs/Float64", self.yaw_callback, 1.)