Re: [racket-users] Error message from GUI

2016-08-29 Thread Dmitry Pavlov

Hello,

Sorry for dropping out of the conversation for a while.

Here is the smallest example that I could produce:

#lang racket

(require racket/gui
 racket/draw
 table-panel)

(define test%
  (class
  table-panel% (super-new (dimensions '(1 1)))
  ;vertical-panel% (super-new)
  ;horizontal-panel% (super-new)

(define vpanel
  (new vertical-panel%
   (parent this)
   (border 0)
   (style '(vscroll))
   ;(min-height 1)
   ))

(for ((i (in-range 10)))
  (new button%
   (parent vpanel)
   (label (format "Button ~a" i))
   ))
))


(define frame
  (instantiate frame% ("Test")))

(void (new test% (parent frame)))

(send frame resize 200 200)
(send frame show #t)


On Windows, it results into:
..\..\Program 
Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: 
initialization for bitmap%: bad argument combination: 192 0 #f #t 1.0


On Linux, it works, although the vertical panel ends up with a small 
visible size.


If I specify a min-height at least one to the vertical  panel, the error 
is gone, and the panel is the size of the window.
If I use vertical-panel% or horizontal-panel% instead of table-panel%, 
the error is gone, and the panel is the size of the window.


So the problem here is that table-panel% handles its children in a 
certain way, and that the height of the scrollable panel ends up zero.


I did not write table-panel. I currently do not know whether a fix 
should be done in table-panel or gui-lib.


In my program, (min-height 1) helps, so I can live with the way it is now.

Best regards,

Dmitry




On 07/30/2016 12:44 AM, Vincent St-Amour wrote:

Should this change be added to gui-lib?

Vincent


On Fri, 29 Jul 2016 10:08:46 -0500,
Dmitry Pavlov wrote:

Matthew,

Yes that works, thank!

Also I figured why the message did not show up on my "first" WinXP
installation: the spreadsheet-editor package has not been updated there.
Newer version of spreadsheet-editor sets (style '(hide-vscroll)) and
(style '(hide-hscroll)) to panels with row and column buttons.

Styles cause the error. Changing styles to just '(hscroll) and
'(vscroll) does not remove the error.
Anyway, I need those (hide-vscroll) and (hide-hscroll), so I am going to
use the patch you proposed, unless there is a more elegant solution I am
unaware of.

(Another question is why there is a stack trace in 32-bit Windows and
just a message in 64-bit Windows, but that is of purely theoretical
importance to me.)

Best regards,

Dmitry


On 07/29/2016 05:25 PM, Matthew Flatt wrote:

It may be that a guard against a 0-sized drawing dimension is needed.
The right place for the guard might be in the `get-cr` method of

   gui-lib/mred/private/wx/common/backing-dc.rkt

after `get-backing-size` is called. A zero dimension could be just
increased to 1 before passing it to `get-backing-bitmap`. Can you try
making that change to see if it solves the problem on your machine?

At Fri, 29 Jul 2016 17:08:42 +0300, Dmitry Pavlov wrote:

Jens,

Oddly, another installation of Racket 6.6 on 32-bit Windows XP not only
reproduced the error, but also gave a stack trace:

initialization for bitmap%: bad argument combination: 495 0 #f #t 1.25
 context...:
  C:\Program
Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: next
  C:\Program
Files\Racket\share\pkgs\draw-lib\racket\draw\private\bitmap.rkt:156:2
  C:\Program
Files\Racket\collects\racket\private\class-internal.rkt:3553:0:
continue-make-object
  C:\Program
Files\Racket\collects\racket\private\class-internal.rkt:3507:0:
do-make-object
  C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\backing-dc.rkt:122:4:
get-cr method in backing-dc%
  C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\canvas-mixin.rkt:144:4:
do-on-paint method in ...mon/canvas-mixin.rkt:118:2
  C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:454:6
  C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:505:32
  C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:653:3

bitmap.rkt confirms your hypothesis that the first number is the width,
and the second number is the height, and they both must be positive.

  [([exact-positive-integer? w]
[exact-positive-integer? h]
[any? [b&w? #f]]
[any? [alpha? #f]]
[positive-real? [scale 1.0]])

The width is not specified exactly in the app. I do not know why the
height is zero. I do not use bitmaps directly, just controls and canvas.
I will go with trial and error to get a small reproducible example.

Regards,

Dmitry


On 07/28/2016 11:50 PM, Jens Axel Søgaard wrote:

Just a hunch: If 486 is a width - then the 0 could be a problematic
height?

Do you recognize the number 486?

/Jens Axel


2016-07-28 22:29 GMT+02:00 mailto:dpav...@iaaras.ru>>:

  

Re: [racket-users] Error message from GUI

2016-07-29 Thread Vincent St-Amour
Should this change be added to gui-lib?

Vincent


On Fri, 29 Jul 2016 10:08:46 -0500,
Dmitry Pavlov wrote:
> 
> Matthew,
> 
> Yes that works, thank!
> 
> Also I figured why the message did not show up on my "first" WinXP
> installation: the spreadsheet-editor package has not been updated there.
> Newer version of spreadsheet-editor sets (style '(hide-vscroll)) and
> (style '(hide-hscroll)) to panels with row and column buttons.
> 
> Styles cause the error. Changing styles to just '(hscroll) and
> '(vscroll) does not remove the error.
> Anyway, I need those (hide-vscroll) and (hide-hscroll), so I am going to
> use the patch you proposed, unless there is a more elegant solution I am
> unaware of.
> 
> (Another question is why there is a stack trace in 32-bit Windows and
> just a message in 64-bit Windows, but that is of purely theoretical
> importance to me.)
> 
> Best regards,
> 
> Dmitry
> 
> 
> On 07/29/2016 05:25 PM, Matthew Flatt wrote:
> > It may be that a guard against a 0-sized drawing dimension is needed.
> > The right place for the guard might be in the `get-cr` method of
> > 
> >   gui-lib/mred/private/wx/common/backing-dc.rkt
> > 
> > after `get-backing-size` is called. A zero dimension could be just
> > increased to 1 before passing it to `get-backing-bitmap`. Can you try
> > making that change to see if it solves the problem on your machine?
> > 
> > At Fri, 29 Jul 2016 17:08:42 +0300, Dmitry Pavlov wrote:
> >> Jens,
> >> 
> >> Oddly, another installation of Racket 6.6 on 32-bit Windows XP not only
> >> reproduced the error, but also gave a stack trace:
> >> 
> >> initialization for bitmap%: bad argument combination: 495 0 #f #t 1.25
> >> context...:
> >>  C:\Program
> >> Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: 
> >> next
> >>  C:\Program
> >> Files\Racket\share\pkgs\draw-lib\racket\draw\private\bitmap.rkt:156:2
> >>  C:\Program
> >> Files\Racket\collects\racket\private\class-internal.rkt:3553:0:
> >> continue-make-object
> >>  C:\Program
> >> Files\Racket\collects\racket\private\class-internal.rkt:3507:0:
> >> do-make-object
> >>  C:\Program
> >> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\backing-dc.rkt:122:4:
> >> get-cr method in backing-dc%
> >>  C:\Program
> >> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\canvas-mixin.rkt:144:4:
> >> do-on-paint method in ...mon/canvas-mixin.rkt:118:2
> >>  C:\Program
> >> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:454:6
> >>  C:\Program
> >> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:505:32
> >>  C:\Program
> >> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:653:3
> >> 
> >> bitmap.rkt confirms your hypothesis that the first number is the width,
> >> and the second number is the height, and they both must be positive.
> >> 
> >>  [([exact-positive-integer? w]
> >>[exact-positive-integer? h]
> >>[any? [b&w? #f]]
> >>[any? [alpha? #f]]
> >>[positive-real? [scale 1.0]])
> >> 
> >> The width is not specified exactly in the app. I do not know why the
> >> height is zero. I do not use bitmaps directly, just controls and canvas.
> >> I will go with trial and error to get a small reproducible example.
> >> 
> >> Regards,
> >> 
> >> Dmitry
> >> 
> >> 
> >> On 07/28/2016 11:50 PM, Jens Axel Søgaard wrote:
> >>> Just a hunch: If 486 is a width - then the 0 could be a problematic
> >>> height?
> >>> 
> >>> Do you recognize the number 486?
> >>> 
> >>> /Jens Axel
> >>> 
> >>> 
> >>> 2016-07-28 22:29 GMT+02:00 mailto:dpav...@iaaras.ru>>:
> >>> 
> >>>  Hello,
> >>> 
> >>>  Running my GUI app from Racket 6.6, I see the following error
> >>>  message in the console:
> >>> 
> >>>  initialization for bitmap%: bad argument combination: 486 0 #f #t 1.0
> >>> 
> >>>  It happens on 64-bit Windows 7 and 10, and does not happen on
> >>>  32-bit Windows XP and 64-bit Linux.
> >>> 
> >>>  It also did not happen on Racket 6.5.
> >>> 
> >>>  The app continues to work despite the error. There is no stack
> >>>  trace whatsoever.
> >>>  What can I do to trace the problem?
> >>> 
> >>> 
> >>>  Best regards,
> >>> 
> >>>  Dmitry
> >>> 
> >>>  --
> >>>  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
> >>>  .
> >>>  For more options, visit https://groups.google.com/d/optout.
> >>> 
> >>> 
> >>> 
> >>> 
> >>> -- 
> >>> -- 
> >>> Jens Axel Søgaard
> >>> 
> >> -- 
> >> 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-

Re: [racket-users] Error message from GUI

2016-07-29 Thread Dmitry Pavlov

Matthew,

Yes that works, thank!

Also I figured why the message did not show up on my "first" WinXP 
installation: the spreadsheet-editor package has not been updated there.
Newer version of spreadsheet-editor sets (style '(hide-vscroll)) and 
(style '(hide-hscroll)) to panels with row and column buttons.


Styles cause the error. Changing styles to just '(hscroll) and 
'(vscroll) does not remove the error.
Anyway, I need those (hide-vscroll) and (hide-hscroll), so I am going to 
use the patch you proposed, unless there is a more elegant solution I am 
unaware of.


(Another question is why there is a stack trace in 32-bit Windows and 
just a message in 64-bit Windows, but that is of purely theoretical 
importance to me.)


Best regards,

Dmitry


On 07/29/2016 05:25 PM, Matthew Flatt wrote:

It may be that a guard against a 0-sized drawing dimension is needed.
The right place for the guard might be in the `get-cr` method of

  gui-lib/mred/private/wx/common/backing-dc.rkt

after `get-backing-size` is called. A zero dimension could be just
increased to 1 before passing it to `get-backing-bitmap`. Can you try
making that change to see if it solves the problem on your machine?

At Fri, 29 Jul 2016 17:08:42 +0300, Dmitry Pavlov wrote:

Jens,

Oddly, another installation of Racket 6.6 on 32-bit Windows XP not only
reproduced the error, but also gave a stack trace:

initialization for bitmap%: bad argument combination: 495 0 #f #t 1.25
context...:
 C:\Program
Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: next
 C:\Program
Files\Racket\share\pkgs\draw-lib\racket\draw\private\bitmap.rkt:156:2
 C:\Program
Files\Racket\collects\racket\private\class-internal.rkt:3553:0:
continue-make-object
 C:\Program
Files\Racket\collects\racket\private\class-internal.rkt:3507:0:
do-make-object
 C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\backing-dc.rkt:122:4:
get-cr method in backing-dc%
 C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\canvas-mixin.rkt:144:4:
do-on-paint method in ...mon/canvas-mixin.rkt:118:2
 C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:454:6
 C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:505:32
 C:\Program
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:653:3

bitmap.rkt confirms your hypothesis that the first number is the width,
and the second number is the height, and they both must be positive.

 [([exact-positive-integer? w]
   [exact-positive-integer? h]
   [any? [b&w? #f]]
   [any? [alpha? #f]]
   [positive-real? [scale 1.0]])

The width is not specified exactly in the app. I do not know why the
height is zero. I do not use bitmaps directly, just controls and canvas.
I will go with trial and error to get a small reproducible example.

Regards,

Dmitry


On 07/28/2016 11:50 PM, Jens Axel Søgaard wrote:

Just a hunch: If 486 is a width - then the 0 could be a problematic
height?

Do you recognize the number 486?

/Jens Axel


2016-07-28 22:29 GMT+02:00 mailto:dpav...@iaaras.ru>>:

 Hello,

 Running my GUI app from Racket 6.6, I see the following error
 message in the console:

 initialization for bitmap%: bad argument combination: 486 0 #f #t 1.0

 It happens on 64-bit Windows 7 and 10, and does not happen on
 32-bit Windows XP and 64-bit Linux.

 It also did not happen on Racket 6.5.

 The app continues to work despite the error. There is no stack
 trace whatsoever.
 What can I do to trace the problem?


 Best regards,

 Dmitry

 --
 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
 .
 For more options, visit https://groups.google.com/d/optout.




--
--
Jens Axel Søgaard


--
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.
For more options, visit https://groups.google.com/d/optout.


--
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error message from GUI

2016-07-29 Thread Matthew Flatt
It may be that a guard against a 0-sized drawing dimension is needed.
The right place for the guard might be in the `get-cr` method of

 gui-lib/mred/private/wx/common/backing-dc.rkt

after `get-backing-size` is called. A zero dimension could be just
increased to 1 before passing it to `get-backing-bitmap`. Can you try
making that change to see if it solves the problem on your machine?

At Fri, 29 Jul 2016 17:08:42 +0300, Dmitry Pavlov wrote:
> Jens,
> 
> Oddly, another installation of Racket 6.6 on 32-bit Windows XP not only 
> reproduced the error, but also gave a stack trace:
> 
> initialization for bitmap%: bad argument combination: 495 0 #f #t 1.25
>context...:
> C:\Program 
> Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: next
> C:\Program 
> Files\Racket\share\pkgs\draw-lib\racket\draw\private\bitmap.rkt:156:2
> C:\Program 
> Files\Racket\collects\racket\private\class-internal.rkt:3553:0: 
> continue-make-object
> C:\Program 
> Files\Racket\collects\racket\private\class-internal.rkt:3507:0: 
> do-make-object
> C:\Program 
> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\backing-dc.rkt:122:4: 
> get-cr method in backing-dc%
> C:\Program 
> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\canvas-mixin.rkt:144:4:
>  
> do-on-paint method in ...mon/canvas-mixin.rkt:118:2
> C:\Program 
> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:454:6
> C:\Program 
> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:505:32
> C:\Program 
> Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:653:3
> 
> bitmap.rkt confirms your hypothesis that the first number is the width, 
> and the second number is the height, and they both must be positive.
> 
> [([exact-positive-integer? w]
>   [exact-positive-integer? h]
>   [any? [b&w? #f]]
>   [any? [alpha? #f]]
>   [positive-real? [scale 1.0]])
> 
> The width is not specified exactly in the app. I do not know why the 
> height is zero. I do not use bitmaps directly, just controls and canvas.
> I will go with trial and error to get a small reproducible example.
> 
> Regards,
> 
> Dmitry
> 
> 
> On 07/28/2016 11:50 PM, Jens Axel Søgaard wrote:
> > Just a hunch: If 486 is a width - then the 0 could be a problematic 
> > height?
> >
> > Do you recognize the number 486?
> >
> > /Jens Axel
> >
> >
> > 2016-07-28 22:29 GMT+02:00 mailto:dpav...@iaaras.ru>>:
> >
> > Hello,
> >
> > Running my GUI app from Racket 6.6, I see the following error
> > message in the console:
> >
> > initialization for bitmap%: bad argument combination: 486 0 #f #t 1.0
> >
> > It happens on 64-bit Windows 7 and 10, and does not happen on
> > 32-bit Windows XP and 64-bit Linux.
> >
> > It also did not happen on Racket 6.5.
> >
> > The app continues to work despite the error. There is no stack
> > trace whatsoever.
> > What can I do to trace the problem?
> >
> >
> > Best regards,
> >
> > Dmitry
> >
> > -- 
> > 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
> > .
> > For more options, visit https://groups.google.com/d/optout.
> >
> >
> >
> >
> > -- 
> > -- 
> > Jens Axel Søgaard
> >
> 
> -- 
> 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.
> For more options, visit https://groups.google.com/d/optout.

-- 
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.
For more options, visit https://groups.google.com/d/optout.


Re: [racket-users] Error message from GUI

2016-07-29 Thread Dmitry Pavlov

Jens,

Oddly, another installation of Racket 6.6 on 32-bit Windows XP not only 
reproduced the error, but also gave a stack trace:


initialization for bitmap%: bad argument combination: 495 0 #f #t 1.25
  context...:
   C:\Program 
Files\Racket\share\pkgs\draw-lib\racket\draw\private\syntax.rkt:252:13: next
   C:\Program 
Files\Racket\share\pkgs\draw-lib\racket\draw\private\bitmap.rkt:156:2
   C:\Program 
Files\Racket\collects\racket\private\class-internal.rkt:3553:0: 
continue-make-object
   C:\Program 
Files\Racket\collects\racket\private\class-internal.rkt:3507:0: 
do-make-object
   C:\Program 
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\backing-dc.rkt:122:4: 
get-cr method in backing-dc%
   C:\Program 
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\canvas-mixin.rkt:144:4: 
do-on-paint method in ...mon/canvas-mixin.rkt:118:2
   C:\Program 
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:454:6
   C:\Program 
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:505:32
   C:\Program 
Files\Racket\share\pkgs\gui-lib\mred\private\wx\common\queue.rkt:653:3


bitmap.rkt confirms your hypothesis that the first number is the width, 
and the second number is the height, and they both must be positive.


   [([exact-positive-integer? w]
 [exact-positive-integer? h]
 [any? [b&w? #f]]
 [any? [alpha? #f]]
 [positive-real? [scale 1.0]])

The width is not specified exactly in the app. I do not know why the 
height is zero. I do not use bitmaps directly, just controls and canvas.

I will go with trial and error to get a small reproducible example.

Regards,

Dmitry


On 07/28/2016 11:50 PM, Jens Axel Søgaard wrote:
Just a hunch: If 486 is a width - then the 0 could be a problematic 
height?


Do you recognize the number 486?

/Jens Axel


2016-07-28 22:29 GMT+02:00 mailto:dpav...@iaaras.ru>>:

Hello,

Running my GUI app from Racket 6.6, I see the following error
message in the console:

initialization for bitmap%: bad argument combination: 486 0 #f #t 1.0

It happens on 64-bit Windows 7 and 10, and does not happen on
32-bit Windows XP and 64-bit Linux.

It also did not happen on Racket 6.5.

The app continues to work despite the error. There is no stack
trace whatsoever.
What can I do to trace the problem?


Best regards,

Dmitry

-- 
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
.
For more options, visit https://groups.google.com/d/optout.




--
--
Jens Axel Søgaard



--
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.
For more options, visit https://groups.google.com/d/optout.


[racket-users] Error message from GUI

2016-07-28 Thread dpavlov

Hello,

Running my GUI app from Racket 6.6, I see the following error message in 
the console:


initialization for bitmap%: bad argument combination: 486 0 #f #t 1.0

It happens on 64-bit Windows 7 and 10, and does not happen on 32-bit 
Windows XP and 64-bit Linux.


It also did not happen on Racket 6.5.

The app continues to work despite the error. There is no stack trace 
whatsoever.

What can I do to trace the problem?


Best regards,

Dmitry

--
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.
For more options, visit https://groups.google.com/d/optout.