[Gambas-user] spooky ampersand from button.Text
Rolf-Werner Eilert
rwe-sse at osnanet.de
Mon Nov 27 18:05:05 CET 2017
The "&" defines the shortcut letter. Maybe it's set by default in qt5.
If you need to get rid of it, why not just replace it by nothing:
Label1.Text = Replace(Button0.Text, "&", "")
This will kill any "&" at any place within the string, if any :)
Regards
Rolf
Am 27.11.2017 15:09, schrieb wig:
> Hello,
>
> I get a strange effect of an extra ampersand in my text when I copy the
> Buttond.Text to a Textlabel field.
>
> Gambas 3.10 / KDE 5 (gb.qt5) / OpenSUSE 42.2
> (More System info at bottom.)
>
> FMain with
>
> Public Sub Button0_Click()
>
> Label1.Text = Button0.Text ' this gets & in front..
> 'Label1.Text = Button0.Tag ' this works ok
>
> End
>
> Public Sub Form_Open()
>
> Button0.Text = "Button0"
> Button0.Tag = "Button0"
>
> End
>
> Have no idea when it started, works in IDE and compiled version.
> I can run this test fine in old Gambas 3.7 / KDE4 fine.
>
>
> ps: The first time I noticed in a bigger context with more buttons, some
> texts from buttons got the ampersand inserted somewhere in the beginning
> of the text, like position 2 or 3 instead of in front.
> That doesn't show in this simple example.
>
>
> I just found back the list so I hope this is not an old item, I looked in
> the most resent archives .. had fun looking for & sign ..hmm.
>
>
>
> [System]
> Gambas=3.10
> OperatingSystem=Linux
> Kernel=4.4.92-18.36-default
> Architecture=x86_64
> Distribution=SuSE NAME="openSUSE Leap"
> VERSION="42.2"
> ID=opensuse
> ID_LIKE="suse"
> VERSION_ID="42.2"
> PRETTY_NAME="openSUSE Leap 42.2"
> ANSI_COLOR="0;32"
> CPE_NAME="cpe:/o:opensuse:leap:42.2"
> BUG_REPORT_URL="https://bugs.opensuse.org"
> HOME_URL="https://www.opensuse.org/"
> Desktop=KDE5
> Theme=Breeze
> Language=en_BE.UTF-8
> Memory=5951M
>
> [Libraries]
> DBus=libdbus-1.so.3.8.14
>
> [Environment]
> ALSA_CONFIG_PATH=/etc/alsa-pulse.conf
> AUDIODRIVER=pulseaudio
> BASH_FUNC_mc%%=() { . /usr/share/mc/mc-wrapper.sh
> }
> COLORTERM=1
> CONFIG_SITE=/usr/share/site/x86_64-unknown-linux-gnu
> CPU=x86_64
> CSHEDIT=emacs
> CVS_RSH=ssh
> DBUS_SESSION_BUS_ADDRESS=unix:abstract=/tmp/dbus-ZaBRojv8Os,guid=8379809dabad6815841b22465a1c123a
> DESKTOP_SESSION=plasma5
> DISPLAY=:0
> DM_CONTROL=/var/run/xdmctl
> FROM_HEADER=
> GB_GUI=gb.qt5
> GPG_AGENT_INFO=/tmp/gpg-4siUgh/S.gpg-agent:4709:1
> GPG_TTY=not a tty
> GS_LIB=<home>/.fonts
> GTK2_RC_FILES=/etc/gtk-2.0/gtkrc:<home>/.gtkrc-2.0
> GTK_IM_MODULE=cedilla
> GTK_MODULES=canberra-gtk-module
> G_BROKEN_FILENAMES=1
> G_FILENAME_ENCODING=@locale,UTF-8,ISO-8859-15,CP1252
> HISTSIZE=1000
> HOME=<home>
> HOST=<hostname>
> HOSTNAME=<hostname>
> HOSTTYPE=x86_64
> INPUTRC=<home>/.inputrc
> JAVA_BINDIR=/usr/lib64/jvm/jre/bin
> JAVA_HOME=/usr/lib64/jvm/jre
> JAVA_ROOT=/usr/lib64/jvm/jre
> JRE_HOME=/usr/lib64/jvm/jre
> KDE_FULL_SESSION=true
> KDE_SESSION_UID=1000
> KDE_SESSION_VERSION=5
> LANG=en_BE.UTF-8
> LC_MEASUREMENT=nl_BE.UTF-8
> LESS=-M -I -R
> LESSCLOSE=lessclose.sh %s %s
> LESSKEY=/etc/lesskey.bin
> LESSOPEN=lessopen.sh %s
> LESS_ADVANCED_PREPROCESSOR=no
> LOGNAME=<user>
> MACHTYPE=x86_64-suse-linux
> MAIL=/var/spool/mail/<user>
> MANPATH=/usr/local/man:/usr/share/man
> MINICOM=-c on
> MORE=-sl
> NNTPSERVER=news
> OSTYPE=linux
> PAGER=less
> PATH=<home>/bin:/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> PROFILEREAD=true
> PULSE_PROP_OVERRIDE_application.icon_name=plasma
> PULSE_PROP_OVERRIDE_application.name=Plasma
> PULSE_PROP_OVERRIDE_application.version=5.8.6
> PWD=<home>
> PYTHONSTARTUP=/etc/pythonstart
> QEMU_AUDIO_DRV=pa
> QMLSCENE_DEVICE=false
> QSG_RENDER_LOOP=
> QT_AUTO_SCREEN_SCALE_FACTOR=0
> QT_IM_MODULE=xim
> QT_IM_SWITCHER=imsw-multi
> QT_NO_GLIB=1
> QT_SYSTEM_DIR=/usr/share/desktop-data
> SDL_AUDIODRIVER=pulse
> SESSION_MANAGER=local/<hostname>:@/tmp/.ICE-unix/4779,unix/<hostname>:/tmp/.ICE-unix/4779
> SHELL=/bin/bash
> SHLVL=1
> SSH_AGENT_PID=4708
> SSH_ASKPASS=/usr/lib/ssh/ksshaskpass
> SSH_AUTH_SOCK=/tmp/ssh-yDSKs3DViDZS/agent.4649
> TERM=xterm
> TZ=:/etc/localtime
> USER=<user>
> WINDOWMANAGER=/usr/bin/startkde
> WINDOWPATH=7
> XAUTHLOCALHOSTNAME=<hostname>
> XCURSOR_THEME=breeze_cursors
> XDG_CONFIG_DIRS=/etc/xdg
> XDG_CURRENT_DESKTOP=KDE
> XDG_DATA_DIRS=/usr/share
> XDG_RUNTIME_DIR=/run/user/1000
> XDG_SEAT=seat0
> XDG_SESSION_ID=17
> XDG_VTNR=7
> XDM_MANAGED=method=classic
> XKEYSYMDB=/usr/X11R6/lib/X11/XKeysymDB
> XMODIFIERS=@im=local
> XNLSPATH=/usr/share/X11/nls
> XSESSION_IS_UP=yes
> _=/usr/bin/kwrapper5
>
>
>
>
> --------------------------------------------------
>
> This is the Gambas Mailing List
> https://lists.gambas-basic.org/listinfo/user
>
> Hosted by https://www.hostsharing.net
>
More information about the User
mailing list