Text Input Box with Xlib
Hello! I am new in the list and I'm facing the first difficults in using Xlib. I have been playing around Xlib a little and then I decided to write a small set of widgets to make easier the things. I already got window and button widgets working, and now I would like to write a text input box, but I have no idea how to start. If someone out there have advices, example code, etc etc, I would be very glad. If someone want to see what I've already wrote, it's here: https://github.com/gabrield/stk -- Gabriel Duarte Linux User #471185 Rio de Janeiro / RJ http://genericdev.wordpress.com/ ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
Re: Text Input Box with Xlib
On 02/ 2/13 01:56 PM, Gabriel Duarte wrote: I already got window and button widgets working, and now I would like to write a text input box, but I have no idea how to start. If someone out there have advices, example code, etc etc, I would be very glad. The best advice we can give you is to use an existing toolkit. Correctly handling all the different languages, writing systems, accessibility helpers, etc. is a multi-year project to write, debug, and make useful, and one that people have already done for you. -- -Alan Coopersmith- alan.coopersm...@oracle.com Oracle Solaris Engineering - http://blogs.oracle.com/alanc ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
Re: Text Input Box with Xlib
At Sat, 02 Feb 2013 14:02:04 -0800 Alan Coopersmith alan.coopersm...@oracle.com wrote: On 02/ 2/13 01:56 PM, Gabriel Duarte wrote: I already got window and button widgets working, and now I would like to write a text input box, but I have no idea how to start. If someone out there have advices, example code, etc etc, I would be very glad. The best advice we can give you is to use an existing toolkit. Correctly handling all the different languages, writing systems, accessibility helpers, etc. is a multi-year project to write, debug, and make useful, and one that people have already done for you. And if you are too impatient for that, just use Tcl/Tk. Tcl is a basic scripting language that comes with a basic GUI toolkit. One that you can play with *interactively*. Once you have Tcl/Tk installed (under Linux it is just a matter of # Red Hat flavored (RHEL, CentOS, Scientific Linux, Fedora) yum install tcl tk # Debian flavored (Debian, Ubuntu, Mint, etc.) apt-get install tcl tk ), you can do this ('%'=shell prompt): % wish pack [entry .e] and presto, a text input box. A slightly more exciting example: % wish pack [entry .e] -side left pack [buttom .b \ -text Hit me \ -command {puts You entered: '[.e cget -text]'}] -side right The packages *should* come with man pages. Also: visit http://wiki.tcl.tk/ for lots of fun stuff. -- Robert Heller -- 978-544-6933 / hel...@deepsoft.com Deepwoods Software-- http://www.deepsoft.com/ () ascii ribbon campaign -- against html e-mail /\ www.asciiribbon.org -- against proprietary attachments ___ xorg@lists.x.org: X.Org support Archives: http://lists.freedesktop.org/archives/xorg Info: http://lists.x.org/mailman/listinfo/xorg Your subscription address: arch...@mail-archive.com
[PATCH 1/8 v2] Handle failure to create counter in init_system_idle_counter
Check for NULL pointer (which can be returned for multiple reasons) before trying to dereference it to add privates. To avoid memory leak in error path, delay malloc of privates until we're ready to add them. In case we do return NULL up through SyncInitDeviceIdleTime, handle the possibility of getting NULL passed back down to SyncRemoveDeviceIdleTime. As reported by parfait 1.1: Error: Null pointer dereference (CWE 476) Read from null pointer 'idle_time_counter' at line 2764 of xserver/Xext/sync.c in function 'init_system_idle_counter'. Function 'SyncCreateSystemCounter' may return constant 'NULL' at line 952, called at line 2756. Null pointer introduced at line 952 in function 'SyncCreateSystemCounter'. Signed-off-by: Alan Coopersmith alan.coopersm...@oracle.com Reviewed-by: Peter Hutterer peter.hutte...@who-t.net --- Xext/sync.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/Xext/sync.c b/Xext/sync.c index 4d11992..9ae5b39 100644 --- a/Xext/sync.c +++ b/Xext/sync.c @@ -2747,7 +2747,6 @@ init_system_idle_counter(const char *name, int deviceid) { CARD64 resolution; XSyncValue idle; -IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv)); SyncCounter *idle_time_counter; IdleTimeQueryValue(NULL, idle); @@ -2758,10 +2757,14 @@ init_system_idle_counter(const char *name, int deviceid) IdleTimeQueryValue, IdleTimeBracketValues); -priv-deviceid = deviceid; -priv-value_less = priv-value_greater = NULL; +if (idle_time_counter != NULL) { +IdleCounterPriv *priv = malloc(sizeof(IdleCounterPriv)); -idle_time_counter-pSysCounterInfo-private = priv; +priv-value_less = priv-value_greater = NULL; +priv-deviceid = deviceid; + +idle_time_counter-pSysCounterInfo-private = priv; +} return idle_time_counter; } @@ -2786,6 +2789,6 @@ void SyncRemoveDeviceIdleTime(SyncCounter *counter) /* FreeAllResources() frees all system counters before the devices are shut down, check if there are any left before freeing the device's counter */ -if (!xorg_list_is_empty(SysCounterList)) +if (counter !xorg_list_is_empty(SysCounterList)) xorg_list_del(counter-pSysCounterInfo-entry); } -- 1.7.9.2 ___ xorg-devel@lists.x.org: X.Org development Archives: http://lists.x.org/archives/xorg-devel Info: http://lists.x.org/mailman/listinfo/xorg-devel
[Bug 60180] R200 segfault at startx
https://bugs.freedesktop.org/show_bug.cgi?id=60180 --- Comment #1 from Alex Deucher ag...@yahoo.com --- Can you install the debugging packages and get a proper backtrace with gdb: http://wiki.x.org/wiki/Development/Documentation/ServerDebugging Also please attach your full xorg log and dmesg output. -- You are receiving this mail because: You are the assignee for the bug. ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[Bug 60180] R200 segfault at startx
https://bugs.freedesktop.org/show_bug.cgi?id=60180 --- Comment #2 from jc.gerv...@videotron.ca --- dmesg: http://gentoo.pastebin.ca/2310183 Xorg -configure run: Xorg.0.log http://gentoo.pastebin.ca/2310182 build log: http://gentoo.pastebin.ca/2310188 -- You are receiving this mail because: You are the assignee for the bug. ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[Bug 20476] [RV530 x1650] Black screen on X boot
https://bugs.freedesktop.org/show_bug.cgi?id=20476 klondike klond...@klondike.es changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --- Comment #23 from klondike klond...@klondike.es --- I think this was fixed at some point of time but I forgot to close this bug. Even if it wasn't fixed I don't have access to the hardware anyway. -- You are receiving this mail because: You are the assignee for the bug. ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati
[Bug 60180] R200 segfault at startx
https://bugs.freedesktop.org/show_bug.cgi?id=60180 --- Comment #3 from jc.gerv...@videotron.ca --- gdb /usr/bin/Xorg $(pidof X) GNU gdb (Gentoo 7.5 p1) 7.5 This GDB was configured as powerpc-unknown-linux-gnu. Reading symbols from /usr/bin/Xorg...done. (gdb) set args -configure (gdb) run Starting program: /usr/bin/Xorg -configure warning: Could not load shared library symbols for linux-vdso32.so.1. Do you need set solib-search-path or set sysroot? [Thread debugging using libthread_db enabled] Using host libthread_db library /lib/libthread_db.so.1. X.Org X Server 1.13.1 Release Date: 2012-12-13 X Protocol Version 11, Revision 0 Build Operating System: Linux 3.2.1-gentoo-r2 ppc Gentoo Current Operating System: Linux tiny 3.2.1-gentoo-r2 #11 Fri Feb 1 16:18:12 EST 2013 ppc Kernel command line: root=/dev/hda3 ro Build Date: 02 February 2013 11:57:27PM Current version of pixman: 0.28.0 Before reporting problems, check http://wiki.x.org to make sure that you have the latest version. Markers: (--) probed, (**) from config file, (==) default setting, (++) from command line, (!!) notice, (II) informational, (WW) warning, (EE) error, (NI) not implemented, (??) unknown. (==) Log file: /var/log/Xorg.0.log, Time: Sun Feb 3 00:30:23 2013 List of video drivers: radeon ati (++) Using config file: /root/xorg.conf.new (==) Using system config directory /usr/share/X11/xorg.conf.d (II) [KMS] Kernel modesetting enabled. Program received signal SIGSEGV, Segmentation fault. 0x0f9337cc in RADEONPreInit_KMS (pScrn=0x1036b7e8, flags=1) at /var/tmp/portage/x11-drivers/xf86-video-ati-7.0.0-r1/work/xf86-video-ati-7.0.0/src/radeon_kms.c:784 784 /var/tmp/portage/x11-drivers/xf86-video-ati-7.0.0-r1/work/xf86-video-ati-7.0.0/src/radeon_kms.c: No such file or directory. (gdb) bt full #0 0x0f9337cc in RADEONPreInit_KMS (pScrn=0x1036b7e8, flags=1) at /var/tmp/portage/x11-drivers/xf86-video-ati-7.0.0-r1/work/xf86-video-ati-7.0.0/src/radeon_kms.c:784 info = 0x1036bc48 pRADEONEnt = 0x1036b650 pPriv = 0x1036b4c0 zeros = {red = 0, green = 0, blue = 0} tiling = 0 cpp = 0 #1 0x100a90e0 in DoConfigure () at /var/tmp/portage/x11-base/xorg-server-1.13.1/work/xorg-server-1.13.1/hw/xfree86/common/xf86Configure.c:729 MonitorPtr = 0x0 ScreenPtr = 0x0 i = 0 j = 0 screennum = 1 home = 0xbfadbe3d /root filename = /root/xorg.conf.new, '\000' repeats 553 times\277, \255\232\020\000\000\000\000\017\306\237\364\000\000\000\000\277\255\232\060, '\000' repeats 15 times, d\277\255\237\310\017\306\237\364\020\060\021\210\277\255\232P\017\267\034\250\277\255\245h/sys/class/drm\000\364\277\255\232P\277\255\237\300\017\263\312h\000\000\000\000\000\000\000\000\277\255\232p\000\000\000\000\017\377b\254\000\000\000\000\277\255\236\260, '\000' repeats 12 times\277, \255\232\240\000\000\000\000\277\255\241h\017\303\303,\277\255\232\260\000\000\000\001\277\255\241x\017\303\303,\000\000\000\000\000\000\000\001\017\306\237\364\277\255\240X\277\255\232\340\017\266\\020\277\255\241h\017\356\372\071\277\255\232\340\277\255\240H\277\255\241x\017\356\372\071\277\255\232\340\277\255\240X\017\306\237\364\277\255\232\340\277\255\240P\017\263\312h\000\000\000\000F\000\002\\373\255,\207\020\065\301\060\017\306\237\364\277\255\233\000\277\255\240p\017\263\314,\005\000\237\364\277\255\241\330\277\255\241h\000\000\000\000\005\000\000\000\277\255\241\350\277\255\241x, '\000' repeats 15 times, \277\255\240\330\017\306\237\364\020\060\232\264\277\255\233`\017\267\034\250\277\255\246X\020\060\232\264\277\255\233p\277\255\240\330\277\255\242\020\062Q\320\277\255\233p\277... addslash = 0x102ff174 / xf86config = 0x10371e90 vlist = 0x10365768 vl = 0x10365770 dev2screen = 0x1036b6b8 #2 0x100c3114 in InitOutput (pScreenInfo=0x1034f928 screenInfo, argc=2, argv=0xbfadab14) at /var/tmp/portage/x11-base/xorg-server-1.13.1/work/xorg-server-1.13.1/hw/xfree86/common/xf86Init.c:462 i = 0 j = 271831860 k = 0 scr_index = 1208047636 modulelist = 0xfb60910 fopen+40 optionlist = 0x668 screenpix24 = (unknown: 268556996) pix24 = (unknown: 1208094688) pix24From = X_DEFAULT pix24Fail = 0 autoconfig = 0 sigio_blocked = 0 configured_device = 0x0 #3 0x1001e7c4 in main (argc=2, argv=0xbfadab14, envp=0xbfadab20) at /var/tmp/portage/x11-base/xorg-server-1.13.1/work/xorg-server-1.13.1/dix/main.c:204 i = 256 alwaysCheckForInput = {0, 1} (gdb) -- You are receiving this mail because: You are the assignee for the bug. ___ xorg-driver-ati mailing list xorg-driver-ati@lists.x.org http://lists.x.org/mailman/listinfo/xorg-driver-ati