Re: [Gambas-user] Printer not found
CelticBhoy ha scritto: I have writen a small stock prog, and want to print various reports, but when I use the printer.begin function it does not see my printer. The printer works fine in any other app I try to print from. I am using Ubuntu with Gnome and have the gb, gb.db, gb.db.form, gb.form, gb.qt, and gb.qt.ext modules loaded. Why wont my app find my printer ps. if I print to file it works fine. It happened to me too, on a machine running the latest K-Ubuntu (don't remember the version, I don't use Ubuntu). There was no way to see installed printers from gambas, but every other program worked perfectly. I used the strace(1) utility to see what was happening, and discovered that gambas was reading a file in /etc, perhaps printcap, or similar, where there was no mention of installed printers. The printers was instead reported in another file. I renamed printcaps, or deleted it, and all went well: gambas started to read the correct file, probably because it was finding no more the erroneous one. I am sorry about not remembering things - it is not my machine. You can go in /etc and see which file contains the names of installed printers, and check that gambas reads that file. Moreover that machine was a Kubuntu one, not using Gnome; so things can be even more different. Regards, -- Doriano Blengino Listen twice before you speak. This is why we have two ears, but only one mouth. -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Printer not found
I had same problem with Ubuntu 8.04 and I found that gambas searchs for libcups.so and Ubuntu has libcups.so.2. So I made a simbolic link (sudo ln -s libcups.so.2 libcups.so) to thas library and all goes fine. Hope this helps. Don't rely on the Printer class to find your printer. Qt 3 is not very good at that... -- Benoît -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] A random sort of listview
When I ran the code it ran fine- why is it important to have it count backwards in the random swap? ie for i =199 to 0 step -1 instead of for i=0 to 199 step 1? JB SKaggs Simonart Dominique wrote: Hi, Hmm, did you run exactly this code? If so, there is something wrong with the second FOR NEXT loop jbskaggs a écrit : using your suggestions and the swap command vs manual swapping this is my code: public b as string 'optional string used to hold the array data for file or split later PUBLIC SUB button4_click() ' initialize array DIM myArray AS Integer[200] DIM a AS Integer DIM i AS Integer FOR i = 0 TO 199 STEP 1 'add array items myArray[i] = i NEXT FOR i = 0 TO 199 STEP 1 ' random swap array items a = Int(Rnd(i + 1)) SWAP myArray[i], myArray[a] NEXT the right code is: FOR i = 199 TO 0 STEP -1 ... NEXT FOR i = 0 TO 199 STEP 1 ' write items in listview2 listview1.MoveTo(myArray[i]) c = listview1.Item.Key listview2.add(c, listview1.item.text) NEXT FOR i = 0 TO 199 STEP 1 'optional step to write array as a string for file or whatever use b = slot myArray[i] , NEXT PRINT b END PUBLIC SUB Button1_Click() 'an optional way to load the array values from the variable b and / or a file if b was file loaded DIM egg AS String[] DIM c AS String listview1.Clear egg = Split(b, ,) FOR EACH c IN egg TRY listview1.Add(c, c) IF ERROR THEN RETURN NEXT IF listview1.Count = 200 THEN RETURN END JB Skaggs Dominique Simonart -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- View this message in context: http://www.nabble.com/A-random-sort-of-listview-tp22919766p22930824.html Sent from the gambas-user mailing list archive at Nabble.com. -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
[Gambas-user] Proper use of containers
So I'm trying to put all my objects in containers for easy handling of window resizing, but I've ran into a problem. Here is the problem. Hpanel1 ( expand=true) |- Frame1 (expand=true) |- Hbox1 (expand=true) | - Textlabel1 (expand=true), |- Combobox1 (expand=true) the frame resizes just fine, which tells me the Hpanel is resizing fine. but the Hbox which is a child to Frame1 does not resize. I'm using gambas2-2.12.0 My app uses gb.gtk I've noticed that when you use more than 2 containers, there are resizing issues. Has anyone seen this? or can anyone suggest a better approach?. -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] A random sort of listview
Hi, jbskaggs a écrit : Okay, But why does it do that? I don't see why the direction should matter what am I missing ? Becuase maybe this is something that has plagued me and caused me headaches for a while. JB Skaggs You're right! Thanks! My mistake is that I listed the myArray values inside the SAME for next loop that the swap! But of course, the values could change at each next step However, there is differences. Let see a step by step sample CASE 1: Forward FOR NEXT loop * i=0 - Int(Rnd(i+1)) = 0! you could affect only myArray[0] to myArray[0] * i=1 - Int(Rnd(i+1)) = 0-1 you could affect myArray[0] once more * i=2 - Inn(Rnd(i+1)) = 0-2 idem * i=3 ... at each step, ALWAYS you could affect an already selected value CASE 2: Backward FOR NEXT loop * i=199 - Int(Rnd(i+1)) = 0-199 myArray[199] could be any value * i=198 - Int(Rnd(i+1)) = 0-198 myArray[198] could be any of the non selected values myArray[199] will never be affected anymore * i=197 ... at each step, NEVER you could affect an already selected value I found the second case more satisfying for my mind! :) Hope this send your headache away! :) Dominique Simonart Simonart Dominique wrote: Hi, jbskaggs a écrit : When I ran the code it ran fine- why is it important to have it count backwards in the random swap? ie for i =199 to 0 step -1 instead of for i=0 to 199 step 1? JB SKaggs Strange, because it should not :) run a test with 10 numbers 0-9 and fixe the seed with RANDOMIZE 12345 If you run the forward FOR NEXT you will get: 0 0 2 3 1 1 2 6 3 8 which is wrong! but if you run the backward FOR NEXT you will get: 5 1 9 6 0 3 8 7 2 4 which is right! May be you did not notice it because 200 is long enough before you get the same number twice, and before you remark that some are missing? Dominique Simonart Simonart Dominique wrote: Hi, Hmm, did you run exactly this code? If so, there is something wrong with the second FOR NEXT loop jbskaggs a écrit : using your suggestions and the swap command vs manual swapping this is my code: public b as string 'optional string used to hold the array data for file or split later PUBLIC SUB button4_click() ' initialize array DIM myArray AS Integer[200] DIM a AS Integer DIM i AS Integer FOR i = 0 TO 199 STEP 1 'add array items myArray[i] = i NEXT FOR i = 0 TO 199 STEP 1 ' random swap array items a = Int(Rnd(i + 1)) SWAP myArray[i], myArray[a] NEXT the right code is: FOR i = 199 TO 0 STEP -1 ... NEXT FOR i = 0 TO 199 STEP 1 ' write items in listview2 listview1.MoveTo(myArray[i]) c = listview1.Item.Key listview2.add(c, listview1.item.text) NEXT FOR i = 0 TO 199 STEP 1 'optional step to write array as a string for file or whatever use b = slot myArray[i] , NEXT PRINT b END PUBLIC SUB Button1_Click() 'an optional way to load the array values from the variable b and / or a file if b was file loaded DIM egg AS String[] DIM c AS String listview1.Clear egg = Split(b, ,) FOR EACH c IN egg TRY listview1.Add(c, c) IF ERROR THEN RETURN NEXT IF listview1.Count = 200 THEN RETURN END JB Skaggs Dominique Simonart Dominique Simonart -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user
Re: [Gambas-user] Proper use of containers
On Wed, 8 Apr 2009 03:34:14 am M0E Lnx wrote: So I'm trying to put all my objects in containers for easy handling of window resizing, but I've ran into a problem. Here is the problem. Hpanel1 ( expand=true) |- Frame1 (expand=true) | |- Hbox1 (expand=true) | | - Textlabel1 (expand=true), |- Combobox1 (expand=true) the frame resizes just fine, which tells me the Hpanel is resizing fine. but the Hbox which is a child to Frame1 does not resize. I'm using gambas2-2.12.0 My app uses gb.gtk I've noticed that when you use more than 2 containers, there are resizing issues. Has anyone seen this? or can anyone suggest a better approach?. As always, send a mini program. I've encountered very few probalem with containers and the nest and and nest and nest and nest and nest. Please send some code so others can try it out. ie zip your project or a sample from the menu and attatch the file. Richard --- --- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user -- This SF.net email is sponsored by: High Quality Requirements in a Collaborative Environment. Download a free trial of Rational Requirements Composer Now! http://p.sf.net/sfu/www-ibm-com ___ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user