Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Christopher Lemmer Webber
That's a very interesting idea... I might give that a try!

Simon Schlee writes:

> Another approach might be to use multiple editor-snip% 
> https://docs.racket-lang.org/gui/editor-snip_.html
> within a pasteboard% https://docs.racket-lang.org/gui/pasteboard_.html
>
> Or possibly together with other snip instances, I currently don't have the 
> time to experiment with it
> and no experience with pasteboards, so I am not sure whether that would 
> work well and I am just dropping the idea ;)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87pn7wat7d.fsf%40dustycloud.org.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Laurent
You can also cheat by writing the name with the same color as the
background on the next lines (kind of like \vphantom in LaTeX). This has
the advantage of aligning based on the length of each name instead of
pushing everything to the right of the longest name, while working for any
font.

A better approach to achieve the same result is to do a real \vphantom by
writing the text in a separate box, obtaining the width and then inserting
a blank snip of the same width.

But if you use a fixed-width font, you can of course replace the names with
spaces on the next lines.

On Mon, Aug 10, 2020 at 8:32 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Hello,
>
> I'm building a little chat application with Racket.  Overall Racket's
> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
> stuff to build the chat.  But a fairly standard thing to do with chat
> applications is to have text like:
>
> (Beware, fixed width ascii art ahead)
>
>  ..
>  | FooChat Deluxe  [X]|
>  ||
>  | File  Blah |
>  ||
>  |  | It's snowing outside!! | alice   |
>  || In August  | bob |
>  |  | Nevermind, the snow is a representation of | carol   |
>  | | collective anxiety about the world | |
>  || Oh okay it is snowing then | |
>  ||
>  | [Better go get some snow shoes then___] [Send] |
>  ''
>
> The core idea there being that usernames left-align to the text.
>
> I'm not sure what's the nicest way to do this, though I've taken a guess
> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
> I'd be happy to look at that but I can't really find it in the drracket
> repository and am not sure where it would be?
>
> (I guess one other complication is that if you copy-pasta text it would
> be great to still be able to copy paste the names too, but I can think
> of some kludgery that might make that possible.)
>
>  - Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CABNTSaEaoT0GKBBjXuHGvxkwk_ygex6EXtr7_tQajw7chaVzZA%40mail.gmail.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-12 Thread Simon Schlee
Another approach might be to use multiple editor-snip% 
https://docs.racket-lang.org/gui/editor-snip_.html
within a pasteboard% https://docs.racket-lang.org/gui/pasteboard_.html

Or possibly together with other snip instances, I currently don't have the 
time to experiment with it
and no experience with pasteboards, so I am not sure whether that would 
work well and I am just dropping the idea ;)

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/6facbadb-2125-4077-b3f9-e4665bd25265o%40googlegroups.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-11 Thread Christopher Lemmer Webber
Thanks!  Yes I was looking at a route like that at first but I found
that there wasn't really a way to do fancier markup like links, etc
using just message% (unless I'm missing something...!)

Hence my abuse of an editor that's mostly-locked (idea borrowed from the
racket web browser code) ;)


Justin Zamora writes:

> Another, less lightweight way is to use panels for different parts of
> the chat windows. I put together a sample at
> https://gist.github.com/zamora/1cfc6480f7703735dffa3169facfbf10
>
> On Mon, Aug 10, 2020 at 3:32 PM Christopher Lemmer Webber
>  wrote:
>>
>> Hello,
>>
>> I'm building a little chat application with Racket.  Overall Racket's
>> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
>> stuff to build the chat.  But a fairly standard thing to do with chat
>> applications is to have text like:
>>
>> (Beware, fixed width ascii art ahead)
>>
>>  ..
>>  | FooChat Deluxe  [X]|
>>  ||
>>  | File  Blah |
>>  ||
>>  |  | It's snowing outside!! | alice   |
>>  || In August  | bob |
>>  |  | Nevermind, the snow is a representation of | carol   |
>>  | | collective anxiety about the world | |
>>  || Oh okay it is snowing then | |
>>  ||
>>  | [Better go get some snow shoes then___] [Send] |
>>  ''
>>
>> The core idea there being that usernames left-align to the text.
>>
>> I'm not sure what's the nicest way to do this, though I've taken a guess
>> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
>> I'd be happy to look at that but I can't really find it in the drracket
>> repository and am not sure where it would be?
>>
>> (I guess one other complication is that if you copy-pasta text it would
>> be great to still be able to copy paste the names too, but I can think
>> of some kludgery that might make that possible.)
>>
>>  - Chris
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87sgcsbryr.fsf%40dustycloud.org.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-11 Thread Christopher Lemmer Webber
Ah great, thank you Robby!  I'll give both options a try. :)

Robby Findler writes:

