[Gambas-user] Need help on Tabstrip
Stefano Palmeri
rospolosco at ...152...
Sun Aug 29 15:32:41 CEST 2010
Il domenica 29 agosto 2010 14:01:26 Benoît Minisini ha scritto:
> > Il sabato 28 agosto 2010 22:05:28 Benoît Minisini ha scritto:
> > > > Il sabato 28 agosto 2010 10:57:29 Reynaldi Jansen ha scritto:
> > > > > Hello.
> > > > >
> > > > > I want to ask how to copy control in tab to another tab?
> > > > > I have a tabstrip with textarea, and when user want new tab, i want
> > > > > it create a new tab with textarea too inside the new tab...
> > > > > I don't have any idea how to do this on gambas...
> > > > > Sorry for a poor question :-(
> > > > >
> > > > > Thanks!
> > > >
> > > > Hi. I attached a little example.
> > > >
> > > > The GTK version is needed if you're under a 'gtk' desktop, but it
> > > > works well even under qt. So the GTK version is the good one; it has
> > > > two more lines of code because the NOT-gtk version crashes the Gambas
> > > > IDE. Is it a bug, Benoit?
> > >
> > > I don't see any difference in the source code of both projects. Both
> > > work as expected. Are you sure that you sent the good files?
> >
> > Sorry, I messed up things. Anyway the two lines are these:
> >
> > TabStrip1[TabStrip1.Count - 1].Text = "Tab " & (TabStrip1.Count - 1)
> > TabStrip1.Index = TabStrip1.Count - 1
> >
> > With gb.qt you *don't need* these two lines to create a 'New Tab' and put
> > focus on it. It works perfectly.
> >
> > If you remove these two lines gb.qt still works, but gb.gtk crashes the
> > IDE. Attached the fixed example. Try selecting gb.gtk and you get a
> > crash, at least on my system.
> >
> > Gambas 2.20
> > Qt 3.3.8b
> > Gtk 2.12.12
> >
> > Saluti,
> >
> > Stefano
>
> Here is the explanation:
>
> When you create a TabStrip child, it is inserted in the current tab.
>
> Apparently, after having increased the Count property, gb.qt shows the last
> tab, whereas gb.gtk stays on the first tab. So when you browse the children
> of the first tab and insert a new TextArea, it is inserted there, and then
> you have one more child in the first tab. That new child is found in the
> next iteration of the browse loop, and so a new child is created again in
> the first tab, and so on, until no more control can be created.
>
> I fixed the bug in revision #3154.
>
> Regards,
Well. Thanks for explanation.
Stefano
More information about the User
mailing list