GUIserver development v. 0.6

Started by Lutz, June 16, 2007, 06:27:41 AM

Previous topic - Next topic

Lutz

* many additions, bugfixes changes



for files:

    http://newlisp.org/downloads/development/">http://newlisp.org/downloads/development/



changes notes (scoll down to 0.6):

  http://newlisp.org/downloads/development/CHANGES-guiserver-06.txt">http://newlisp.org/downloads/developmen ... ver-06.txt">http://newlisp.org/downloads/development/CHANGES-guiserver-06.txt



Lutz



ps: probably feature complete for now, want to accelerate 2D graphics part. Unless there is a burning need in the GUI area only bugs will be fixed and documentation improved.

newdep

#1
Thanks lutz,





little remark...

the combo-box does return base64-enc in the monitor window of the

widget-demo instead of base64-dec ->



MAIN:TheComboBox 0 b25l

MAIN:TheComboBox 1 dHdv

MAIN:TheComboBox 2 dGhyZWU=

MAIN:MonitorArea 65535 760 682





and list-box...



MAIN:TheListBox 3 dGhpcmQgZW50cnk=

MAIN:TheListBox 7 c2V2ZW50aCBlbnRyeQ==

MAIN:TheListBox 8 ZWlnaHQgZW50cnk=

MAIN:TheListBox 5 ZmlmdGggZW50cnk=

MAIN:TheListBox 0 Zmlyc3QgZW50cnk=
-- (define? (Cornflakes))

newdep

#2
I have odd behaviour with gs:past-text



Seems to always past the same text no matter whats new on the

clipboard its always old data.."I use it like this (gs:paste-text 'TEXTAREA)"



Is there an option inside JAVA to clean the clipboard data?



Norman.
-- (define? (Cornflakes))

newdep

#3
I think i fixed it ;-) My text-area handler was not working.. ill test again..
-- (define? (Cornflakes))

Lutz

#4
In guiserver.lsp v. 6 all error messages are suppressed. Probably it didn't warn you for miss spellings in your text widget name, or similar situation.



I uploaded a corrected guiserver-61.lsp, rename to guiserver.lsp and put into /usr/share/newlisp



http://newlisp.org/downloads/development/guiserver-61.lsp">http://newlisp.org/downloads/developmen ... ver-61.lsp">http://newlisp.org/downloads/development/guiserver-61.lsp



(the problem was a change in gs:listen)



Lutz



ps: pasting to any widget (not only text widgets) which has set-text will be supported in a future version.

newdep

#5
Hi Lutz,



thanks for the fix..but it does not show any errors..:-)



I cant get it fixed.. I think the behaviour is the following



copy/cut/paste text do only work on 'selected-text, as it seems..



Now I want always to copy/cut the whole text-area..



Now i looked int your text-handler from the console.lsp

but i dont realy get the 'dot and 'mark.. Is that begin and end or reverse?





So how do I then figure out the last line in a text-area? is that always -1 ?

