Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
I hand code everything. The primary reason is that hand coding gives me the most flexibility. None of the WYSIWYG tools supports all of wxPython’s widgets. So if I wanted to use an unsupported widget, I would have to dig around in the GUI builder’s automatically generated code and modify it anyway. I also don’t like most of the auto-generated code. It doesn’t fit my coding style. I doubt any of these tools would conform to a business’s code spec either.
On Thursday, July 17, 2014 4:33:30 PM UTC-5, steve wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
Steve,
A decade ago I used glade for one, small application, then revered to
writing it manually in emacs like all my other writing.
I found the glade code difficult to follow and its use of fixed ID numbers
has the potential for conflict with others assigned by wxPython.
While writing the code by hand can be tedious and boring because so much
is repetitive, between emacs keyboard macros (F3 to start recording, F4 to
stop and to 'play' the macro) and the copy command it works for me. I like
the control I get, the ability to build on code others have developed, and
it's easier for me to read and find my way around because I created the
structure. It's also easier to change as necessary.
Then again, I much prefer the command line and keyboard to GUIs and
pointing devices since I'm a touch-typist (thanks to the US Army way, way
back).
Rich
On Thu, 17 Jul 2014, steve wrote:
Do you use a GUI builder like wxglade or manually code everything yourself
for your wxpython application? what is the advantage of manual coding?
I started using some IDE (I think it was Glade, outputting some XML that I loaded in Python) years ago, but it wasn’t nearly as easy as MS Visual Studio (at least Visual Basic) which I learned in High School. I quickly switched to hand coding everything, and am 1000s of lines deep now in my GUI code. I looked into the IDEs again about 4 months ago, and didn’t even invest more than 5 minutes into trying any of them, they were much harder to use for me than just creating the widgets and using sizers to get everything positioned. I never use absolute positioning. Also as previously stated, they don’t know about all the widgets available, and those widgets are some of the main ones I’ve been using.
On Thursday, July 17, 2014 2:33:30 PM UTC-7, steve wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
I am mostly not doing GUI code these days but if I need to I still use the hoary old Boa Constructor sometimes, and sometimes I hand code it. I see benefits to both, depending on what I need to do.
On Thu, Jul 17, 2014 at 5:33 PM, steve oslocourse@gmail.com wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
–
You received this message because you are subscribed to the Google Groups “wxPython-users” group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
--
You received this message because you are subscribed to the Google Groups "wxPython-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wxpython-users+unsubscribe@googlegroups.com <mailto:wxpython-users+unsubscribe@googlegroups.com>.
For more options, visit https://groups.google.com/d/optout.
On 7/17/2014 23:33, steve wrote:
Hi Steve,
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Sorry for the first empty reply, fingers and brain were not yet connected:-[ .
When I started with wxPython I used Boa Constructor, one because it had a GUI designer and two it was/is a very nice IDE with a good debugger. Unfortunately it is not very actively maintained and when I reconsidered things a couple of years ago before starting a rewrite of my shareware app I decided to move to 'kind' of hand coding my UI and I switched to WING IDE.
I now use the wx.lib.sized_controls for all my stuff as they simplify the sizer use a lot and you get platform specific HIG layouts.
To further help in creating a layout I create a Python list with a dict per widget I need, the dict contains things like the widget type to use, the name, the help text, the database column etc etc and then I have helper methods which generate the layout at run time.
Werner
On 7/17/2014 23:33, steve wrote:
I code everything by hand in my applications. As others have already pointed out, none of the IDE’s out there support everything in wxPython and the code they generate can be very difficult to follow. So far I have written 2 Python based applications for where I work and I hand coded the GUI for both of them. GUI IDE’s can be useful for someone just starting with wxPython (or any language/module for that matter) but there will come a time when hand coding will be needed.
On Thursday, July 17, 2014 5:33:30 PM UTC-4, steve wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
I’ll occasionally crack out wxglade, then end up shuffling the generated code around anyway.
In my work, I often find I may over 6 to dozens of almost-alike controls (mostly buttons). So I’ll make
a helper function which does the boilerplate and takes the few distinguishing features as arguments.
e.g.:
def makeButton(self,parent,label=“Push”,tooltip=None,handler=None,sizer=None):
btn = wx.Button(…)
# do things like setting font, color, etc.
if handler:
btn.Bind(wx.EVT_BUTTON,handler)
if sizer:
sizer.Add(btn,1,wx.EXPAND);
# set common fonts, colors, etc
return btn # return the new button in case I want to do more with it (like get the ID)
Then I can define all my buttons in a row.
btn_row = wx.BoxSizer(wx.HORIZONTAL)
self.makeButton(pnl,"Left",handler=self.OnLeft,sizer=btn_row)
self.makeButton(pnl,"Up",handler=self.OnUp,sizer=btn_row)
self.makeButton(pnl,"Down",handler=self.OnDown,sizer=btn_row)
self.makeButton(pnl,"Right",handler=self.OnRight,sizer=btn_row)
This way, I know my buttons will be consistent, and if I need to change them all, I just
change the function. You can go further and make it data-driven:
for legend,handler in (("Left",self.OnLeft),("Up",self.OnUp),("Down",self.OnDown)):
btn_row.Add(self.makeButton(pnl,legend,handler=handler),1,wx.EXPAND) # use return value to put in sizer this time.
This is a contrived example, composed online so it may not run as is.
But you get the idea.
GUI builders can’t normally do this.
On Thursday, July 17, 2014 5:33:30 PM UTC-4, steve wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
I tried wxGlade but found it very confusing. I tried wxFormBuilder and find this easier to understand. This creates a class for your form which you instantiate an instance of and overide the event methods.
On Thursday, 17 July 2014 17:33:30 UTC-4, steve wrote:
Hi,
Do you use a GUI builder like wxglade or manually code everything yourself for your wxpython application? what is the advantage of manual coding?
Best regards
Yes, I am a hobbyist/experimenter that has started using Linux (Ubuntu) in
the last few years.
I have some experience using VB Basic and VB.net in a XP environment. I
spent a lot, I mena a lot of time searching for the easiest way to get
results in GUI python . I looked at Tkinter, Glade and QT.
For me the most productive was using WxPython. It seems that Glade and QT
are the closest to the
VB concept but they are also (to me) the most difficult to get information,
books and tutorials that I
have been able to put to use.
I would think it would be better if I could use a VB approach to GUI layout
and it seems that QT as well
as WxGlade offer the greatest possibility to accomplish that. But, for my
very simple GUI projects, WxPython has allowed me to accomplish those, as
mentioned, very simple task.
I do like the ability to drag and place of objects as WxGlade seems to
offer, but I have not found any books or online tutorials that cover
everything in detail(s). So far, the 'Robbin' book has worked for me.
My two cents
--
View this message in context: http://wxpython-users.1045709.n5.nabble.com/Do-you-use-wxglade-or-code-GUI-yourself-tp5721754p5721923.html
Sent from the wxPython-users mailing list archive at Nabble.com.