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
>
>