[Gnoga-list] Unexpected Behavior of Draw_Image
I am getting unexpected results when using Draw_Image with a canvas that has been resized to match the size of the IMG that is being drawn in it. The attached program demonstrates the behavior. Different initial sizes of the canvas can be used by selecting one of the Create calls, and one of the two Draw_Image procedures may be selected. When the canvas' initial size is not the same as the size of the image, the contents of the canvas are not the same as those of the image. If the canvas is created the same size as the image, then the canvas and the image are identical. Possibly this is the correct behavior, but in that case I would like to know how to get a resized canvas to have the same contents as an IMG. I have tested this on Linux with Firefox 119.0.1 and Chromium 119.0.6045.159. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gralwith Gnoga.Application.Singleton; with Gnoga.Gui.Element.Canvas.Context_2D; with Gnoga.Gui.Element.Common; with Gnoga.Gui.View; with Gnoga.Gui.Window; procedure Draw_Image_Error is Window : Gnoga.Gui.Window.Window_Type; View: Gnoga.Gui.View.View_Type; Image : Gnoga.Gui.Element.Common.IMG_Type; Canvas : Gnoga.Gui.Element.Canvas.Canvas_Type; Context : Gnoga.Gui.Element.Canvas.Context_2D.Context_2D_Type; begin -- Draw_Image_Error Gnoga.Application.Title (Name => "Demonstrate error in Draw_Image"); Gnoga.Application.HTML_On_Close (HTML => "Draw_Image_Error ended."); Gnoga.Application.Open_URL; Gnoga.Application.Singleton.Initialize (Main_Window => Window); View.Create (Parent => Window); View.Text_Alignment (Value => Gnoga.Gui.Element.Center); Image.Create (Parent => View, URL_Source => "rgb.jpg"); View.New_Line; delay 0.5; Canvas.Create (Parent => View, Width => 1, Height => 1); -- Canvas.Create (Parent => View, Width => 500, Height => 500); -- Canvas.Create (Parent => View, Width => Image.Width, Height => Image.Height); delay 0.5; Canvas.Width (Value => Image.Width); Canvas.Height (Value => Image.Height); Context.Get_Drawing_Context_2D (Canvas => Canvas); Context.Draw_Image (Image => Image, X => 0, Y => 0); -- Context.Draw_Image (Image => Image, X => 0, Y => 0, Width => Image.Width, Height => Image.Height); delay 9.0; Gnoga.Application.Singleton.End_Application; end Draw_Image_Error; draw_image_error.gpr Description: Binary data ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d
> I've upgraded Simple Components in dev_1.8 branch: > https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/ > I've tested ok with GNAT FSF 13.2 from Alire. That compiles. Attached is a reproducer, data_error.adb, and corresponding project file (edit the path to gnoga.gpr as needed). The Log call outputs 2023-11-18 21:03:10.59 : 4 3 (timestamp will vary), showing that the first dimension of a Pixel_Data_Type is X/columns, and the 2nd is Y/rows, since the image is 4 wide and 3 high. The resulting PPM file contains P3 4 3 255 255 0 0 255 0 0 0 128 0 0 0 255 255 0 0 0 128 0 0 128 0 0 0 255 255 0 0 0 128 0 0 0 255 0 0 255 which is not what was drawn in the image. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Saturday, November 18, 2023 at 10:04:14 AM GMT+1, Blady wrote: > Le 17 nov. 2023 à 15:03, J Carter a écrit : > > > But maybe the two same errors in both code cancel each other out. > > Yes, they would. > > > Could you please give a reproducer? > > Maybe not. I realized I hadn't pulled for a while, so I did a pull and now > "make all" has errors with the Simple Components. The first I saw was fixed > long ago, before GNAT 13 was released, IIRC: In > deps/simple_components/atomic-access/ada/gnat-sockets-server.adb, procedure > Do_Connect, 'Unchecked_Access needs to be changed to 'Unrestricted_Access. If > I fix that, then there are other errors that are not so obvious. It's as if > it's a much earlier version of the Simple Components. But that is another > issue. I've upgraded Simple Components in dev_1.8 branch: https://sourceforge.net/p/gnoga/code/ci/dev_1.8/tree/ I've tested ok with GNAT FSF 13.2 from Alire. Pascal. https://blady.pagesperso-orange.fr with Ada.Text_IO; with Gnoga.Application.Singleton; with Gnoga.Gui.Element.Canvas.Context_2D; with Gnoga.Gui.View; with Gnoga.Gui.Window; with Gnoga.Types.Colors; procedure Data_Error is procedure Write_P3 (File_Name : in String; Image : in Gnoga.Types.Pixel_Data_Type) with Pre => Image'First (1) = 1 and Image'First (2) = 1; procedure Write_P3 (File_Name : in String; Image : in Gnoga.Types.Pixel_Data_Type) is Output : Ada.Text_IO.File_Type; begin -- Write_P3 Ada.Text_IO.Create (File => Output, Name => File_Name); Ada.Text_IO.Put_Line (File => Output, Item => "P3"); Ada.Text_IO.Put_Line (File => Output, Item => Integer'Image (Image'Length (1) ) & Integer'Image (Image'Length (2) ) & " 255"); All_Rows : for Y in Image'Range (2) loop All_Columns : for X in Image'Range (1) loop Ada.Text_IO.Put (File => Output, Item => Image (X, Y).Red'Image & Image (X, Y).Green'Image & Image (X, Y).Blue'Image); end loop All_Columns; Ada.Text_IO.New_Line (File => Output); end loop All_Rows; Ada.Text_IO.Close (File => Output); end Write_P3; Width : constant := 4; Height : constant := 3; Window : Gnoga.Gui.Window.Window_Type; View: Gnoga.Gui.View.View_Type; Canvas : Gnoga.Gui.Element.Canvas.Canvas_Type; Context : Gnoga.Gui.Element.Canvas.Context_2D.Context_2D_Type; Image : Gnoga.Gui.Element.Canvas.Context_2D.Image_Data_Type; begin -- Data_Error Gnoga.Application.Title (Name => "Demonstrate error in Data"); Gnoga.Application.HTML_On_Close (HTML => "Data_Error ended."); Gnoga.Application.Open_URL; Gnoga.Application.Singleton.Initialize (Main_Window => Window); View.Create (Parent => Window); View.Text_Alignment (Value => Gnoga.Gui.Element.Center); Canvas.Create (Parent => View, Width => Width, Height => Height); Context.Get_Drawing_Context_2D (Canvas => Canvas); Red : for X in 0 .. Width - 1 loop Context.Pixel (X => X, Y => 0, Color => Gnoga.Types.Colors.Red); end loop Red; Green : for X in 0 .. Width - 1 loop Context.Pixel (X => X, Y => 1, Color => Gnoga.Types.Colors.Green); end loop Green; Blue : for X in 0 .. Width - 1 loop Context.Pixel (X => X, Y => 2, Color => Gnoga.Types.Colors.Blue); end loop Blue; delay 0.5; Context.Get_Image_Data (Image_Data => Image, Left => 0, Top => 0, Width => 4, Height => 3); Get_Data : declare Pixel : constant Gnoga.Types.Pixel_Data_Type := Image.Data; begin -- Get_Data Gnoga.Log (Message => Integer'Image (Pixel'Length (1) ) & Integer'Image (Pixel'Length (2) ) ); Write_P3 (File_Name => "data_error.ppm", Image => Pixel); end Get_Data; delay 4.5; Gnoga.Application.Singleton.End_Application; end Data_Error; data_error.gpr Description: Binary data ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] Errors in Gnoga.Gui.Element.Canvas.Context_2d
> But maybe the two same errors in both code cancel each other out. Yes, they would. > Could you please give a reproducer? Maybe not. I realized I hadn't pulled for a while, so I did a pull and now "make all" has errors with the Simple Components. The first I saw was fixed long ago, before GNAT 13 was released, IIRC: In deps/simple_components/atomic-access/ada/gnat-sockets-server.adb, procedure Do_Connect, 'Unchecked_Access needs to be changed to 'Unrestricted_Access. If I fix that, then there are other errors that are not so obvious. It's as if it's a much earlier version of the Simple Components. But that is another issue. I'll look into seeing if I can compile 2.1a and use it to make a reproducer. But basically, I obtained a Pixel_Data_Type from a Canvas/Context and then wrote a BMP file of the image. The resulting image was garbled. For a sufficiently small image you could write a P3 PPM file more easily if you want to try it out. All this is based on the usage of X and Y as indices into a Pixel_Data_Type in procedure Data (Image_Data_Type; Pixel_Data_Type) and function String_To_Pixel_Data, where you find D (X, Y), for example. There's no indication in the spec of Gnoga.Types of the meaning of the two dimensions, but there should be. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Thursday, November 16, 2023 at 10:25:39 PM GMT+1, Blady wrote: Hello Jeff, > Le 14 nov. 2023 à 18:35, Jeffrey R. Carter via Gnoga-list > a écrit : > > Comments ts based on the 1.7 branch. > > There appears to be an error in function String_To_Pixel_Data, based on the > string returned from function Data (Image_Data_Type) return String: the Y > loop needs to be the outer loop. Well, one chance out of two to be ... wrong. However, I recall having tested the Data procedure and function against Javascript in canva_test.adb. But maybe the two same errors in both code cancel each other out. Could you please give a reproducer? > In addition, the 4 function calls in the aggregate rely on the order of > evaluation, which is not specified by the language. While GNAT is unlikely to > change this, it's safer to assign the results of the calls to variables and > use them in the aggregate. > > Finally, the initialization of S has no effect. Yes it's typical coding style of David. I guess it isn't the only one in Gnoga. You know Ada better than me but I wonder what was David motivation. > Assuming that the string supplied to procedure Data (Image_Data_Type; String) > has the same format, then the change to the loops also applies to procedure > Data (Image_Data_Type; Pixel_Data_Type). Sure. Regards, Pascal. https://blady.pagesperso-orange.fr ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] 2.1a Not Backward Compatible
I note that Gnoga 2.1a is not backward compatible with 1.6a due to the introduction of UXStrings. I had hoped that this would only involve overloaded operations, and that those using String would continue to be available. In addition to littering my code with conversions to UXString, I would have to change any sources I have that use the upper half of Character to UTF-8 encoding, as the spec of UXStrings uses non-ASCII characters in UTF-8 encoding, GNAT's source-based model means that specs are read every time something that uses the pkg is compiled, so any compilation against Gnoga must use UTF-8 encoding. This seems like excess effort for no gain, so I won't be making the transition immediately. However, it appears that 2.1a has resolved the recompilation problem that plagued earlier versions. What was the culprit and its fix? I would like to see the fix applied back to earlier versions if possible. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] Selection_Type Value and Apostrophes
Somewhere in the intersection of Gnoga 1.6, GNAT 11.2, and Firefox 94.0 on Xubuntu 20.10 I have encountered this "feature". If the Value supplied for an option of a Selection_Type contains an apostrophe ('), the Value function for that option discards the apostrophe and all characters after it. I'm not sure if this is expected behavior. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] Getting started
On Friday, May 22, 2020, 8:31:26 PM UTC, Rolf Ebert GCC wrote: I already have a gross idea how the interface should look like and I have drawn it on a real paper. I was wondering if there aren't any editors (probably in JavaScript) that help you design the interface so that I can concentrate on the actual application code. It seems very tedious to manually program all visual elements. Any hint? I've always found the use of a grid (to group elements together) together with the default placement to give satisfactory results. Of course, I'm not a very demanding UI designer. You can look at the singleton branch of Mine Detector for an example. | | | | | | | | | | | jrcarter/Mine_Detector The Gnoga version of Mine Detector, an intellectually-challenging game - jrcarter/Mine_Detector | | | --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] graphical representations
> The procedure Stroke_Color seems to accept as argument only string color > desciptors and not RGBA. Context_2D contains procedure Stroke_Color (Context : in out Context_2D_Type; Value : in Gnoga.Types.RGBA_Type); procedure Stroke_Color (Context : in out Context_2D_Type; Value : in String); procedure Stroke_Color (Context : in out Context_2D_Type; Value : in Gnoga.Types.Colors.Color_Enumeration); -- Color used for strokes so you can use any of RGBA, String, or the enumeration type. As an example, in Mine_Detector I have Black : constant Gnoga.Types.RGBA_Type := Gnoga.Types.Colors.To_RGBA (Gnoga.Types.Colors.Black); Button_Context.Stroke_Color (Value => Black); -- Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Gral ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] [Solved] Re: No file "" found
I realized I hadn't copied the HTML & JS files to the appropriate directory. Oops. Sorry for spamming the list. -- Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Gral ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] No file "" found
I have created a simple Gnoga singleton program, with a view containing a canvas and a button, that appears no different from any other such program. When I run it, the browser displays the message in the Subject line. The log output contains 2019-11-02 10:15:33.42 : HTTP Server Started 2019-11-02 10:15:34.03 : Requested: Kind: FILE, File: , Query: 2019-11-02 10:15:34.05 : Reply: Not found The important part of the code is Gnoga.Application.Title ("Life"); Gnoga.Application.HTML_On_Close (End_Message); Gnoga.Application.Open_URL; Gnoga.Application.Singleton.Initialize (Main_Window => Window); View.Create (Parent => Window); Drawing.Create (Parent => View, Width => Drawing_Size, Height => Drawing_Size); View.New_Line; Quit.Create (Parent => View, Content => "Quit"); Quit.On_Click_Handler (Handler => When_Quit'Access); Gnoga.Application.Singleton.Message_Loop; This is using the 1.5 beta of Gnoga. Any idea what I'm doing wrong? -- Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Gral ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] V1.5-beta release.
That prevents it dying from adablog and allows it to build the remaining demos and the tutorials. Tutorial 11 also dies because it uses Sqlite; putting a '-' before the call to build tutorials (line 286?) also makes that not fatal. Those would be good changes to have. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Saturday, August 31, 2019, 7:24:43 PM UTC, Pascal wrote: > Le 30 août 2019 à 17:41, J Carter via Gnoga-list > a écrit : > > The error is in building a demo; Sqlite is not needed to build Gnoga. As I > don't use Sqlite, I don't want to install or build it just so a demo will > build. It should, therefore, be expected that this demo might fail, and its > failure should not result in the overall build failing. Hello Jeff, You can prevent make stopping on error with a dash before a command. Can you try this on Makefile line 244? - $(BUILDER) -P demo/demo_agg.gpr $@-main $(GN_OPTIONS) Maybe some other lines need it like tutorials... Tell me if it is ok then I will commit the fix. HTH, Pascal. http://blady.pagesperso-orange.fr ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] V1.5-beta release.
The error is in building a demo; Sqlite is not needed to build Gnoga. As I don't use Sqlite, I don't want to install or build it just so a demo will build. It should, therefore, be expected that this demo might fail, and its failure should not result in the overall build failing. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Thursday, August 29, 2019, 7:19:30 PM UTC, Pascal wrote: > Le 29 août 2019 à 17:54, J Carter a écrit : > > On Linux (Xubuntu 19.04, GNAT 8.3.0), "make all" ends with > > Bind > [gprbind] adablog-main.bexch > [Ada] adablog-main.ali > Link > [link] adablog-main.adb > /usr/bin/ld: cannot find -lsqlite3 > collect2: error: ld returned 1 exit status > gprbuild: link of adablog-main.adb failed > make: *** [Makefile:244: adablog] Error 4 > > I don't know if that's expected. Hello Jeff, It seems that libsqlite3 is not present or not in view of the linker of your configuration. If so, sqlite3 source codes are present in Gnoga. Just do (in Gnoga folder): $ make sqlite3 Then "make all", the linker should find libsqlite3 in /lib. @Gautier: libsqllite3 should be built by Gnoga makefile automatically if make is launched from a Windows command window. But not if launched from a mingw shell. In this later case just do as for Jeff. HTH, Pascal. http://blady.pagesperso-orange.fr ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] V1.5-beta release.
On Linux (Xubuntu 19.04, GNAT 8.3.0), "make all" ends with Bind [gprbind] adablog-main.bexch [Ada] adablog-main.ali Link [link] adablog-main.adb /usr/bin/ld: cannot find -lsqlite3 collect2: error: ld returned 1 exit status gprbuild: link of adablog-main.adb failed make: *** [Makefile:244: adablog] Error 4 I don't know if that's expected. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Tuesday, August 27, 2019, 8:00:34 PM UTC, Pascal via Gnoga-list wrote: Hello, Version V1.5-beta has been released on SF GIT branch dev_1.5: https://sourceforge.net/p/gnoga/code/ci/dev_1.5/tree/ V1.5 will no more change for new features. See HISTORY for features added. V1.5 has been tested (demos, tests, tutorials) with GNAT Community 2019 on macOS 10.13 with Safari 12. Volunteers are welcome to test it further on their own configuration. Some testing on Windows and Linux configuration will be appreciated. Just get last commit on https://sourceforge.net/p/gnoga, do: $ git clone https://git.code.sf.net/p/gnoga/code gnoga-code $ git checkout dev_1.5 $ make all and for courageous: $ make tests then: $ cd bin and test. Feel free to report detailed issues on this list or create tickets on SF. Thanks, Pascal. http://blady.pagesperso-orange.fr ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] 5g and Gnoga
In other words, you have some saws, but you're going to cut wood with a hammer because that's what millions of morons do. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Friday, July 26, 2019, 6:30:29 PM UTC, David Botton wrote: As much as I agree with you, it suffers (even more so) from the same practical issues Ada has. On Fri, Jul 26, 2019 at 2:25 PM J Carter via Gnoga-list wrote: > > The only other decent language is SPARK. > > -- > Jeff Carter > "Now go away or I shall taunt you a second time." > Monty Python and the Holy Gral > > > On Friday, July 26, 2019, 3:32:48 PM UTC, David Botton > wrote: > > > I spent a bit more time concentrating this last year on recovery for my > businesses and physically after the stroke I had last year that I expected. > Thank God all is in full swing. The advent of 5g tech is going to swing the > pendulum even more to always connected server based tech which is Gnoga’s big > angle. I have a few ideas I plan on exploring using Gnoga (and also finishing > up a form builder for Gnoga), but I would like to ask some opinions on the > following: > > I am considering rewriting Gnoga in a language other than Ada (yes I love the > old girl but for reasons I don’t want to debate she has terminal cancer), > what other language would appeal to any of you? > > David Botton > ___ > Gnoga-list mailing list > Gnoga-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gnoga-list > ___ > Gnoga-list mailing list > Gnoga-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gnoga-list ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] 5g and Gnoga
The only other decent language is SPARK. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Friday, July 26, 2019, 3:32:48 PM UTC, David Botton wrote: I spent a bit more time concentrating this last year on recovery for my businesses and physically after the stroke I had last year that I expected. Thank God all is in full swing. The advent of 5g tech is going to swing the pendulum even more to always connected server based tech which is Gnoga’s big angle. I have a few ideas I plan on exploring using Gnoga (and also finishing up a form builder for Gnoga), but I would like to ask some opinions on the following: I am considering rewriting Gnoga in a language other than Ada (yes I love the old girl but for reasons I don’t want to debate she has terminal cancer), what other language would appeal to any of you? David Botton___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] Gnoga File-Selection Dialog
Not having found anything that served my purpose, I created a file-selection dialog. My personal need was for singleton programs where the program and browser run on the same computer, so I don't mind that this selects a file on the computer running the program. It's located at https://github.com/jrcarter/Gnoga_File_Selection I've tested it on Linux and it seems to work well, though it isn't pretty. I'm not sure how well it would work on Windows. Feedback would be appreciated. -- Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Gral ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] "file" Input Type
IIUC, the file list returned by the "files" property has the complete paths. For singleton programs, which run on the same machine as the browser, not being able to get the path would be a real hassle. --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Thursday, July 4, 2019, 7:18:57 PM UTC, David Botton wrote: I don't believe so which makes sense not to pass that to a server. On Thu, Jul 4, 2019 at 2:58 PM J Carter via Gnoga-list wrote: > > Thanks. I missed that. > > This apparently uses the form-submit mechanism to upload the selected file to > the program's upload directory. It gets 2 file names, the base name of the > selected file and that name with ".tmp" appended, which is the name of the > file in the upload directory. > > This is fine if you want to upload the file, but my interest in the > file-selection dialog is to get the path of the selected file(s). Is there a > way to do that? > > -- > Jeff Carter > "Now go away or I shall taunt you a second time." > Monty Python and the Holy Gral > > > On Thursday, July 4, 2019, 11:16:39 AM UTC, David Botton > wrote: > > > There is an example in the test directory > > ___ > Gnoga-list mailing list > Gnoga-list@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/gnoga-list ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
Re: [Gnoga-list] "file" Input Type
Thanks. I missed that. This apparently uses the form-submit mechanism to upload the selected file to the program's upload directory. It gets 2 file names, the base name of the selected file and that name with ".tmp" appended, which is the name of the file in the upload directory. This is fine if you want to upload the file, but my interest in the file-selection dialog is to get the path of the selected file(s). Is there a way to do that? --Jeff Carter"Now go away or I shall taunt you a second time."Monty Python and the Holy Gral On Thursday, July 4, 2019, 11:16:39 AM UTC, David Botton wrote: There is an example in the test directory ___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] "file" Input Type
If I create a Form_Element_Type with Input_Type => "file", I get a button labeled "Browse..." with "No file selected." next to it. Clicking on it opens a file selection dialog. If I navigate to a file, say ~/Code/gnoga/src/gnoga.ads, and select "Open", "No file selected." changes to "gnoga.ads" and Value returns "C:\fakepath\gnoga.ads". This Value is deliberate and done for security reasons, apparently. What is needed is the "files" property. This is supposed to return a list of files, since this input type allows multiselect. As a String it returns "[object FileList]", and I can't see it being more useful as an Integer or Float. Is there a way to use the "file" input type from Gnoga? --Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Gral___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list
[Gnoga-list] More testing
Trying again. -- Jeff Carter "Now go away or I shall taunt you a second time." Monty Python and the Holy Grail___ Gnoga-list mailing list Gnoga-list@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gnoga-list