> That code is in the framework:
> https://github.com/racket/gui/blob/master/gui-lib/framework/private/text-line-numbers.rkt
>
> You might also consider having two text%s, one with the names and one with
> the rest. They would scroll independently in that case, but you can hide
> the scrollbars on one and override various callbacks to keep them scrolled
> to the same place.
>
> Robby
>
>
> On Mon, Aug 10, 2020 at 2:32 PM Christopher Lemmer Webber <
> cweb...@dustycloud.org> wrote:
>
>> Hello,
>>
>> I'm building a little chat application with Racket.  Overall Racket's
>> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
>> stuff to build the chat.  But a fairly standard thing to do with chat
>> applications is to have text like:
>>
>> (Beware, fixed width ascii art ahead)
>>
>>  ..
>>  | FooChat Deluxe  [X]|
>>  ||
>>  | File  Blah |
>>  ||
>>  |  | It's snowing outside!! | alice   |
>>  || In August  | bob |
>>  |  | Nevermind, the snow is a representation of | carol   |
>>  | | collective anxiety about the world | |
>>  || Oh okay it is snowing then | |
>>  ||
>>  | [Better go get some snow shoes then___] [Send] |
>>  ''
>>
>> The core idea there being that usernames left-align to the text.
>>
>> I'm not sure what's the nicest way to do this, though I've taken a guess
>> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
>> I'd be happy to look at that but I can't really find it in the drracket
>> repository and am not sure where it would be?
>>
>> (I guess one other complication is that if you copy-pasta text it would
>> be great to still be able to copy paste the names too, but I can think
>> of some kludgery that might make that possible.)
>>
>>  - Chris
>>
>> --
>> You received this message because you are subscribed to the Google Groups
>> "Racket Users" group.
>> To unsubscribe from this group and stop receiving emails from it, send an
>> email to racket-users+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit
>> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org
>> .
>>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/87zh70bs5v.fsf%40dustycloud.org.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-10 Thread Justin Zamora
Another, less lightweight way is to use panels for different parts of
the chat windows. I put together a sample at
https://gist.github.com/zamora/1cfc6480f7703735dffa3169facfbf10

On Mon, Aug 10, 2020 at 3:32 PM Christopher Lemmer Webber
 wrote:
>
> Hello,
>
> I'm building a little chat application with Racket.  Overall Racket's
> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
> stuff to build the chat.  But a fairly standard thing to do with chat
> applications is to have text like:
>
> (Beware, fixed width ascii art ahead)
>
>  ..
>  | FooChat Deluxe  [X]|
>  ||
>  | File  Blah |
>  ||
>  |  | It's snowing outside!! | alice   |
>  || In August  | bob |
>  |  | Nevermind, the snow is a representation of | carol   |
>  | | collective anxiety about the world | |
>  || Oh okay it is snowing then | |
>  ||
>  | [Better go get some snow shoes then___] [Send] |
>  ''
>
> The core idea there being that usernames left-align to the text.
>
> I'm not sure what's the nicest way to do this, though I've taken a guess
> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
> I'd be happy to look at that but I can't really find it in the drracket
> repository and am not sure where it would be?
>
> (I guess one other complication is that if you copy-pasta text it would
> be great to still be able to copy paste the names too, but I can think
> of some kludgery that might make that possible.)
>
>  - Chris
>
> --
> You received this message because you are subscribed to the Google Groups 
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org.

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CA%2B80D0XvAXnGsWL8vEkOm4JGO50rad2rPWnqwc-ywODKPcGKww%40mail.gmail.com.


Re: [racket-users] Racket GUI: text aligned to the left of other text

2020-08-10 Thread Robby Findler
That code is in the framework:
https://github.com/racket/gui/blob/master/gui-lib/framework/private/text-line-numbers.rkt

You might also consider having two text%s, one with the names and one with
the rest. They would scroll independently in that case, but you can hide
the scrollbars on one and override various callbacks to keep them scrolled
to the same place.

Robby


On Mon, Aug 10, 2020 at 2:32 PM Christopher Lemmer Webber <
cweb...@dustycloud.org> wrote:

> Hello,
>
> I'm building a little chat application with Racket.  Overall Racket's
> GUI tools are quite comfortable, and I'm just using Rakcet's text editor
> stuff to build the chat.  But a fairly standard thing to do with chat
> applications is to have text like:
>
> (Beware, fixed width ascii art ahead)
>
>  ..
>  | FooChat Deluxe  [X]|
>  ||
>  | File  Blah |
>  ||
>  |  | It's snowing outside!! | alice   |
>  || In August  | bob |
>  |  | Nevermind, the snow is a representation of | carol   |
>  | | collective anxiety about the world | |
>  || Oh okay it is snowing then | |
>  ||
>  | [Better go get some snow shoes then___] [Send] |
>  ''
>
> The core idea there being that usernames left-align to the text.
>
> I'm not sure what's the nicest way to do this, though I've taken a guess
> that maybe the "Show/Hide Line Numbers" in DrRacket is the best example.
> I'd be happy to look at that but I can't really find it in the drracket
> repository and am not sure where it would be?
>
> (I guess one other complication is that if you copy-pasta text it would
> be great to still be able to copy paste the names too, but I can think
> of some kludgery that might make that possible.)
>
>  - Chris
>
> --
> You received this message because you are subscribed to the Google Groups
> "Racket Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to racket-users+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/racket-users/87lfime1pm.fsf%40dustycloud.org
> .
>

-- 
You received this message because you are subscribed to the Google Groups 
"Racket Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/racket-users/CAL3TdOMxDsWx9ZBHS4ZdA520p27m27v3MfKJopXeHJLFFYpZLA%40mail.gmail.com.