How to set my gui?

Chris Angelico rosuav at gmail.com
Thu Apr 18 18:00:11 EDT 2013


On Fri, Apr 19, 2013 at 7:36 AM, Tracubik <affdfsdfdsfsd at b.com> wrote:
> On 18/04/2013 23:27, John Gordon wrote:
>>
>> In <5170648d$0$1368$4fafbaef at reader2.news.tin.it> Tracubik
>> <affdfsdfdsfsd at b.com> 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



More information about the Python-list mailing list