[Gambas-user] Rev 967 bug. Ballon
Arief Bayu Purwanto
ariefbayu at ...626...
Mon Jan 14 10:57:00 CET 2008
Here's how to do it:
- add object, in this case, I add TextBox
- add _KeyPress() event handler
- on method body add Ballon.Error("", yourobject)
PUBLIC SUB txtKode_KeyPress()
IF Key.Code = key.Return THEN
'ceritanya dapat data dengan kode 'ASDF123'
IF txtKode.text = "ASDF123" THEN
txtNamaItem.Text = "Barang testing"
txtHarga.text = "4750"
txtJumlah.SetFocus()
ELSE 'nah, kalau ini, data tidak ada
txtKode.Select(0, txtKode.Length)
Balloon.Error("Maaf, kode barang tidak ada", txtKode)
txtKode.SetFocus()
END IF
ELSE IF key.Code = key.Tab THEN
txtKode.SetFocus()
END IF
END
- run
- test your Ballon, and it'll error on the second appearance.
Here's the trace:
silent at ...1792...:~/tmp/Gambas2Demo$ gbc2 -agt
OK
silent at ...1792...:~/tmp/Gambas2Demo$ gdb gbx2
GNU gdb 6.6-debian
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "i486-linux-gnu"...
Using host libthread_db library "/lib/tls/i686/cmov/libthread_db.so.1".
(gdb) set args -p
(gdb) run
Starting program: /usr/local/bin/gbx2 -p
[Thread debugging using libthread_db enabled]
[New Thread -1209948496 (LWP 16947)]
Error while reading shared library symbols:
Cannot find new threads: generic error
/usr/share/themes/Blubuntu/gtk-2.0/gtkrc:169: Clearlooks configuration
option "progressbarstyle" is not supported and will be ignored.
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread -1209948496 (LWP 16947)]
0x0805e062 in GB_Raise (object=0x8344290, event_id=0, nparam=0) at
gbx_api.c:544
544 LIST_for_each(obs, OBJECT_event(object)->observer)
(gdb) bt
#0 0x0805e062 in GB_Raise (object=0x8344290, event_id=0, nparam=0) at
gbx_api.c:544
#1 0xb7dbb8fe in raise_configure (widget=0x80fb8b0, e=0x80edae8,
_object=0x8344290) at CWatcher.cpp:57
#2 0xb7b351de in _gtk_marshal_BOOLEAN__BOXED () from /usr/lib/libgtk-
x11-2.0.so.0
#3 0xb76f0772 in g_closure_invoke () from /usr/lib/libgobject-2.0.so.0
#4 0xb7701323 in ?? () from /usr/lib/libgobject-2.0.so.0
#5 0x083447d8 in ?? ()
#6 0xbfb03440 in ?? ()
#7 0x00000002 in ?? ()
#8 0xbfb0351c in ?? ()
#9 0xbfb0342c in ?? ()
#10 0x0823bf60 in ?? ()
#11 0xbfb0355c in ?? ()
#12 0x00000000 in ?? ()
--
Daiguren Hyōrinmaru<http://en.wikipedia.org/wiki/Toshiro_Hitsugaya#Hy.C5.8Drinmaru>
More information about the User
mailing list