Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread Daniel Feltey
The easiest way to do this is to use the text:line-numbers-mixin in the framework. Here's an example of an editor with line numbers: #lang racket (require racket/gui framework) (define text (new (text:line-numbers-mixin text:standard-style-list%))) (define frame (new frame% [label

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
Sorry for so many small mails on one topic. In my current project, I implements something similar to line numbers. At the beginning, I separate them into different canvases so that the GUI behaves like iTunes(later I found that they do not implement it in a consistent way), but now I like the way

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
Okay, in the gui framework, there is an interface text:line-numbers<%> On Thu, Mar 9, 2017 at 9:46 AM, WarGrey Gyoudmon Ju wrote: > But sometimes I happened to see that some one-line codes and their line > number are overlapped. > And line numbers are also controlled by

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
But sometimes I happened to see that some one-line codes and their line number are overlapped. And line numbers are also controlled by the same horizontal scrollbar(I mean, it is contained in the scrollbar's view, if there is another canvas this should not happen). Maybe they are displayed in a

Re: [racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread WarGrey Gyoudmon Ju
I think, line numbers are likely displayed in another canvas. The current implementation of text% does not support advanced font features, the line height therefore is always the same. Displaying the line numbers just consists of a bit of arithmetic. On Thu, Mar 9, 2017 at 8:31 AM, 武晓宇

[racket-users] racket/gui -- How to implement a text% area with line number displayed?

2017-03-08 Thread 武晓宇
I want to implement a text% object. And display the line number when string is inserted the text/canvas area. Like the DrRacket IDE in "show line number" mode. I read the source code of DrRacket but do not find the answer. Could anyone give a hand? -- You received this message because

Re: [racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
On Wednesday, March 8, 2017 at 11:14:53 AM UTC-8, Jay McCarthy wrote: > > (let ([name-i-want (lambda args body)]) name-i-want) > Yup, that does it. Thanks! > Jay -- You received this message because you are subscribed to the Google Groups "Racket Users" group. To unsubscribe from this group

Re: [racket-users] losing syntax context

2017-03-08 Thread Jay McCarthy
There are a few ways. procedure-rename works at runtime Or you can influence the inferred value name --- http://docs.racket-lang.org/reference/syntax-model.html?q=procedure-rename#%28part._infernames%29 --- by setting the syntax property or expanding to something like (let ([name-i-want (lambda

Re: [racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
On Wednesday, March 8, 2017 at 10:56:48 AM UTC-8, Jay McCarthy wrote: > You want to use syntax/loc. The error message comes from the lambda, > not from the keyword argument. It could be possible to change where > Yup, that fixes it. Thanks! I experimented with syntax/loc in various places,

Re: [racket-users] losing syntax context

2017-03-08 Thread Jay McCarthy
You want to use syntax/loc. The error message comes from the lambda, not from the keyword argument. It could be possible to change where lambda looks for the error srcloc, but if you don't want to do that, you can just use syntax/loc in the right spot: http://pasterack.org/pastes/77933 On Wed,

[racket-users] losing syntax context

2017-03-08 Thread Dan Liebgold
I have a syntax transformer that loses enough syntax context that it's error message points to the transformer rather than the usage. Here's an example of what it should do: http://pasterack.org/pastes/89138 This one gives correct syntax in the error message (not in pasterack, but in Dr

[racket-users] Racket t-shirts and stickers on DevSwag

2017-03-08 Thread Ben Greenman
Racket stickers and t-shirts are now on devswag.com - https://devswag.com/products/racket - https://devswag.com/products/racket-t-shirt Looking for a last-minute St Patrick's Day gift? Or a Fathers' Day gift for the Racketeer that has it all? Then LOOK NO FURTHER! (Half the proceeds from