summaryrefslogtreecommitdiff
path: root/src/fltk-widgets-groups-browsers-textline.adb
diff options
context:
space:
mode:
authorJedidiah Barber <contact@jedbarber.id.au>2024-12-22 21:21:51 +1300
committerJedidiah Barber <contact@jedbarber.id.au>2024-12-22 21:21:51 +1300
commit28cbb294051d47a1dd0731333dd103132b6ae793 (patch)
treee47d1b8f0be8e549184455016ea51e3aafeff650 /src/fltk-widgets-groups-browsers-textline.adb
parentc7e4f58a5fb0d62c4af3b82dabb1b52e72f99743 (diff)
Added Fl_File_Browser
Diffstat (limited to 'src/fltk-widgets-groups-browsers-textline.adb')
-rw-r--r--src/fltk-widgets-groups-browsers-textline.adb8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/fltk-widgets-groups-browsers-textline.adb b/src/fltk-widgets-groups-browsers-textline.adb
index de3f339..7c8dc3b 100644
--- a/src/fltk-widgets-groups-browsers-textline.adb
+++ b/src/fltk-widgets-groups-browsers-textline.adb
@@ -682,10 +682,16 @@ package body FLTK.Widgets.Groups.Browsers.Textline is
(This : in out Textline_Browser;
File : in String)
is
+ Msg : Interfaces.C.Strings.chars_ptr;
Code : Interfaces.C.int := fl_browser_load (This.Void_Ptr, Interfaces.C.To_C (File));
begin
if Code = 0 then
- raise Browser_Load_Error with Interfaces.C.Strings.Value (get_error_message);
+ Msg := get_error_message;
+ if Msg = Interfaces.C.Strings.Null_Ptr then
+ raise Browser_Load_Error;
+ else
+ raise Browser_Load_Error with Interfaces.C.Strings.Value (Msg);
+ end if;
elsif Code /= 1 then
raise Internal_FLTK_Error;
end if;