Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #43862 > unrolled thread

How to set my gui?

Started byTracubik <affdfsdfdsfsd@b.com>
First post2013-04-18 23:24 +0200
Last post2013-04-19 22:19 -0400
Articles 12 — 8 participants

Back to article view | Back to comp.lang.python


Contents

  How to set my gui? Tracubik <affdfsdfdsfsd@b.com> - 2013-04-18 23:24 +0200
    Re: How to set my gui? John Gordon <gordon@panix.com> - 2013-04-18 21:27 +0000
      Re: How to set my gui? Tracubik <affdfsdfdsfsd@b.com> - 2013-04-18 23:36 +0200
        Re: How to set my gui? Chris Angelico <rosuav@gmail.com> - 2013-04-19 08:00 +1000
          Re: How to set my gui? Walter Hurry <walterhurry@lavabit.com> - 2013-04-18 22:57 +0000
            Re: How to set my gui? Chris Angelico <rosuav@gmail.com> - 2013-04-19 09:24 +1000
            Re: How to set my gui? Dennis Lee Bieber <wlfraed@ix.netcom.com> - 2013-04-19 19:10 -0400
            Re: How to set my gui? Chris Angelico <rosuav@gmail.com> - 2013-04-20 12:10 +1000
        Re: How to set my gui? Roland Koebler <r.koebler@yahoo.de> - 2013-04-19 11:47 +0200
    Re: How to set my gui? Alister <alister.ware@ntlworld.com> - 2013-04-19 08:42 +0000
      Re: How to set my gui? Tracubik <affdfsdfdsfsd@b.com> - 2013-04-19 16:37 +0200
    Re: How to set my gui? Gene Heskett <gheskett@wdtv.com> - 2013-04-19 22:19 -0400

#43862 — How to set my gui?

FromTracubik <affdfsdfdsfsd@b.com>
Date2013-04-18 23:24 +0200
SubjectHow to set my gui?
Message-ID<5170648d$0$1368$4fafbaef@reader2.news.tin.it>
Hi all!
I'm trying to make a simple program that essentially do this:

1) open a html file (extracted epub file)
2) search for occurrences like "ita-ly"
3) put them on a simple GUI: 1 text field and two buttons: keepy it and 
correct it (i.e. it will become italy)

now this is quite simple but how can i do it properly?
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..

Thanks
MedeoTL

[toc] | [next] | [standalone]


#43863

FromJohn Gordon <gordon@panix.com>
Date2013-04-18 21:27 +0000
Message-ID<kkpof8$lhi$1@reader1.panix.com>
In reply to#43862
In <5170648d$0$1368$4fafbaef@reader2.news.tin.it> Tracubik <affdfsdfdsfsd@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?

-- 
John Gordon                   A is for Amy, who fell down the stairs
gordon@panix.com              B is for Basil, assaulted by bears
                                -- Edward Gorey, "The Gashlycrumb Tinies"

[toc] | [prev] | [next] | [standalone]


#43868

FromTracubik <affdfsdfdsfsd@b.com>
Date2013-04-18 23:36 +0200
Message-ID<51706772$0$1368$4fafbaef@reader2.news.tin.it>
In reply to#43863
On 18/04/2013 23:27, John Gordon wrote:
> In <5170648d$0$1368$4fafbaef@reader2.news.tin.it> Tracubik <affdfsdfdsfsd@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?

MedeoTL

[toc] | [prev] | [next] | [standalone]


#43870

FromChris Angelico <rosuav@gmail.com>
Date2013-04-19 08:00 +1000
Message-ID<mailman.803.1366322414.3114.python-list@python.org>
In reply to#43868
On Fri, Apr 19, 2013 at 7:36 AM, Tracubik <affdfsdfdsfsd@b.com> wrote:
> On 18/04/2013 23:27, John Gordon wrote:
>>
>> In <5170648d$0$1368$4fafbaef@reader2.news.tin.it> Tracubik
>> <affdfsdfdsfsd@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

[toc] | [prev] | [next] | [standalone]


#43872

FromWalter Hurry <walterhurry@lavabit.com>
Date2013-04-18 22:57 +0000
Message-ID<kkptp0$h9u$1@news.albasani.net>
In reply to#43870
On Fri, 19 Apr 2013 08:00:11 +1000, Chris Angelico wrote:

> But 1 Corinthians 13:11

You are grown up now, I surmise.

[toc] | [prev] | [next] | [standalone]


#43873

FromChris Angelico <rosuav@gmail.com>
Date2013-04-19 09:24 +1000
Message-ID<mailman.805.1366327480.3114.python-list@python.org>
In reply to#43872
On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <walterhurry@lavabit.com> 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

[toc] | [prev] | [next] | [standalone]


#43939

