problem with different desktop environments?
Posted
#1
(In Topic #459)
Trainee
I use a gambas exe in different environments. There seems to be a problem with the component library:
- When I use deb 10 & gb.gtk3 I have a segmentation fault
- When I use deb 10 & gb.gui, no problems
- When I use deb 11 & gnome3 - the exe does not work properly (messagebox does not show properly, cannot click on buttons etc.)
- When I switch to xfce3 & gdm, everything seems normal though I did not test it properly. (all code tested using the ide)
Would this cause problems in the long run, like when distributions upgrade libraries?
deb 10 & gb.gui:
I have a combobox that does not catch backspace and delete keys though it does everything else (trying to select text as user types).
Public Sub cmb_Observer_KeyPress() '' Listener for searching in the combo
Dim $ww, $w1 As String
Dim $qa As Integer
Dim $qCount As Integer
' problem here vvvvvvvvvvvvvvvvvvvvvvvvvvvvv
If Key.Code = Key.BackSpace Or Key.Code = Key.Delete Then
searchStr = ""
Me.Text = ""
Return
Endif
If Key.Code = Key.ShiftKey Or Key.Code = Key.Down Or Key.Code = Key.Up Then Return
If (Key.Code = Key.Return Or Key.Code = Key.Enter) Then
Raise ntExec()
searchStr = ""
Stop Event
Return
Endif
searchStr &= Key.Text
If Len(searchStr) = 1 Then searchStr = Upper(Left(searchStr)) & Right(searchStr, -1)
For Each $ww In Me.List
If String.Left($ww, Len(searchStr)) = searchStr Then
Me.Text = $ww
Stop Event
Return
Else
Endif
Next
Stop Event
End
Posted
Guru

Question 2: Interesting. It seems that the Gambas code for GTK does not see the Delete or Backspace keys when using KeyPress(). It does see it if you use KeyRelease(). If you use gb.gui.qt then KeyPress() does see the Delete and Backspace keys.
Your code looks quite complex, try running the following in a new Graphical Application.
Code (gambas)
Posted
Trainee
As for the KeyRelease, it worked, thanks. Never thought to try that.
1 guest and 0 members have just viewed this.



