Re: [Gambas-user] Buttons again not working
2009/12/10 Kadaitcha Man nospam.nospam.nos...@gmail.com: Look at the attached code, and take note of the form design. Scratch that. You may have found a bug, either inadvertently or advertantly ;- With MyTextBox declared as public, xMyTextBox_Change isn't firing: MyTextBox = NEW TextBox(HBox1) AS xMyTextBox I'll start to research it in about 14-16hrs time. In the meantime, hope for a better response. -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Buttons again not working
I don't understand why is the handling of dynamically created forms so complicated! I've barely managed to shut a modal dialog, I'm encountering a new problem: when I invoke the procedure Messenger: PUBLIC SUB Messenger(tekst AS String, slika AS String) DIM imge AS PictureBox DIM conti AS TextLabel DIM butty AS Button DIM i AS Integer keret = NEW Form keret.Width = 500 keret.Height = 300 keret.Border = FALSE imge = NEW PictureBox(keret) imge.x = 10 imge.y = 10 imge.Width = 280 imge.Height = 280 imge.Border = TRUE imge.Picture = Picture[slika] conti = NEW TextLabel(keret) conti.x = 300 conti.y = 20 conti.Width = 190 conti.Height = 230 conti.Text = tekst butty = NEW Button(keret) butty.x = 340 butty.y = 250 butty.Width = 120 butty.Height = 25 butty.Text = OK keret.Center Object.Attach(butty, ME, Ops) You should write: butty = NEW Button(keret) AS Ops to have the same effect. You should use the Move() method instead of setting the X, Y, Width and Height properties individually. keret.ShowModal() END PUBLIC SUB Ops_Click() keret.Close() END from within the PUBLIC SUB _new() ... Messenger(blabla.txt,blabla.jpg) ... END procedure, I cannot communicate with the button butty. What do you mean exactly by communicate? Can you provide the full source code in a project, we will better understand what you want to do. Beware that an object is locked during its _new() so it cannot receive events. Regards, -- Benoît Minisini -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Buttons again not working
What do you mean exactly by communicate? Can you provide the full source code in a project, we will better understand what you want to do. Beware that an object is locked during its _new() so it cannot receive events. Regards, -- Benoît Minisini I mean, the procedure Ops_Click() is simply never invoked. A window shows up, with an image, a text and a button - butty. I intend to to use this button for closing the window. The first occurance of the subroutine Messenger is in the _new() procedure, which is intended to set the initial settings for the program. At the time when this happens, no other forms are already created. The code is pretty long ( 7000 lines, the *GamCat* project on sourceforge, but I'm sending you the first part of it, the _new() procedure: PUBLIC SUB _new() '# Initial settings ## DIM q1, q2, xenon, path, nfile AS String DIM place, node, temptxt, querry, prime, liner, x, mounter, onefound AS String DIM tarto, gomb, nexus, tremor, mark, mounthits, secondary AS String[] DIM i, knor, l, m AS Integer DIM fstab, config AS File a1 = NEW String[] a2 = NEW String[] a3 = NEW String[] a4 = NEW Float[] a5 = NEW String[] valvolume = NEW String[] DVDPanel.Value = FALSE 'At start the Virtual Compilation is empty and features are disabled tippi.Add(tippiData.Text) tippi.Add(tippiAudio.Text) rating.Add(-) ratingPic.Picture = Picture[unrated.png] year1.Value = Year(Now) month1.Value = Month(Now) day1.value = Day(Now) year2.MinValue = year1.Value mtype.Add(700 MB) mtype.Add(4.4 GB) mtype.Add(8.0 GB) mediaImg.Picture = Picture[CD.png] Saver.compilatSi = 700 IF Exist(User.Home /.GamCat) = FALSE THEN MKDIR User.Home /.GamCat 'First run screen for the devices mark = NEW String[] config = OPEN User.Home /.GamCat/config.txt FOR CREATE CLOSE (config) *Messenger(firstrun.Text, cat1.png)* config = OPEN User.Home /.GamCat/config.txt FOR WRITE fstab = OPEN /etc/mtab FOR INPUT WHILE NOT Eof(fstab) LINE INPUT #fstab, place mounthits = Split(place, ) IF (InStr(mounthits[1], /media/) 0 AND InStr(mounthits[2], vfat) = 0) THEN node = InputBox(dev1.Text mounthits[0], dev2.Text, ) PRINT #config, mounthits[0] mark.Add(node) ENDIF WEND CLOSE (fstab) CLOSE (config) IF mark.Count = 0 THEN Message(Fatal.Text) node = rm -rf Chr$(34) User.Home /.GamCat Chr$(34) SHELL node WAIT QUIT ENDIF IF mark.Count = 1 THEN mark.Add(second) ENDIF 'Database creation DBconX.Type = sqlite DBconX.Host = User.Home /.GamCat TRY DBconX.Open() IF ERROR THEN Message(SetupError.Text) node = rm -rf Chr$(34) User.Home /.GamCat Chr$(34) SHELL node WAIT QUIT ELSE IF NOT DBconX.Databases.Exist(GamCat) THEN DBconX.Databases.Add(GamCat) WAIT 0.5 'apperently this is needed for an SQLite database ' Close the server connection DBconX.Close() ENDIF ENDIF DBconX.Name = GamCat DBconX.Type = sqlite DBconX.Host = User.Home /.GamCat TRY DBconX.Open() prime = CREATE TABLE zzz(content VARCHAR(30),size REAL,files INTEGER,folders INTEGER,timing TEXT,media TEXT) DBconX.Exec(prime) WAIT 0.1 prime = CREATE TABLE infos(size REAL,files INTEGER,folders INTEGER,nn TEXT,first TEXT,second TEXT,delay TEXT); DBconX.Exec(prime) q1 = Chr$(34) 0 Chr$(34) q2 = Chr$(34) 1 Chr$(34) prime = INSERT INTO infos VALUES(0,0,0 , q2 ,' mark[0] ',' mark[1] ','20'); DBconX.Exec(prime) prime = CREATE TABLE ZIP(Name TEXT,Volume TEXT,Parent TEXT); DBconX.Exec(prime) prime = CREATE TABLE TAR(Name TEXT,Volume TEXT,Parent TEXT); DBconX.Exec(prime) prime = CREATE TABLE RAR(Name TEXT,Volume TEXT,Parent TEXT); DBconX.Exec(prime) prime = CREATE TABLE ARJ(Name TEXT,Volume TEXT,Parent TEXT); DBconX.Exec(prime) prime = CREATE TABLE ACE(Name TEXT,Volume TEXT,Parent TEXT); DBconX.Exec(prime) prime = CREATE TABLE AVAILABLEMYDISKLIST(Volume VARCHAR(30),Rating TEXT,Genre TEXT); DBconX.Exec(prime) prime = CREATE TABLE LENTMYDISKROMLIST(Volume VARCHAR(30),Used TEXT,Rating TEXT,Genre TEXT,Time TEXT); DBconX.Exec(prime) prime = CREATE TABLE AVAILABLEMYDVDLIST(Volume VARCHAR(30),Rating TEXT,Genre TEXT); DBconX.Exec(prime) prime = CREATE TABLE LENTMYDISKDVDLIST(Volume VARCHAR(30),Used TEXT,Rating TEXT,Genre TEXT,Time TEXT); DBconX.Exec(prime) prime = CREATE TABLE LISTOFMYCUSTOMERS(Name TEXT); DBconX.Exec(prime) prime = CREATE TABLE LISTOFMYALLGENRES(Name TEXT); DBconX.Exec(prime) prime = CREATE TABLE TEMPORALBASKETOFELEMENTS(Name TEXT,Origin TEXT,Rating TEXT,Genre TEXT); DBconX.Exec(prime) prime = CREATE TABLE LISTOFBANNEDFILES(Name TEXT); DBconX.Exec(prime) prime = CREATE TABLE CHANGEDFILENAMECATALOG(Old Text(30),Volume Text(30),Path Text(30),NEW Text(30)); DBconX.Exec(prime) prime = CREATE TABLE VOLUMENOTESFORALL(Volume Text(30),Notes Text(300)); DBconX.Exec(prime) WAIT 0.5 DBconX.Close() i = Message.Question(MessageImport.Text, MessageYes.Text, MessageNo.Text) IF i = 1 THEN Dialog.Path = User.Home Dialog.Filter = [*.zip, Zip Archive] IF Dialog.OpenFile(TRUE) THEN RETURN FOR EACH nfile
Re: [Gambas-user] Buttons again not working
So how to stop the rest of the process, while the Messenger( , ) is being executed? I've tried to experimenting with WAIT, but no help. This is the most annoying thing in Gambas. You never know exactly what to do in order to make things work. Is there a possibility, to make the process handling unified? ( What's the difference between Object.Attach (something, parent, function name) and your proposal ?) Anyway, butty = NEW Button(keret) AS Ops doesn't work. Please again provide an archive of your full project, otherwise I can't help you. I have downloaded your source from sourceforge, but I didn't see anything related to your problem. If the source project is greater then 256K, it won't go on the mailing-list. So send it me directly. Regards, -- Benoît Minisini -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Buttons again not working
2009/12/10 Benoît Minisini gam...@users.sourceforge.net: You should write: butty = NEW Button(keret) AS Ops to have the same effect. That's what I thought, but when I tried a similar thing with a TextBox, it appeared that the TextBox events were not firing. I'll take another look at it later this afternoon just in case I made a mistake. If it's a problem I'll post the code. -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Buttons again not working
2009/12/10 Kadaitcha Man nospam.nospam.nos...@gmail.com: 2009/12/10 Benoît Minisini gam...@users.sourceforge.net: You should write: butty = NEW Button(keret) AS Ops to have the same effect. That's what I thought, but when I tried a similar thing with a TextBox, it appeared that the TextBox events were not firing. I'll take another look at it later this afternoon just in case I made a mistake. If it's a problem I'll post the code. Yep. I made a mistake. I was editing the wrong TextBox. Sheesh. -- Return on Information: Google Enterprise Search pays you back Get the facts. http://p.sf.net/sfu/google-dev2dev ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user