Pavel Stranak wrote: >I am really lost now. >When I try my old Perl/Tk code with Labelframe I get this error: >------------- >Tcl error 'bad option "Labelframe": must be cget or configure >at >/net/su/h/local2-rh8/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Tcl.pm >line 548. >' while invoking scalar result call: > ". Labelframe -text SemLex -padx 2 -pady 2" >at >/net/su/h/local2-rh8/lib/perl5/site_perl/5.8.5/i386-linux-thread-multi/Tcl.pm >line 549 >--------------- >When I try Vadim's example, I get (on Fedora): >Tcl error 'invalid command name "iwidgets::labeledframe" > >
may be you do not have iwidgets installed on Fedora? Look into your /usr/lib I believe you can either use ActiveTcl's iwidgets, or may be search for proper rpm there... But then again, you succeeded running your code within Mac OS? >In windows with ActiveTcl it works, as long as there is no button in the >Labelframe. When I uncomment the following line it hangs. Why? >#$ne->Button(-text=>'qwerty')->pack; >On my Mac (with default Tcl install of MacOS X 10.4) it hangs without >any error too. > > It was looping because conflicting geometry managers are: one withing megawidget and other within your button. It was my fault for not reading iwidgets documentation. Within iwidgets, you need to retrieve a widget for further placement with a "childsite" method, so: my $site = $ne->childsite; $site->Button(-text=>'qwerty')->pack; Why not using Labeframe provided with Tcl::Tk? It uses Tcl/Tk's one, and should be good. Actually we can make for Tcl::Tk to play nicely with iwidgets's Labelframe, and this will be one-line change in the Tcl::Tk module, it was not done earlier just because you are the first one to try this... >I would really like to find some documentation or more examples. >I can't figure out this Labelframe thing, balloon help (just saying 'use >Tcl::Tk::Widget::Balloon;' does not help) and ROText (or even better >equivalent of Tk::Text::Viewer). > > I hope I'll update documentation very soon... >Thanks for your help. Tcl::Tk looks in some aspects better than Perl/Tk, >but there is a problem with documentation for those of us, who don't >understand Tcl itself and need to reuse old Perl/Tk code. > > Well, Tcl/Tk is easier to construct GUI than perl/Tk, and perl/Tk is harder to learn than Tcl/Tk. But, indeed, once you know perl/Tk and do not know Tcl/Tk then you can get lost. May be a simplier approach is the following: 1. do GUI construction with pure Tcl/Tk and feed to Tcl::Tk interpreter; do not be afraid, it isn't hard: $int->Eval('<<EOS'); package require Iwidgets labelframe .lf pack .lf set cs [.lf childsite] button $cs.b pack $cs.b EOS You can test this code with 'wish', or copy/paste from demo or example without Tcl/Tk <->perl/Tk syntax translation. 2. connect to Tcl/Tk widgets for Tcl::Tk: my $lf = widget('.lf'); 3. use misc perl/Tk-like approach: $lf->method(....); >Pavel > > > >On Tue, 2006-05-16 at 23:27 -0700, Jeff Hobbs wrote: > > >>Konovalov, Vadim Vladimirovich (Vadim)** CTR ** wrote: >> >> >>>But you'll better use LabelFrame from BWidgets, as it is better maintained. >>> >>> >>Actually, you are best off with Tk 8.4's core labelframe widget, >>although bwidgets and iwidgets have other widgets to consider. >> >>Jef >> >> > > > > > > >