Skip Menu |

This queue is for tickets about the Tk CPAN distribution.

Report information
The Basics
Id: 103030
Status: resolved
Priority: 0/
Queue: Tk

People
Owner: Nobody in particular
Requestors: Kevin.Geng [...] imgtec.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



Subject: Problem about canvas
Date: Mon, 23 Mar 2015 13:28:50 +0000
To: "bug-Tk [...] rt.cpan.org" <bug-Tk [...] rt.cpan.org>
From: Kevin Geng <Kevin.Geng [...] imgtec.com>
Hi Tk team, I want to pack several widgets(Label,Frame,Entry) on a canvas, and they are packed from top to bottom. since the height of all these widgets beyound the height of canvas, so some widgets was not displayed out. I tried to add a scrollbar to the canvas and make it scrollable, and it doesn't work. But if I move all the widgets from the canvas and just draw a graphic on the canvas, the scrollbar can work. So I have a question about canvas, does it support scrollbar if it contains several other widgets? If yes, how to implement it? Could you help to give me a simple example? If no, which widget I can use as a widget container and also is scrollable? Your prompt response is very much appreciated! Thanks Kevin
On 2015-03-23 09:29:07, Kevin.Geng@imgtec.com wrote: Show quoted text
> Hi Tk team, > > I want to pack several widgets(Label,Frame,Entry) on a canvas, and > they are packed from top to bottom. > since the height of all these widgets beyound the height of canvas, > so some widgets was not displayed out. > I tried to add a scrollbar to the canvas and make it scrollable, and > it doesn't work. > But if I move all the widgets from the canvas and just draw a graphic > on the canvas, the scrollbar can work. > So I have a question about canvas, does it support scrollbar if it > contains several other widgets? > If yes, how to implement it? Could you help to give me a simple > example? > If no, which widget I can use as a widget container and also is > scrollable? > Your prompt response is very much appreciated! >
Hi Kevin, it's not possible to pack() other widgets into a canvas widget. But what's possible is to use the Tk::Canvas' createWindow() method to create a "window item", which is basically a canvas item containing arbitrary Tk widgets. Note that you have to do the geometry management manually. You can see a sample using window item in the "widget" demonstration program (which is usually installed together with Perl/Tk) in the "Canvases" section, "The canvas item types" deminstration. Regards, Slaven
Subject: RE: [rt.cpan.org #103030] Problem about canvas
Date: Tue, 24 Mar 2015 12:12:24 +0000
To: "bug-Tk [...] rt.cpan.org" <bug-Tk [...] rt.cpan.org>
From: Kevin Geng <Kevin.Geng [...] imgtec.com>
Hi Slaven, I create a main windows us Tk and some widgets(like label,frame,button) will be dynamically added to the main window from top to bottom. But if all the widgets' height beyond the main window's height, the latter added widget can't be displayed on the main window. I want the main window can scrollable if too many widgets were added to the it, so it can display all widgets. Does it possible? If yes, how to implement it? In fact, I feel that Tk module should provide a window or a widget container which can automatic scrollable if too many widgets was added on it. Does Tk module has such window or container? Thanks Kevin Show quoted text
-----Original Message----- From: Slaven_Rezic via RT [mailto:bug-Tk@rt.cpan.org] Sent: Tuesday, March 24, 2015 5:26 AM To: Kevin Geng Subject: [rt.cpan.org #103030] Problem about canvas <URL: https://rt.cpan.org/Ticket/Display.html?id=103030 > On 2015-03-23 09:29:07, Kevin.Geng@imgtec.com wrote:
> Hi Tk team, > > I want to pack several widgets(Label,Frame,Entry) on a canvas, and > they are packed from top to bottom. > since the height of all these widgets beyound the height of canvas, > so some widgets was not displayed out. > I tried to add a scrollbar to the canvas and make it scrollable, and > it doesn't work. > But if I move all the widgets from the canvas and just draw a graphic > on the canvas, the scrollbar can work. > So I have a question about canvas, does it support scrollbar if it > contains several other widgets? > If yes, how to implement it? Could you help to give me a simple > example? > If no, which widget I can use as a widget container and also is > scrollable? > Your prompt response is very much appreciated! >
Hi Kevin, it's not possible to pack() other widgets into a canvas widget. But what's possible is to use the Tk::Canvas' createWindow() method to create a "window item", which is basically a canvas item containing arbitrary Tk widgets. Note that you have to do the geometry management manually. You can see a sample using window item in the "widget" demonstration program (which is usually installed together with Perl/Tk) in the "Canvases" section, "The canvas item types" deminstration. Regards, Slaven
On 2015-03-24 08:12:42, Kevin.Geng@imgtec.com wrote: Show quoted text
> Hi Slaven, > > I create a main windows us Tk and some widgets(like > label,frame,button) will be dynamically added to the main window from > top to bottom. > But if all the widgets' height beyond the main window's height, the > latter added widget can't be displayed on the main window. > I want the main window can scrollable if too many widgets were added > to the it, so it can display all widgets. > Does it possible? If yes, how to implement it? > > In fact, I feel that Tk module should provide a window or a widget > container which can automatic scrollable if too many widgets was added > on it. > Does Tk module has such window or container? >
Check Tk::Pane. Show quoted text
> Thanks > Kevin > > -----Original Message----- > From: Slaven_Rezic via RT [mailto:bug-Tk@rt.cpan.org] > Sent: Tuesday, March 24, 2015 5:26 AM > To: Kevin Geng > Subject: [rt.cpan.org #103030] Problem about canvas > > <URL: https://rt.cpan.org/Ticket/Display.html?id=103030 > > > On 2015-03-23 09:29:07, Kevin.Geng@imgtec.com wrote:
> > Hi Tk team, > > > > I want to pack several widgets(Label,Frame,Entry) on a canvas, and > > they are packed from top to bottom. > > since the height of all these widgets beyound the height of canvas, > > so some widgets was not displayed out. > > I tried to add a scrollbar to the canvas and make it scrollable, and > > it doesn't work. > > But if I move all the widgets from the canvas and just draw a graphic > > on the canvas, the scrollbar can work. > > So I have a question about canvas, does it support scrollbar if it > > contains several other widgets? > > If yes, how to implement it? Could you help to give me a simple > > example? > > If no, which widget I can use as a widget container and also is > > scrollable? > > Your prompt response is very much appreciated! > >
> > Hi Kevin, > > it's not possible to pack() other widgets into a canvas widget. But > what's possible is to use the Tk::Canvas' createWindow() method to > create a "window item", which is basically a canvas item containing > arbitrary Tk widgets. Note that you have to do the geometry management > manually. > > You can see a sample using window item in the "widget" demonstration > program (which is usually installed together with Perl/Tk) in the > "Canvases" section, "The canvas item types" deminstration. > > Regards, > Slaven > >
Subject: RE: [rt.cpan.org #103030] Problem about canvas
Date: Wed, 25 Mar 2015 04:11:10 +0000
To: "bug-Tk [...] rt.cpan.org" <bug-Tk [...] rt.cpan.org>
From: Kevin Geng <Kevin.Geng [...] imgtec.com>
Hi Slaven, Great! It's what I really wanted. Thank you so much! Best Regards Kevin Show quoted text
-----Original Message----- From: Slaven_Rezic via RT [mailto:bug-Tk@rt.cpan.org] Sent: Wednesday, March 25, 2015 3:45 AM To: Kevin Geng Subject: [rt.cpan.org #103030] Problem about canvas <URL: https://rt.cpan.org/Ticket/Display.html?id=103030 > On 2015-03-24 08:12:42, Kevin.Geng@imgtec.com wrote:
> Hi Slaven, > > I create a main windows us Tk and some widgets(like > label,frame,button) will be dynamically added to the main window from > top to bottom. > But if all the widgets' height beyond the main window's height, the > latter added widget can't be displayed on the main window. > I want the main window can scrollable if too many widgets were added > to the it, so it can display all widgets. > Does it possible? If yes, how to implement it? > > In fact, I feel that Tk module should provide a window or a widget > container which can automatic scrollable if too many widgets was added > on it. > Does Tk module has such window or container? >
Check Tk::Pane.
> Thanks > Kevin > > -----Original Message----- > From: Slaven_Rezic via RT [mailto:bug-Tk@rt.cpan.org] > Sent: Tuesday, March 24, 2015 5:26 AM > To: Kevin Geng > Subject: [rt.cpan.org #103030] Problem about canvas > > <URL: https://rt.cpan.org/Ticket/Display.html?id=103030 > > > On 2015-03-23 09:29:07, Kevin.Geng@imgtec.com wrote:
> > Hi Tk team, > > > > I want to pack several widgets(Label,Frame,Entry) on a canvas, and > > they are packed from top to bottom. > > since the height of all these widgets beyound the height of canvas, > > so some widgets was not displayed out. > > I tried to add a scrollbar to the canvas and make it scrollable, > > and it doesn't work. > > But if I move all the widgets from the canvas and just draw a > > graphic on the canvas, the scrollbar can work. > > So I have a question about canvas, does it support scrollbar if it > > contains several other widgets? > > If yes, how to implement it? Could you help to give me a simple > > example? > > If no, which widget I can use as a widget container and also is > > scrollable? > > Your prompt response is very much appreciated! > >
> > Hi Kevin, > > it's not possible to pack() other widgets into a canvas widget. But > what's possible is to use the Tk::Canvas' createWindow() method to > create a "window item", which is basically a canvas item containing > arbitrary Tk widgets. Note that you have to do the geometry management > manually. > > You can see a sample using window item in the "widget" demonstration > program (which is usually installed together with Perl/Tk) in the > "Canvases" section, "The canvas item types" deminstration. > > Regards, > Slaven > >