Re: [Emc-users] Glade question
On 1/20/2013 1:02 PM, Chris Morley wrote: 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 glade on Ubuntu 10.04 defaults to .glade, if you use .ui then click on the file Qt will take 5 minutes to load and then open the file... not what you expect. I don't know why people use Qt extensions on Glade files. John -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
2013/1/22 John Thornton bjt...@gmail.com: On 1/20/2013 1:02 PM, Chris Morley wrote: 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 glade on Ubuntu 10.04 defaults to .glade, if you use .ui then click on the file Qt will take 5 minutes to load and then open the file... not what you expect. I don't know why people use Qt extensions on Glade files. How can I not use .ui? On 10.04, when selected save as I did not see .glade file type. BTW in 12.04 I cannot open this file, Glade tries to open it and terminates with an error, saying something about missing library gladevcp (I get that error in Latvian, not sure I can translate it completely correctly). -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
You can use any extension you want it is just inconvenient to have to open the file if you don't use .glade. I doubt a glade file made on 10.04 will work with 12.anything due to improvements. If your working in the glade interface designer in 10.04 and select save and put in a file name it adds the .glade as it should. John On 1/22/2013 12:03 PM, Viesturs Lācis wrote: 2013/1/22 John Thornton bjt...@gmail.com: On 1/20/2013 1:02 PM, Chris Morley wrote: 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 glade on Ubuntu 10.04 defaults to .glade, if you use .ui then click on the file Qt will take 5 minutes to load and then open the file... not what you expect. I don't know why people use Qt extensions on Glade files. How can I not use .ui? On 10.04, when selected save as I did not see .glade file type. BTW in 12.04 I cannot open this file, Glade tries to open it and terminates with an error, saying something about missing library gladevcp (I get that error in Latvian, not sure I can translate it completely correctly). -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
Date: Tue, 22 Jan 2013 15:25:02 -0600 From: bjt...@gmail.com To: emc-users@lists.sourceforge.net Subject: Re: [Emc-users] Glade question You can use any extension you want it is just inconvenient to have to open the file if you don't use .glade. I doubt a glade file made on 10.04 will work with 12.anything due to improvements. If your working in the glade interface designer in 10.04 and select save and put in a file name it adds the .glade as it should. John There is a big change coming for us: GTK3 In 12.04 GLADE uses GTK3 which is not compatible with GTK2 I'm not sure if you can load GLADE GTK2 version - maybe The GTK2 libraries are still included of course so our programs still run. If we can't get the old GLADE program working in 12.04, then gladeVCP becomes pretty useless until it's updated to GTK3 PyGTK is also finished - no new versions - PyObject is the newest thing. PyGTK is used extensively in gladeVCP. So we have some work coming up! Chris M -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
In blu174-w477cc65c70a24dc640dc80c0...@phx.gbl Chris Morley chrisinnana...@hotmail.com writes: There is a big change coming for us: GTK3 In 12.04 GLADE uses GTK3 which is not compatible with GTK2 I'm not sure if you can load GLADE GTK2 version - maybe I've been using xubuntu 12.10 (ubuntu with xfce) and it has: ii glade-gtk2 3.8.0-0ubuntu5 i386 GTK+ 2 User Interface Builder ii python-gtk2 2.24.0-3build1 i386 Python bindings for the GTK+ widget set ii python-gtk2-doc 2.24.0-3build1 all Python bindings for the GTK+ widget set - documentation $ ls -l /usr/bin/glade* -rwxr-xr-x 1 root root 85124 Sep 19 16:12 /usr/bin/glade -rwxr-xr-x 1 root root 77732 Sep 30 05:28 /usr/bin/glade-gtk2 -rwxr-xr-x 1 root root 13932 Sep 19 16:12 /usr/bin/glade-previewer -- Dewey Garrett -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
How can I not use .ui? On 10.04, when selected save as I did not see .glade file type. BTW in 12.04 I cannot open this file, Glade tries to open it and terminates with an error, saying something about missing library gladevcp (I get that error in Latvian, not sure I can translate it completely correctly). -- Viesturs Are you using run-in-place config? If you are you must load GLADE from the terminal that you set the environment for. (. script-rip-environment ) And yes I do see that GLADE GTK2 is available - excellent! Chris M -- 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/learnnow-d2d ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users
Re: [Emc-users] Glade question
2013/1/20 Chris Morley chrisinnana...@hotmail.com: Can you post your glade and handler file I put them in my site: www.cutting.lv/fileadmin/user_upload/plasma.ui www.cutting.lv/fileadmin/user_upload/plasma.py -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- 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
Re: [Emc-users] Glade question
From: viesturs.la...@gmail.com Date: Sun, 20 Jan 2013 11:17:26 +0200 To: emc-users@lists.sourceforge.net Subject: Re: [Emc-users] Glade question 2013/1/20 Chris Morley chrisinnana...@hotmail.com: Can you post your glade and handler file 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. I will try to fix it tomorrow to give you an example to work with. But see if this works for starters: Chris M class HandlerClass: def __init__(self, halcomp,builder,useropts): self.builder = builder self.voltage_spinbutton = self.builder.get_object('volreq') self.voltage_spinbutton.set_value(1.0) def get_handlers(halcomp,builder,useropts): return [HandlerClass(halcomp,builder,useropts)] -- 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
Re: [Emc-users] Glade question
2013/1/20 Chris Morley chrisinnana...@hotmail.com: From: viesturs.la...@gmail.com Date: Sun, 20 Jan 2013 11:17:26 +0200 To: emc-users@lists.sourceforge.net Subject: Re: [Emc-users] Glade question 2013/1/20 Chris Morley chrisinnana...@hotmail.com: Can you post your glade and handler file 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. I do not have a file with extension glade. I checked - it does not offer me to save with such a file type. I will send it to You in private email. I will try to fix it tomorrow to give you an example to work with. But see if this works for starters: Chris M class HandlerClass: def __init__(self, halcomp,builder,useropts): self.builder = builder self.voltage_spinbutton = self.builder.get_object('volreq') self.voltage_spinbutton.set_value(1.0) def get_handlers(halcomp,builder,useropts): return [HandlerClass(halcomp,builder,useropts)] Thank You! Unfortunately I do not understand, how exactly do I integrate this with the existing handler file. -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- 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
Re: [Emc-users] Glade question
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) 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
Re: [Emc-users] Glade question
Can you post your glade and handler file Chris M From: viesturs.la...@gmail.com Date: Sat, 19 Jan 2013 21:54:21 +0200 To: emc-users@lists.sourceforge.net Subject: [Emc-users] Glade question Hello! I have created a gladevcp panel. Besides other things it contains also one spinbox and one horizontal scale widgets. I have created adjustments for each of these widgets, where I have set min, max and initial values and also value increments. The thing is that it does not set initial value correctly and also increment is not correct. What I did: I managed to set initial value in python handler file; so now I have correct initial value; I still do not have correct increment. And since I have to set that value explicitly, I decided that it would be more convenient for future use to set initial values from INI file. Can somebody help me out with the piece of python code that does that? Currently I have this one: def on_velscale_realize(self,widget,data=None): widget.set_value(0.70) And I also have found this piece of code, which should read velocity_tolerance value from PLASMA section in INI file: inifile = emc.ini(os.getenv(INI_FILE_NAME)) veltol = float(inifile.find(PLASMA, VELOCITY_TOLERANCE) or 0.0) The problem is that I am so dumb in python that I have no idea, what is missing to stick both of them together. I failed with brutal approach: inifile = emc.ini(os.getenv(INI_FILE_NAME)) veltol = float(inifile.find(PLASMA, VELOCITY_TOLERANCE) or 0.0) def on_velscale_realize(self,widget,data=None): widget.set_value(veltol) Obviously something more is required... Thanks in advance for any tips or references to working examples, where I can take a look! -- Viesturs If you can't fix it, you don't own it. http://www.ifixit.com/Manifesto -- 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. SALE $99.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122912 ___ Emc-users mailing list Emc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/emc-users -- 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