if i use (gs:select-text 'widget begni end) ?





Norman.
-- (define? (Cornflakes))

Lutz

#6
Here is a working gs:paste-text program



(if (= ostype "Win32")
    (load (string (env "PROGRAMFILES") "/newlisp/guiserver.lsp"))
    (load "/usr/share/newlisp/guiserver.lsp")
)

(gs:init)

(gs:frame 'Frame 200 200 400 300)
(gs:set-border-layout 'Frame)
(gs:text-area 'TheText 'text-handler)
(gs:button 'TheButton 'button-handler "get clipboard")
(gs:add-to 'Frame 'TheText "center" 'TheButton "south")
(gs:set-visible 'Frame true)

(define (button-handler)
    (gs:paste-text 'TheText))

(define (text-handler))

(gs:listen)


regarding 'got' and 'mark': dot is the current cursor position and mark is the other end of the text-selection, mark may be either bigger or smaller, depending if you select forward or backwards from the current cursor position.



But the selection situation has nothing to do with your paste problem. Once the text is on the clipboad the source text does not need to be selected. Even the app which generated it can be closed.



Lutz

Lutz

#7
... and yes, you can only gs:cut on a selected text. You could use gs:select-text to make a selection by a program.



Lutz

newdep

#8
Yes in your exmaple its also not working..



Oke here my problem..



using paste-text works, but only once..



If I after the paste action select anything again to put on the clipboard

its not shown with paste-text, the old data is shown with paste text...



Its like the clipboard-buffer is not updated inside java...



Its odd...



Norman.
-- (define? (Cornflakes))

newdep

#9
PS: the clipboard is refreshed when i restart the applet..

So it seems to be a java-clipboard-update issue is guess..
-- (define? (Cornflakes))

newdep

#10
found the issue on Cut&paste.





I now that Linux has different clipboards, but i was expecting JAVA to be able

to interact with all of them, which is not the case.



There are some workarounds for this and those need to be changed

on the Linux side of the X server. not in java.



Ill post the work around..ill be testing it now..
-- (define? (Cornflakes))

Lutz

#11
Which OS are you running? becuase it works well on MacOS X.



Lutz

newdep

#12
To be able to interact between the X server clipboard and JAVA

I always need to stop and start the guiserver-applet that used paste-text.

(still a problem..even with the changes below!)



Im using slackware, but thats not relevant..Its the X-server / Windowmanager which does the handling of the clipboard..



But because linux have 2 or 3 clipboards this way you need to configure some thing..



I.e. if you want to copy&paste data from a Xterm you need to configure

these handling individual in ~/.Xdefault per user.



If you want to copy and paste between applications and gui-server clipboard

you always have to press the "COPY" button in your application and NOT only

use the "mouse marking"..



here is what I found on Java ->

Desktop Differences (Copy and Paste)



If you have been using Windows or a keyboard with a copy and paste key, you might be wondering how to copy and paste text between Java programs and other desktop programs and terminals.



Linux uses a mouse-driven copy and paste mechanism where mouse button one selects and copies text, and mouse button two pastes the text. This technique works for Abstract Window Toolkit (AWT) components because they use the primary selection to achieve copy and paste. Project Swing components, however, use the system clipboard for copy and paste, and most tools on the desktop, apart from the Netscape browser, do not use the clipboard.



A workaround to this limitation is to map a key or mouse button to access the system clipboard as follows:



*VT100.Translations: #override

            <Btn3Up>:                select-end(CLIPBOARD) n

            <Btn2Up>:                insert-selection(CLIPBOARD) n



The above lines can be passed as a value to an X tool using the -xrm option. Alternatively, the mapping can be made accessible to the entire desktop by including them in the .Xdefaults file in the user's home directory. The command xrdb -merge $HOME/.Xdefaults will reload updates in the .Xdefaults file.
-- (define? (Cornflakes))

newdep

#13
Oke lutz I found the problem...



I'm a Xterm user ;-)  



Now the solution..



If you use Xterm you can create copy&paste action inside .Xdefaults to

make sure the data from the Xterm is copied into the Clipboard buffer.

because Xterm uses Mouse-Copy&paste this default is not always putting

THAT data inside the clipboard of the X-Server!





Now other applications that use "COPY" actions do work!



Also after switching the Xterm with i.e. Konsole it works But only if you

select , after marking, "COPY" from a menu..so copy by mouse-selections

from a Terminal into the clipboard does not work by default for Linux users on

all applications, like JAVA.



No problem..99% of the data can now be retrieved from Guiserver without

modifications to Linux ..it simply works but Im a Xterm user.. ;-)





Also the PAST window is now updated!!!
-- (define? (Cornflakes))

newdep

#14
Hi Lutz,



Actualy 1 more question...





Its seems that copy & cut both need "selected" text to work on...



How do I get the very last line from a text area?



(gs:select-text 'AREA 0 ???)





Norman.
-- (define? (Cornflakes))