some advice about Python GUI apps

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mitsura@skynet.be

    #1

    some advice about Python GUI apps

    Hi,

    I am writing a program in Python and I am using wx.Python for the GUI.
    I have no prior GUI and Python experience so that's why I turn to the
    specialists for aid.
    Basically, my app is a wx.tree object with items. You can click on each
    item and set some properties of the item (Pydata). To set the
    properties of an item you click on the item and then a 'Set item
    properties' window pops up.
    However, I am looking for a way that you can only open 1 property
    window per item. If I click on an item the 'Set item properties'
    windows open but when I return to the tree window and select the same
    item, I can open an additional 'set properties' window. This leads to
    all kind of C++ errors because these properties windows seems to
    interfere for some reason. I don't have enough OO/Python/GUI knowledge
    yet to fully understand what actually happens.
    Basically, what I want is that when you want to open an items property
    window and the window is alread open that in stead of opening a new
    window, the window the is already open pops to the foreground. Any
    ideay how I can implement this.

    Another solution would be to start the properties windows in a
    'synchronous' mode, meaning that if this window is open, that you can't
    manipulate the tree window anymore (~like in Word when you open the
    'open file' window, you can't edit your doc until you this window is
    closed again).

    I hope this makes some sense.

    Any help much appreciated.

    Kris

    Ps.: any refs to good OO/Python GUI books are also welcome (or URLs)

  • Franz Steinhaeusler

    #2
    Re: some advice about Python GUI apps

    On 14 Sep 2005 04:26:11 -0700, mitsura@skynet. be wrote:
    [color=blue]
    >Hi,
    >
    >I am writing a program in Python and I am using wx.Python for the GUI.
    >I have no prior GUI and Python experience so that's why I turn to the
    >specialists for aid.[/color]

    Hello Kris,

    I think the specialists are in the wxPython-mailing list ;)

    [color=blue]
    >Basically, my app is a wx.tree object with items. You can click on each
    >item and set some properties of the item (Pydata). To set the
    >properties of an item you click on the item and then a 'Set item
    >properties' window pops up.[/color]

    You mean a wx.TreeCtrl?
    I don't understand exactly what you mean with "properties ".
    Do you have a sample program?
    Sorry for not helping much.
    [color=blue]
    >However, I am looking for a way that you can only open 1 property
    >window per item. If I click on an item the 'Set item properties'
    >windows open but when I return to the tree window and select the same
    >item, I can open an additional 'set properties' window.
    >This leads to
    >all kind of C++ errors because these properties windows seems to
    >interfere for some reason. I don't have enough OO/Python/GUI knowledge
    >yet to fully understand what actually happens.
    >Basically, what I want is that when you want to open an items property
    >window and the window is alread open that in stead of opening a new
    >window, the window the is already open pops to the foreground. Any
    >ideay how I can implement this.
    >
    >Another solution would be to start the properties windows in a
    >'synchronous ' mode, meaning that if this window is open, that you can't
    >manipulate the tree window anymore (~like in Word when you open the
    >'open file' window, you can't edit your doc until you this window is
    >closed again).[/color]

    Is the properties window a wx.Dialog?
    If you show it with ShowModal(), then you must
    finish with it, before you can select another tree node.
    [color=blue]
    >I hope this makes some sense.
    >
    >Any help much appreciated.
    >
    >Kris
    >
    >Ps.: any refs to good OO/Python GUI books are also welcome (or URLs)[/color]

    There is a wxPython book in process, and it is publication is estimated
    around end of this year.
    --
    Franz Steinhaeusler

    Comment

    • mitsura@skynet.be

      #3
      Re: some advice about Python GUI apps

      Hi,

      the properties of the items are just virtual properties like e.g.
      color, icon, gender.
      Just image that an item represent a human. You can then click on the
      item and start a 'Set Human Properties' windows (a frame with a
      Notebook object with multiple tabs).
      In the 'Set Human Properties' window you then have multiple properties
      you can set/change like e.g. hair color, gender, skin tone, ... stuff
      like that.

      Comment

      • Varghjärta

        #4
        Re: some advice about Python GUI apps

        I'm not sure but wouldn't the simplest(perhap s) solution be to store a
        reference to all the dialogs you open up in a mapped array of some
        kind (dictionary) and whenever you are going to open up a dialog you
        check if it already exists a key matching whatever id you choose. If
        it exists then use the window refernce in there to make it go to
        front, else make a new, shove it in there with an id(key) of some kind
        and display it.

        Perhaps I misunderstood the question though.

        On 14 Sep 2005 04:26:11 -0700, mitsura@skynet. be <mitsura@skynet .be> wrote:[color=blue]
        > Hi,
        >
        > I am writing a program in Python and I am using wx.Python for the GUI.
        > I have no prior GUI and Python experience so that's why I turn to the
        > specialists for aid.
        > Basically, my app is a wx.tree object with items. You can click on each
        > item and set some properties of the item (Pydata). To set the
        > properties of an item you click on the item and then a 'Set item
        > properties' window pops up.
        > However, I am looking for a way that you can only open 1 property
        > window per item. If I click on an item the 'Set item properties'
        > windows open but when I return to the tree window and select the same
        > item, I can open an additional 'set properties' window. This leads to
        > all kind of C++ errors because these properties windows seems to
        > interfere for some reason. I don't have enough OO/Python/GUI knowledge
        > yet to fully understand what actually happens.
        > Basically, what I want is that when you want to open an items property
        > window and the window is alread open that in stead of opening a new
        > window, the window the is already open pops to the foreground. Any
        > ideay how I can implement this.
        >
        > Another solution would be to start the properties windows in a
        > 'synchronous' mode, meaning that if this window is open, that you can't
        > manipulate the tree window anymore (~like in Word when you open the
        > 'open file' window, you can't edit your doc until you this window is
        > closed again).
        >
        > I hope this makes some sense.
        >
        > Any help much appreciated.
        >
        > Kris
        >
        > Ps.: any refs to good OO/Python GUI books are also welcome (or URLs)
        >
        > --
        > http://mail.python.org/mailman/listinfo/python-list
        >[/color]

        Comment

        • malv

          #5
          Re: some advice about Python GUI apps

          Hi Kris,
          I used several GUI's, also wx.
          You should look at eric3, it's by far the best of all.

          Eric3 uses Qt. Qt is also great with C++.
          I ported a major Python project from Windows to Linux under Python-Qt
          and encountered no problem whatsoever.
          I use eric3 with Novell/SuSE Pro 9.3. All you need is already there.
          Good luck,
          malv

          Comment

          Working...