Skip to content

Commit 57d4612

Browse files
author
hopelessdecoy
committed
Fixes more issues with drag and drop, which wasn't assigning values to proper variables.
1 parent b29ea18 commit 57d4612

File tree

1 file changed

+13
-9
lines changed

1 file changed

+13
-9
lines changed

MainScreen.xojo_window

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -546,25 +546,27 @@ End
546546
Sub TextChanged()
547547
Try
548548
Me.Text= Me.Text.Trim
549+
549550
If(Utils.ValidatePath(Me.Text)) Then
550-
Var possibleDir As FolderItem = New FolderItem(Me.Text)
551+
Var possibleItem As FolderItem = New FolderItem(Me.Text)
552+
App.executableLocation= possibleItem
553+
App.programName= App.executableLocation.Name
554+
// System.DebugLog(possibleItem.NativePath + "?")
551555

552-
If(possibleDir.Exists) Then
556+
If(possibleItem.Exists) Then
553557
Self.btn_Run.Enabled= True
554558
Else
555559
Self.btn_Run.Enabled= False
556560
End
557561
End
558-
559562
Catch e As RuntimeException
560563
Utils.GeneratePopup(1,"Something went wrong!",e.Message)
561564
End
562565
End Sub
563566
#tag EndEvent
564567
#tag Event
565568
Sub DropObject(obj As DragItem, action As DragItem.Types)
566-
Me.Text= obj.FolderItem.NativePath.Trim
567-
569+
Me.Text= obj.FolderItem.NativePath
568570
End Sub
569571
#tag EndEvent
570572
#tag EndEvents
@@ -603,18 +605,20 @@ End
603605
Try
604606
Me.Text= Me.Text.Trim
605607
If(Utils.ValidatePath(Me.Text)) Then
606-
Var possibleFile As New FolderItem(Me.Text)
608+
Var possibleImg As New FolderItem(Me.Text)
609+
App.programIcon= possibleImg
607610
Var possiblePicture As Picture
608611

609-
If(possibleFile.Exists And possibleFile.Name.Right(4)=".png") Then
610-
possiblePicture= Utils.LoadPicture(possibleFile,125,125)
612+
If(possibleImg.Exists And possibleImg.Name.Right(4)=".png") Then
613+
possiblePicture= Utils.LoadPicture(possibleImg,125,125)
611614

612615
Self.imv_Icon.Image= possiblePicture
613616
Me.Tooltip= "Image to be used as Icon"
614617
Else
615618
Self.imv_Icon.Image= img_BlankImage
616619
Me.Tooltip= "Files must be .png and 256x256 to work as AppImage Icons"
617620
End
621+
618622
Else
619623
Self.imv_Icon.Image= img_BlankImage
620624
Me.Tooltip= "Files must be .png and 256x256 to work as AppImage Icons"
@@ -627,7 +631,7 @@ End
627631
#tag EndEvent
628632
#tag Event
629633
Sub DropObject(obj As DragItem, action As DragItem.Types)
630-
Me.Text= obj.FolderItem.NativePath.Trim
634+
Me.Text= obj.FolderItem.NativePath
631635
End Sub
632636
#tag EndEvent
633637
#tag EndEvents

0 commit comments

Comments
 (0)