Re: [Tutor] Python GUI Tkinter Button arrangement

2011-02-16 Thread Alan Gauld


"Ganesh Kumar"  wrote


I am new to python , i have creating one application user
agreement..using Tkinter, The Content
of the agreement will reading one file...Agree button will click 
means

enable next button. And activate script,


I'm assuming by User Agreement you mean User Interface?
Maybe some translation software giving strange results?


all are working but one buttons are top of the screen.
i want button in bottom of the frame plz. help me..


It would help if you were a bit more explicit.
Which button is in the wrong place?


this my source code
http://pastebin.com/Lm5teAtS


There are lots of strange things here.
Can I suggest you keep it as simple as possible to start with.
And you should certainly not mix GUI tookits. You have
Tkinter, wx and GTk all included here. If you use Tkinter stick
with that.

Also there is no real need for ttk here yet - once you get
it working you can add some ttk to make it look pretty
but for now I'd stick with plain old Tkinter. (In fact I'd do
the same with PMW, but it does at least give you the
scrolling text box...)

I'm not sure what you think you are doing with the
sys.path line:

sys.path[:0] = ['../../..']

but I strongly suspect its not what you want!

Also it will help if you give your widgets meaningful names.
For example:

widget = Tkinter.Button(self1, text='Next',
   command = lambda b='dhana': 
buttonPress(b) )


why not call it nextButton instead of widget. (personally I just
add one or two letters so here it would be a b for Button
and the name would be: bNext) It makes the code much
easier to understand. You do it for the other buttons, why
not that one?

Also its usually better to keep all the widget construction in a
single place. You have widgets being constructed in 2 different
functions: init and initUI.

I have no idea what defaultKey() is doing. It defines a function
internally which is never used then calls  the main Tk() function
(I assume tk() is a mistake?) But Tk() should only be called once
in an app.

I think the line

if a1 == 1:

should be indented.

Finally, it's slightly unusual in a Tkinter app to define the
event handler functions inside the GUI building function.
It will work but it does mean those evenmt handlers are
invisible to the rest of the app which might limit your
flexibility to reuse them later

All in all it seems like a lot of complexity for what should
be a very simple application. Of course you may be
intending to change the structure to include much more
complex handler functions later. But as it stands it seems
complex for what it does.
.
HTH
--
Alan Gauld
Author of the Learn to Program web site
http://www.alan-g.me.uk/


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


Re: [Tutor] Python GUI Tkinter Button arrangement

2011-02-16 Thread Ahmed AL-Masri

I suggest to use boa constructor if you are new learning.
just google it. very easy tool to create your interface

--
From: "Ganesh Kumar" 
Sent: Wednesday, February 16, 2011 6:43 PM
To: 
Subject: [Tutor] Python GUI Tkinter Button arrangement


Hi..

I am new to python , i have creating one application user
agreement..using Tkinter, The Content

of the agreement will reading one file...Agree button will click means
enable next button. And activate script,

Quit button for exit the program,, Dis agree means one warning message
will show up..

all are working but one buttons are top of the screen.  i want button
in bottom of the frame plz. help me..

this my source code


Source Code

http://pastebin.com/Lm5teAtS

Thanks in Advance
-Ganesh.





--
Did I learn something today? If not, I wasted it.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor


[Tutor] Python GUI Tkinter Button arrangement

2011-02-16 Thread Ganesh Kumar
Hi..

I am new to python , i have creating one application user
agreement..using Tkinter, The Content

of the agreement will reading one file...Agree button will click means
enable next button. And activate script,

Quit button for exit the program,, Dis agree means one warning message
will show up..

all are working but one buttons are top of the screen.  i want button
in bottom of the frame plz. help me..

this my source code


Source Code

http://pastebin.com/Lm5teAtS

Thanks in Advance
-Ganesh.





-- 
Did I learn something today? If not, I wasted it.
___
Tutor maillist  -  Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor