> >> I put them in my site:
> >> www.cutting.lv/fileadmin/user_upload/plasma.ui
> >> www.cutting.lv/fileadmin/user_upload/plasma.py
> >>
> >> --
> >> Viesturs
> >>
> >
> > Yes your handler file is not right.
> > Can you just include your GLADE file?
> > I want to load it in glade - copy and paste from website doesn't work.
> 

Ok I tinkered with you files - got it to work.
Couple of things I will say.
You were using HAL_labels as regular label. They are not.
Use labels as labels and HAL_labels for displaying hal pin numbers.

You have a tons of HAL_Hbox and HAL_Table s. Do you really need them all
HALized? Use HAL widgets only when you need the HAL functions, otherwise
use regular GTK widgets.

But that would give you warnings in a terminal not stop things from working.

You handler file was just  - wrong :)
Interestingly I tried to put an INI example in there but it didn't work ..
I'l[ look into that more later.
Finally how were you loading this with loadusr gladevcp?
I discovered the  -u plasma_handler.py must be before the plasma.ui

oh and .glade is the old ending I think they use .ui now, same thing.
you must be using a new version of glade then me.

The files are included but here:
I added comments:


# This is gladeVCP boiler code - meaning code needed to make it run all run
# and mostly uninteresting to us - it gives gladeVCP access to our class
def get_handlers(halcomp,builder,useropts):
    return [HandlerClass(halcomp,builder,useropts)]

# The class name can be considered more boler code in most cases
# inside the class we will have function/methods for doing our dirty work
#
class HandlerClass:

    # This function is run only once when first started initialization  
(__init_)
    # The form of this, you may consider boiler code.
    # It gives you access to gladeVCP's hal, builder and user options
    def __init__(self, halcomp,builder,useropts):

        # This is just to be sure the code got run at start up
        # You will see this printed in a terminal if one is open
        # once you know this handler file is called properly
        # you can comment over this - but this is a good technique to debug code
        # you can also print the value of stuff th same way
        print "got here"

        # by adding this statement with 'self' gives us access to builder
        # outside on the __INI__ function. In this example we don't need it
        # but usually you have more code that will
        self.builder = builder

        # First we must make a 'reference' to the widgets we want
        # The reference name (self.voltage_spinbutton) can be anything we want
        # note that we use 'self' so we can use it outside of the __ini__ 
function
        # self.builder.get_object('volreq') tells glade to search for the widget
        # 'volreg' and assigs that widget to our reference name
        # after that we can use out reference name to access GTK methods
        # The spinbox has a method - set_value(value) - obviously to set the 
value :)
        # there are lots of other methods such as get_value()
        # these two methods are very common with gtk widgets
        # anyways we set the value to 150
        self.voltage_spinbutton = self.builder.get_object('volreq')
        self.voltage_spinbutton.set_value(150)

        # and here we do it again for the velocity scale
        self.velocity_scale = self.builder.get_object('velscale')
        self.velocity_scale.set_value(1.0)
 

                                          

Attachment: plasma.ui
Description: application/designer

# This import is needed for access to the INI file
# This is how you 'import' extra libraries you may need
import linuxcnc,os

# This is gladeVCP boiler code - meaning code needed to make it run all run
# and mostly uninteresting to us - it gives gladeVCP access to our class
def get_handlers(halcomp,builder,useropts):
    return [HandlerClass(halcomp,builder,useropts)]

# The class name can be considered more boler code in most cases
# inside the class we will have function/methods for doing our dirty work
#
class HandlerClass:

    # This function is run only once when first started initialization  (__init_)
    # The form of this, you may consider boiler code.
    # It gives you access to gladeVCP's hal, builder and user options
    def __init__(self, halcomp,builder,useropts):

        # This is just to be sure the code got run at start up
        # You will see this printed in a terminal if one is open
        # once you know this handler file is called properly
        # you can comment over this - but this is a good technique to debug code
        # you can also print the value of stuff th same way
        print "got here"

        # by adding this statement with 'self' gives us access to builder
        # outside on the __INI__ function. In this example we don't need it
        # but usually you have more code that will
        self.builder = builder

        # First we must make a 'reference' to the widgets we want
        # The reference name (self.voltage_spinbutton) can be anything we want
        # note that we use 'self' so we can use it outside of the __ini__ function
        # self.builder.get_object('volreq') tells glade to search for the widget
        # 'volreg' and assigs that widget to our reference name
        # after that we can use out reference name to access GTK methods
        # The spinbox has a method - set_value(value) - obviously to set the value :)
        # there are lots of other methods such as get_value()
        # these two methods are very common with gtk widgets
        # anyways we set the value to 150
        self.voltage_spinbutton = self.builder.get_object('volreq')
        self.voltage_spinbutton.set_value(150)

        # and here we do it again for the velocity scale
        self.velocity_scale = self.builder.get_object('velscale')
        self.velocity_scale.set_value(1.0)
 
------------------------------------------------------------------------------
Master Visual Studio, SharePoint, SQL, ASP.NET, C# 2012, HTML5, CSS,
MVC, Windows 8 Apps, JavaScript and much more. Keep your skills current
with LearnDevNow - 3,200 step-by-step video tutorials by Microsoft
MVPs and experts. ON SALE this month only -- learn more at:
http://p.sf.net/sfu/learnmore_123012
_______________________________________________
Emc-users mailing list
Emc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to