Re: How to set my gui?

Discussion in 'Python' started by John Gordon, Apr 18, 2013.

  1. John Gordon

    John Gordon Guest

    In <5170648d$0$1368$> Tracubik <> writes:

    > i suppose i've to first generate the window and than populate it, but
    > where i've to put the "search for occurences" code? I don't think init()
    > is the right place..


    What GUI library are you using?

    --
    John Gordon A is for Amy, who fell down the stairs
    B is for Basil, assaulted by bears
    -- Edward Gorey, "The Gashlycrumb Tinies"
    John Gordon, Apr 18, 2013
    #1
    1. Advertising

  2. On Fri, Apr 19, 2013 at 7:36 AM, Tracubik <> wrote:
    > On 18/04/2013 23:27, John Gordon wrote:
    >>
    >> In <5170648d$0$1368$> Tracubik
    >> <> writes:
    >>
    >>> i suppose i've to first generate the window and than populate it, but
    >>> where i've to put the "search for occurences" code? I don't think init()
    >>> is the right place..

    >>
    >>
    >> What GUI library are you using?
    >>

    >
    > Gtk3 via Glade, anyway the problem is referred to all gui toolkit, isn't it?


    You're looking here for fairly broad and general advice on GUI code
    layout. Unfortunately that's so broad that all I can say is "there are
    many ways to do it". :)

    Back in the 1990s, I used to (mostly) treat GUI programming as
    somewhat different from console programming. I'd use a window-builder,
    I'd structure my code in an event loop instead of top-down imperative,
    I'd use an IDE rather than simply coding in a text editor. But 1
    Corinthians 13:11. These days, GUI programming is to me just
    programming and calling on certain libraries/modules. There are many
    ways to lay out code, and treating the GUI framework/boilerplate as
    the most important is only one of them.

    One thing you may want to consider is using your main thread for the
    UI, and spinning off another thread to do your search. But do that
    ONLY if you know you understand threads, and threading in Python.
    Otherwise you'll make your life unnecessarily hard. :)

    ChrisA
    Chris Angelico, Apr 18, 2013
    #2
    1. Advertising

  3. On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <> wrote:
    > On Fri, 19 Apr 2013 08:00:11 +1000, Chris Angelico wrote:
    >
    >> But 1 Corinthians 13:11

    >
    > You are grown up now, I surmise.


    :) Born in 1984, so that'll give you some idea where I was in the 1990s.

    ChrisA
    Chris Angelico, Apr 19, 2013
    #3
  4. Hi,

    > These days, GUI programming is to me just
    > programming and calling on certain libraries/modules.

    +1

    > One thing you may want to consider is using your main thread for the
    > UI, and spinning off another thread to do your search. But do that
    > ONLY if you know you understand threads, and threading in Python.
    > Otherwise you'll make your life unnecessarily hard. :)

    For simple tasks, you don't need threads, but can use the glib-functions
    timeout_add(), idle_add() etc.

    Roland
    Roland Koebler, Apr 19, 2013
    #4
  5. On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico <>
    declaimed the following in gmane.comp.python.general:

    > On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <> wrote:
    > > On Fri, 19 Apr 2013 08:00:11 +1000, Chris Angelico wrote:
    > >
    > >> But 1 Corinthians 13:11

    > >
    > > You are grown up now, I surmise.

    >
    > :) Born in 1984, so that'll give you some idea where I was in the 1990s.
    >


    A puppy to be taught by greymuzzles (unfortunately, /this/
    greymuzzle [1958] has reached the point of being an old dog that only
    learns new tricks with extreme difficulty <G>)
    --
    Wulfraed Dennis Lee Bieber AF6VN
    HTTP://wlfraed.home.netcom.com/
    Dennis Lee Bieber, Apr 20, 2013
    #5
  6. On Sat, Apr 20, 2013 at 9:10 AM, Dennis Lee Bieber
    <> wrote:
    > On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico <>
    > declaimed the following in gmane.comp.python.general:
    >
    >> On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <> wrote:
    >> > On Fri, 19 Apr 2013 08:00:11 +1000, Chris Angelico wrote:
    >> >
    >> >> But 1 Corinthians 13:11
    >> >
    >> > You are grown up now, I surmise.

    >>
    >> :) Born in 1984, so that'll give you some idea where I was in the 1990s.
    >>

    >
    > A puppy to be taught by greymuzzles (unfortunately, /this/
    > greymuzzle [1958] has reached the point of being an old dog that only
    > learns new tricks with extreme difficulty <G>)


    Yep, taught by my Dad, who has often told the story of how he once
    held a whole kilobyte of memory in his hands (something like a cubic
    meter in size). He introduced me to programming, to fiddling with the
    system configs (actually he forbade that, for ages - because he had to
    clean up the mess if the system wouldn't boot), and to the joys of
    networking. So in a large way he's why I'm a geek... and actually he
    started that even earlier, when I was given the name Chris at birth.
    That on its own probably is the biggest cause of my geekery, I think!

    ChrisA
    Chris Angelico, Apr 20, 2013
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. paul.foreman

    GUI - GUI value passing

    paul.foreman, Oct 22, 2004, in forum: Java
    Replies:
    5
    Views:
    746
    Michael Rauscher
    Oct 25, 2004
  2. ulysses
    Replies:
    4
    Views:
    764
    Werner Schiendl
    Oct 22, 2003
  3. Andrew Lapidas

    PyGTK GUI update without signals from GUI

    Andrew Lapidas, Apr 13, 2008, in forum: Python
    Replies:
    0
    Views:
    413
    Andrew Lapidas
    Apr 13, 2008
  4. Stefan Ram
    Replies:
    3
    Views:
    490
    Arne Vajhøj
    Nov 20, 2011
  5. Hal Fulton

    GUI and non-GUI data

    Hal Fulton, Aug 5, 2004, in forum: Ruby
    Replies:
    1
    Views:
    137
    Austin Ziegler
    Aug 5, 2004
Loading...

Share This Page