From shussai2 at yahoo.com Wed Aug 24 15:28:58 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Wed, 24 Aug 2005 06:28:58 -0700 (PDT) Subject: [Tkinter-discuss] Frame Background Message-ID: <20050824132858.6079.qmail@web30309.mail.mud.yahoo.com> Hi, I am trying to set the background of a frame to an image (gif). Can anyone please let me know how to accomplish this. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From shussai2 at yahoo.com Wed Aug 24 15:34:35 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Wed, 24 Aug 2005 06:34:35 -0700 (PDT) Subject: [Tkinter-discuss] Frame Background Message-ID: <20050824133435.44009.qmail@web30306.mail.mud.yahoo.com> Hi, I maybe repeating my email, but in any case can anyone please tell me how to set the background of a frame to a gif image. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jepler at unpythonic.net Wed Aug 24 15:48:58 2005 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Wed, 24 Aug 2005 08:48:58 -0500 Subject: [Tkinter-discuss] Frame Background In-Reply-To: <20050824133435.44009.qmail@web30306.mail.mud.yahoo.com> References: <20050824133435.44009.qmail@web30306.mail.mud.yahoo.com> Message-ID: <20050824134854.GA23365@unpythonic.net> Frames can only have a fixed-color background. However, it is possible to give a label widget an image, and then use that label more or less like a frame. This doesn't include the ability to tile the image. (You could replace the label with a canvas, and create multiple image objects on the canvas, to achieve this effect---I'll leave this as an exercise) Here's an example (replace "2313usb.gif" with something you have on your system, it's just an image I had on hand). The line 'l.pack_propagate(0)' tells Tk to make the 'l' widget take the size of its image or label, not the size it would take based on its children. # label_as_frame.py from Tkinter import * t = Tk() p = PhotoImage(file="2313usb.gif") l = Label(t, image=p) e = Entry(l, width=20) e.pack(side=TOP, anchor=W, padx=4, pady=4) e.focus() b = Button(l, command=t.destroy, text="Close") b.pack(side=BOTTOM, expand=Y, anchor=S) l.pack_propagate(0) l.pack() t.mainloop() Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20050824/889c267e/attachment.pgp From fredrik at pythonware.com Wed Aug 24 15:49:31 2005 From: fredrik at pythonware.com (Fredrik Lundh) Date: Wed, 24 Aug 2005 15:49:31 +0200 Subject: [Tkinter-discuss] Frame Background References: <20050824132858.6079.qmail@web30309.mail.mud.yahoo.com> Message-ID: Sajjad Hussain wrote: > I am trying to set the background of a frame to an > image (gif). Can anyone please let me know how to > accomplish this. you can't. if you need to display an image, use a Label (or a Canvas, but that's probably overkill). From shussai2 at yahoo.com Fri Aug 26 16:26:57 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Fri, 26 Aug 2005 07:26:57 -0700 (PDT) Subject: [Tkinter-discuss] Setting the size of a Window Message-ID: <20050826142657.65562.qmail@web30301.mail.mud.yahoo.com> Hi, I am trying to restrict the user from resizing the Tk window. (So my labels on the graphics don't get distorted). Can anyone please point me in the right direction to do so. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jepler at unpythonic.net Sat Aug 27 17:59:35 2005 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Sat, 27 Aug 2005 10:59:35 -0500 Subject: [Tkinter-discuss] Setting the size of a Window In-Reply-To: <20050826142657.65562.qmail@web30301.mail.mud.yahoo.com> References: <20050826142657.65562.qmail@web30301.mail.mud.yahoo.com> Message-ID: <20050827155931.GB17001@unpythonic.net> Please see the .wm_geometry, .wm_maxsize and .wm_minsize methods of Tk and Toplevel widgets. Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20050827/8caffc10/attachment.pgp From harlinseritt at yahoo.com Sun Aug 28 00:36:09 2005 From: harlinseritt at yahoo.com (Harlin Seritt) Date: Sat, 27 Aug 2005 15:36:09 -0700 (PDT) Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 18, Issue 2 In-Reply-To: Message-ID: <20050827223609.80642.qmail@web52215.mail.yahoo.com> Hi Sajjad, You can see how to do this here: http://www.pythonware.com/library/tkinter/introduction/x9867-window-geometry-methods.htm at the very bottom of the page. The resizable option takes a tuple instead of something like resizable=False. Essentially, you'll need to do the following: master.resizable(0, 0) # as in x=0 and y=0 if master is an instance of Tk() This will keep the window from being resized and make the 'maximum' button on the window to be shown as inactive (or 'grayed out' as some may say). HTH, Harlin Seritt tkinter-discuss-request at python.org wrote: Send Tkinter-discuss mailing list submissions to tkinter-discuss at python.org To subscribe or unsubscribe via the World Wide Web, visit http://mail.python.org/mailman/listinfo/tkinter-discuss or, via email, send a message with subject or body 'help' to tkinter-discuss-request at python.org You can reach the person managing the list at tkinter-discuss-owner at python.org When replying, please edit your Subject line so it is more specific than "Re: Contents of Tkinter-discuss digest..." Today's Topics: 1. Setting the size of a Window (Sajjad Hussain) ---------------------------------------------------------------------- Message: 1 Date: Fri, 26 Aug 2005 07:26:57 -0700 (PDT) From: Sajjad Hussain Subject: [Tkinter-discuss] Setting the size of a Window To: tkinter-discuss at python.org Message-ID: <20050826142657.65562.qmail at web30301.mail.mud.yahoo.com> Content-Type: text/plain; charset=iso-8859-1 Hi, I am trying to restrict the user from resizing the Tk window. (So my labels on the graphics don't get distorted). Can anyone please point me in the right direction to do so. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com ------------------------------ _______________________________________________ Tkinter-discuss mailing list Tkinter-discuss at python.org http://mail.python.org/mailman/listinfo/tkinter-discuss End of Tkinter-discuss Digest, Vol 18, Issue 2 ********************************************** __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050827/9b47cb7d/attachment.htm From godson.g at gmail.com Sun Aug 28 05:23:35 2005 From: godson.g at gmail.com (Godson) Date: Sun, 28 Aug 2005 08:53:35 +0530 Subject: [Tkinter-discuss] Tkinter-discuss Digest, Vol 18, Issue 2 In-Reply-To: References: Message-ID: hi sajid, you simply use that wm_resizeble option where you can restrict the user from changing its height or width Regards Godson On 8/27/05, tkinter-discuss-request at python.org < tkinter-discuss-request at python.org> wrote: > > Send Tkinter-discuss mailing list submissions to > tkinter-discuss at python.org > > To subscribe or unsubscribe via the World Wide Web, visit > http://mail.python.org/mailman/listinfo/tkinter-discuss > or, via email, send a message with subject or body 'help' to > tkinter-discuss-request at python.org > > You can reach the person managing the list at > tkinter-discuss-owner at python.org > > When replying, please edit your Subject line so it is more specific > than "Re: Contents of Tkinter-discuss digest..." > > > Today's Topics: > > 1. Setting the size of a Window (Sajjad Hussain) > > > ---------------------------------------------------------------------- > > Message: 1 > Date: Fri, 26 Aug 2005 07:26:57 -0700 (PDT) > From: Sajjad Hussain > Subject: [Tkinter-discuss] Setting the size of a Window > To: tkinter-discuss at python.org > Message-ID: <20050826142657.65562.qmail at web30301.mail.mud.yahoo.com> > Content-Type: text/plain; charset=iso-8859-1 > > Hi, > > I am trying to restrict the user from resizing the Tk > window. (So my labels on the graphics don't get > distorted). Can anyone please point me in the right > direction to do so. > > Regards, > > Sajjad > > __________________________________________________ > Do You Yahoo!? > Tired of spam? Yahoo! Mail has the best spam protection around > http://mail.yahoo.com > > > ------------------------------ > > _______________________________________________ > Tkinter-discuss mailing list > Tkinter-discuss at python.org > http://mail.python.org/mailman/listinfo/tkinter-discuss > > > End of Tkinter-discuss Digest, Vol 18, Issue 2 > ********************************************** > -------------- next part -------------- An HTML attachment was scrubbed... URL: http://mail.python.org/pipermail/tkinter-discuss/attachments/20050828/522ce67f/attachment.htm From shussai2 at yahoo.com Sun Aug 28 18:29:17 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Sun, 28 Aug 2005 09:29:17 -0700 (PDT) Subject: [Tkinter-discuss] Updating of a Window Message-ID: <20050828162918.23617.qmail@web30307.mail.mud.yahoo.com> Hi, I have basically packed all my widgets and frames in a label (with an image) which serves as my background. Now the problem I am having is that when I leave my mouse curser on the title window (with the title of the program and min, max, quit icons) my screen inside that window is updated after 2 or 3 seconds. But when it is updated only the label's image is displayed and rest of my widgets (packed inside that label) disappear. Although when I go on top of the relative position of a disppeared button widget (packed inside that label) and click on it, it appears and functions properly. Can anyone please tell me what the problem is. On another topic, I read that non-rectangular windows such as the one used by Windows Media player can be created in Visual Studio using Windows GDI. (I have a link to a tutorial on how to do this if anyone is interested). I was wondering if we can do the same using Tkinter. I know Python has wrappers for some GDI methods. Also, if someone is interested in just displaying the GUI with no titlebar (no min, max, quit), they can use wm_overridedirect method. However, this method prevents the user in minimizing, maximizing or quitting (solution: provide your own quit method). You cannot move the window either. By the way, can we implement our own tk_grab methods to move windows. Regards, Sajjad __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com From jepler at unpythonic.net Sun Aug 28 19:07:40 2005 From: jepler at unpythonic.net (jepler@unpythonic.net) Date: Sun, 28 Aug 2005 12:07:40 -0500 Subject: [Tkinter-discuss] Updating of a Window In-Reply-To: <20050828162918.23617.qmail@web30307.mail.mud.yahoo.com> References: <20050828162918.23617.qmail@web30307.mail.mud.yahoo.com> Message-ID: <20050828170740.GA1326@unpythonic.net> On Sun, Aug 28, 2005 at 09:29:17AM -0700, Sajjad Hussain wrote: > On another topic, I read that non-rectangular windows > such as the one used by Windows Media player can be > created in Visual Studio using Windows GDI. (I have a > link to a tutorial on how to do this if anyone is > interested). I was wondering if we can do the same > using Tkinter. I know Python has wrappers for some GDI > methods. Also, if someone is interested in just > displaying the GUI with no titlebar (no min, max, > quit), they can use wm_overridedirect method. However, > this method prevents the user in minimizing, > maximizing or quitting (solution: provide your own > quit method). You cannot move the window either. By > the way, can we implement our own tk_grab methods to > move windows. An experimental version of the shape extension says it works on Windows. If this is true, it should be possible to use it from Tkinter. However, I have no idea what the build process is for Tk extensions on Windows. I have used the shape extension (0.3) on Linux, though only from tcl/tk programs, never from Tkinter ones. http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html Jeff -------------- next part -------------- A non-text attachment was scrubbed... Name: not available Type: application/pgp-signature Size: 189 bytes Desc: not available Url : http://mail.python.org/pipermail/tkinter-discuss/attachments/20050828/52b3c608/attachment.pgp From klappnase at web.de Tue Aug 30 11:34:22 2005 From: klappnase at web.de (Michael Lange) Date: Tue, 30 Aug 2005 11:34:22 +0200 Subject: [Tkinter-discuss] Updating of a Window In-Reply-To: <20050828170740.GA1326@unpythonic.net> References: <20050828162918.23617.qmail@web30307.mail.mud.yahoo.com> <20050828170740.GA1326@unpythonic.net> Message-ID: <20050830113422.385e23ff.klappnase@web.de> On Sun, 28 Aug 2005 12:07:40 -0500 jepler at unpythonic.net wrote: > On Sun, Aug 28, 2005 at 09:29:17AM -0700, Sajjad Hussain wrote: > > On another topic, I read that non-rectangular windows > > such as the one used by Windows Media player can be > > created in Visual Studio using Windows GDI. (I have a > > link to a tutorial on how to do this if anyone is > > interested). I was wondering if we can do the same > > using Tkinter. I know Python has wrappers for some GDI > > methods. Also, if someone is interested in just > > displaying the GUI with no titlebar (no min, max, > > quit), they can use wm_overridedirect method. However, > > this method prevents the user in minimizing, > > maximizing or quitting (solution: provide your own > > quit method). You cannot move the window either. By > > the way, can we implement our own tk_grab methods to > > move windows. > > An experimental version of the shape extension says it works on Windows. If > this is true, it should be possible to use it from Tkinter. However, I have no > idea what the build process is for Tk extensions on Windows. I have used the > shape extension (0.3) on Linux, though only from tcl/tk programs, never from > Tkinter ones. > > http://www.cs.man.ac.uk/~fellowsd/tcl/shapeidx.html > > Jeff > The tkdnd Tk extension includes shape (at least the linux version): . I have written a (yet experimental) wrapper for tkdnd (), so maybe you can try this. I never tried tkdnd or the wrapper on windows, though. Regards Michael From shussai2 at yahoo.com Tue Aug 30 22:59:54 2005 From: shussai2 at yahoo.com (Sajjad Hussain) Date: Tue, 30 Aug 2005 13:59:54 -0700 (PDT) Subject: [Tkinter-discuss] Installing tkdnd Message-ID: <20050830205954.77406.qmail@web30305.mail.mud.yahoo.com> Hi, I am trying to install tkdnd and its tkinter wrapper available from these sites: http://sourceforge.net/projects/tkdnd http://www.8ung.at/klappnase/TkinterDnD/TkinterDnD.html I have placed the TkinterDnD.py in the lib-Tk folder of Python. I have also unzipped and placed the tkdnd-1.0a2 (contains the demo, lib, doc folders) folder in Tcl\lib folder. There are two dlls available. They are: libtkdnd.dll and libtkdnd10.dll. I am not to sure where to place them. Now when I type the following commands, I get the error shown below: >>> from Tkinter import * >>> import TkinterDnD >>> root = TkinterDnD.Tk() Traceback (most recent call last): File "", line 1, in ? File "c:\Python23\lib\TkinterDnD.py", line 104, in __init__ self.tk.eval('package require tkdnd') TclError: can't find package tkdnd Can anyone please tell me what I am doing wrong. ____________________________________________________ Start your day with Yahoo! - make it your home page http://www.yahoo.com/r/hs