#154 Following the tutorial generates bad code.

closed
None
2015-12-30
2013-03-14
No

I am trying out various python gui designers. I believe I followed the tutorial correctly and here is the code that was generated for the app:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
#!/usr/bin/env python
# -*- coding: iso-8859-15 -*-
# generated by wxGlade 0.6.5 (standalone edition) on Wed Mar 13 13:56:25 2013

import wx
from  import                                     #joe note 0

class TutApp(wx.App): the app
    def OnInit(self):
        wx.InitAllImageHandlers()
        Frame with notebook = (None, -1, "")      #joe note 1
        self.SetTopWindow(Frame with notebook)    #joe note 2
        Frame with notebook.Show()                #joe note 3
        return 1

# end of class TutApp

if __name__ == "__main__":
    tutApp = TutApp(0)
    tutApp.MainLoop()

I get discouraged when the tutorial for something doesn't work. I am intrigued with wxGlade so i am writing this ticket instead of moving on to another tool.

joe note 0
invalid syntax

joe note 1-3
These seem to stem from the tutorial 1. Creation of the frame (last sentence) instruction:

The first thing we'll do is change the title of the frame, which is by default equal to the object's name, and insert "Frame with notebook": the change takes effect when the Title property loses focus.

Perhaps I made a mistake in my interpretation?

Thanks for the help in advance.

Love and peace,

Joe

Related

Bugs: #154

Discussion

  • Carsten Grohmann

    Hi Joe,

    Am Donnerstag, 14. März 2013 schrieb Joe Codeswell:

    import wx
    from import #joe note 0

    I'd like to answer your questions based on your wxg file. Could you attach it to this bug, please?

    Regards,
    Carsten

     
    Last edit: Carsten Grohmann 2013-03-14
  • Joe Codeswell

    Joe Codeswell - 2013-03-15

    Dear Carsten,

    Thanks for the response. You said:

    I'd like to answer your questions based on your wxg file. Could you attach it to this bug, please?

    Sure, Carsten. Thanks. Here it is.

    Thanks again, Carsten.

    Love and peace,

    Joe

     
  • Carsten Grohmann

    Hi Joe,

    you ran into a logical bug. The check for invalid names didn't block the
    invalid changes completely. Unfortunatelly the selection for "Top window" in
    "Application" tab was changed.

    This fix solved your issue:

    changeset: 1211:d4d79f527fcb
    tag: tip
    user: Carsten Grohmann
    date: Fri Mar 15 21:11:14 2013 +0100
    summary: Setting invalid windows names hasn't blocked fully (sf bug #154)

    You've two possibilities to fix your wxGlade design "tut.wxg":
    1) Open your favorite text editor and change >>top_window="Frame with
    notebook"<< into >>top_window="frame_1"<<.
    2) Rename "frame_1" into "frame_2", click in another window and rename the
    frame back to "frame_1"

    Could you confirm the solution, please?

    Regards,
    Carsten

     
    Last edit: Carsten Grohmann 2013-03-15
  • Carsten Grohmann

    • status: open --> closed
    • assigned_to: Carsten Grohmann
     
  • Carsten Grohmann

    It looks like the bug is gone now. Please reopen this report if the bug still exists.

     
  • Joe Codeswell

    Joe Codeswell - 2013-04-17

    Dear Carson,

    Sorry for the delay in responding. I didn’t go back to the tutorial;
    however, I am using wxGlade with great success and enthusiasm. Thanks for a
    GREAT app.

    Love and peace,

    Joe

    On Fri, Mar 15, 2013 at 1:26 PM, Carsten Grohmann cgrohmann@users.sf.netwrote:

    Hi Joe,

    you ran into a logical bug. The check for invalid names didn't block the
    invalid changes completely. Unfortunatelly the selection for "Top window"
    in
    "Application" tab was changed.

    This fix solved your issue:

    changeset: 1211:d4d79f527fcb
    tag: tip
    user: Carsten Grohmann mail@carstengrohmann.de
    date: Fri Mar 15 21:11:14 2013 +0100
    summary: Setting invalid windows names hasn't blocked fully (sf bug #154)

    You've two possibilities to fix your wxGlade design "tut.wxg":
    1) Open your favorite text editor and change >>top_window="Frame with
    notebook"<< into >>top_window="frame_1"<<.
    2) Rename "frame_1" into "frame_2", click in another window and rename the
    frame back to "frame_1"

    Could you confirm the solution, please?

    Regards,
    Carsten


    Status: open
    Created: Thu Mar 14, 2013 04:27 PM UTC by Joe Codeswell
    Last Updated: Fri Mar 15, 2013 03:56 PM UTC
    Owner: nobody

    I am trying out various python gui designers. I believe I followed the
    tutorial correctly and here is the code that was generated for the app:

    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20

    !/usr/bin/env python# -- coding: iso-8859-15 --# generated by wxGlade 0.6.5 (standalone edition) on Wed Mar 13 13:56:25 2013

    import wxfrom import #joe note 0
    class TutApp(wx.App): the app
    def OnInit(self):
    wx.InitAllImageHandlers()
    Frame with notebook = (None, -1, "") #joe note 1
    self.SetTopWindow(Frame with notebook) #joe note 2
    Frame with notebook.Show() #joe note 3
    return 1

    end of class TutApp

    if name == "main":
    tutApp = TutApp(0)
    tutApp.MainLoop()

    I get discouraged when the tutorial for something doesn't work. I am
    intrigued with wxGlade so i am writing this ticket instead of moving on to
    another tool.

    joe note 0
    invalid syntax

    joe note 1-3
    These seem to stem from the tutorial 1. Creation of the frame (last
    sentence)
    instruction:

    The first thing we'll do is change the title of the frame, which is by
    default equal to the object's name, and insert "Frame with notebook": the
    change takes effect when the Title property loses focus.

    Perhaps I made a mistake in my interpretation?

    Thanks for the help in advance.

    Love and peace,

    Joe

    Sent from sourceforge.net because you indicated interest in
    https://sourceforge.net/p/wxglade/bugs/154/

    To unsubscribe from further messages, please visit
    https://sourceforge.net/auth/prefs/

     

    Related

    Bugs: #154


Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:





No, thanks