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

-- 
Benoît Minisini

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program
Be part of this innovative community and reach millions of netbook users 
worldwide. Take advantage of special opportunities to increase revenue and 
speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Gambas-user mailing list
Gambas-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/gambas-user

Reply via email to