FromDennis Lee Bieber <wlfraed@ix.netcom.com>
Date2013-04-19 19:10 -0400
Message-ID<mailman.844.1366413058.3114.python-list@python.org>
In reply to#43872
On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico <rosuav@gmail.com>
declaimed the following in gmane.comp.python.general:

> On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <walterhurry@lavabit.com> 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
        wlfraed@ix.netcom.com    HTTP://wlfraed.home.netcom.com/

[toc] | [prev] | [next] | [standalone]


#43946

FromChris Angelico <rosuav@gmail.com>
Date2013-04-20 12:10 +1000
Message-ID<mailman.846.1366423856.3114.python-list@python.org>
In reply to#43872
On Sat, Apr 20, 2013 at 9:10 AM, Dennis Lee Bieber
<wlfraed@ix.netcom.com> wrote:
> On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico <rosuav@gmail.com>
> declaimed the following in gmane.comp.python.general:
>
>> On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry <walterhurry@lavabit.com> 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

[toc] | [prev] | [next] | [standalone]


#43892

FromRoland Koebler <r.koebler@yahoo.de>
Date2013-04-19 11:47 +0200
Message-ID<mailman.818.1366364844.3114.python-list@python.org>
In reply to#43868
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

[toc] | [prev] | [next] | [standalone]


#43891

FromAlister <alister.ware@ntlworld.com>
Date2013-04-19 08:42 +0000
Message-ID<cs7ct.16490$Pj4.16305@fx14.fr7>
In reply to#43862
On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote:

> Hi all!
> I'm trying to make a simple program that essentially do this:
> 
> 1) open a html file (extracted epub file)
> 2) search for occurrences like "ita-ly"
> 3) put them on a simple GUI: 1 text field and two buttons: keepy it and
> correct it (i.e. it will become italy)
> 
> now this is quite simple but how can i do it properly?
> 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..
> 
> Thanks MedeoTL
One simple way
Make a method to search for the next occorance & use that as button click 
event.




-- 
"Faith:  not *wanting* to know what is true."
-- Friedrich Nietzsche

[toc] | [prev] | [next] | [standalone]


#43901

FromTracubik <affdfsdfdsfsd@b.com>
Date2013-04-19 16:37 +0200
Message-ID<517156ad$0$1365$4fafbaef@reader2.news.tin.it>
In reply to#43891
On 19/04/2013 10:42, Alister wrote:
> On Thu, 18 Apr 2013 23:24:29 +0200, Tracubik wrote:
>
>> Hi all!
>> I'm trying to make a simple program that essentially do this:
>>
>> 1) open a html file (extracted epub file)
>> 2) search for occurrences like "ita-ly"
>> 3) put them on a simple GUI: 1 text field and two buttons: keepy it and
>> correct it (i.e. it will become italy)
>>
>> now this is quite simple but how can i do it properly?
>> 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..
>>
>> Thanks MedeoTL
> One simple way
> Make a method to search for the next occorance & use that as button click
> event.
>

Mmmmh, this seem good to me. But i also need to add some code in the 
__init__() of the GUI class to get the first occurence and put it in the 
text field.

Thanks for your reply, you was really helpful

MedeoTL

[toc] | [prev] | [next] | [standalone]


#44055

FromGene Heskett <gheskett@wdtv.com>
Date2013-04-19 22:19 -0400
Message-ID<mailman.906.1366633903.3114.python-list@python.org>
In reply to#43862
On Friday 19 April 2013 22:16:18 Chris Angelico did opine:

> On Sat, Apr 20, 2013 at 9:10 AM, Dennis Lee Bieber
> 
> <wlfraed@ix.netcom.com> wrote:
> > On Fri, 19 Apr 2013 09:24:36 +1000, Chris Angelico <rosuav@gmail.com>
> > 
> > declaimed the following in gmane.comp.python.general:
> >> On Fri, Apr 19, 2013 at 8:57 AM, Walter Hurry 
<walterhurry@lavabit.com> 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

Buncha spring chickens, the whole lot of you.  Born in '34, I was a geek 
before the word was invented.  But like some of you claim, I am now that 
old dog that doesn't learn new tricks easily.

Cheers, Gene
-- 
"There are four boxes to be used in defense of liberty:
 soap, ballot, jury, and ammo. Please use in that order."
-Ed Howdershelt (Author)
My web page: <http://coyoteden.dyndns-free.com:85/gene> is up!
My views 
<http://www.armchairpatriot.com/What%20Has%20America%20Become.shtml>
Mandrell: "You know what I think?"
Doctor:   "Ah, ah that's a catch question. With a brain your size you
	  don't think, right?"
		-- Dr. Who
A pen in the hand of this president is far more
dangerous than a gun in the hands of 200 million
          law-abiding citizens.

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web