in the attached project, I want to make a window the width of a button, and display a listbox inside to edit.
1/ how to display the window just below the button ?
2/ why can’t I resize the window vertically ?
3/ why does the close button of the window be not visible ?
4/ will it work under windows and linux ?
5/ why does the listbox display nothing instead of the two lines ?
thanks.
testdesktopwindow.xojo_binary_project.zip (6.1 KB)
If mainWindow<>Nil Then
mainWindow.Show
Else
mainWindow = New DesktopWindow
If mainWindow=Nil Then Return
mainWindow.Left = Me.Left+Self.Left
mainWindow.Top = Me.Top+Self.Top
mainWindow.Width = Me.Width
mainWindow.MaximumWidth = Me.Width
mainWindow.Height = 300
mainWindow.MaximumHeight = 32768
Var myBounds As New Rect
myBounds.Left = Me.Left+Self.Left
myBounds.Top = Me.Top+Self.Top
myBounds.Height = 300
myBounds.Width = Me.Width
mainWindow.Bounds = myBounds
mainWindow.Resizeable = True
mainWindow.HasCloseButton = True
mainWindow.Title = "Edit List"
mainWindow.Type = DesktopWindow.Types.Document
mainListBox = New DesktopListBox
If mainListBox=Nil Then Return
mainListBox.Left = 30
mainListBox.Width = mainWindow.Width-30
mainListBox.Height = mainWindow.Height
mainListBox.LockBottom = True
mainListBox.LockLeft = True
mainListBox.LockRight = True
mainListBox.LockTop = True
mainListBox.DefaultRowHeight = 12
mainListBox.AddRow "Line 1"
mainListBox.AddRow "Line 2"
mainPlusButton = New DesktopButton
If mainPlusButton=Nil Then Return
mainPlusButton.Left=1
mainPlusButton.top=1
mainPlusButton.Width=28
mainPlusButton.Height=28
mainPlusButton.Caption="➕"
mainWindow.AddControl mainListBox
mainWindow.AddControl mainPlusButton
mainWindow.Show
mainWindow.Refresh
End If
5 posts - 3 participants