dumb question about gadgets

John Morrison jm at symbolic-simulation.com
Sat Nov 11 20:49:40 UTC 2017


ugh - should attach what I said I attached

On Sat, Nov 11, 2017 at 3:48 PM, John Morrison <jm at symbolic-simulation.com>
wrote:

> Hi Daniel (and Lucien, who replied privately):
>
> (1) thanks for the "not dumb" comment.
>
> Sorry additionally for not being clear.  The app is intended for the
> buttons (will eventually be checkboxes, but buttons were simpler for
> purposes of isolating the behavior) to be dynamic (unknown at layout time
> as things to be checked will come and go during program execution).
>
> So while I did have some joy with making :list-panes with :items in the
> definition of the application frame (and it was prettier than what I sent),
> I had less joy changing those items programmatically.
>
> When I put a "terpri" in as in the slightly revised test program as the
> other alternative, I get a blank line between the gadgets, which (given I
> am going to have a lot of items) would cause the user excess scrolling due
> to the whitespace between boxes.
>
> -jm
>
>
>
>
> On Sat, Nov 11, 2017 at 3:24 PM, Daniel KochmaƄski <daniel at turtleware.eu>
> wrote:
>
>> Hello John,
>>
>> question is obviously not dumb. Some cognitive problem arises from the
>> disparity, that McCLIM provides both sheets and gadgets. If you want to lay
>> out buttons vertically, you may either put terpri after each make-pane, or
>> put each button in your layout (the latter is more elegant imho):
>>
>> -- cut --
>>
>> (in-package :clim-user)
>>
>> (defun make-gadget (item)
>>   (make-pane 'push-button
>>              :label item
>>              :activate-callback
>>              (lambda (&rest args)
>>                (declare (ignore args))
>>                (notify-user *application-frame* "You clicked a button"))))
>>
>> (define-application-frame test-gadgets ()
>>   ()
>>   (:panes)
>>   (:layouts
>>    (default (vertically ()
>>               (make-gadget "one")
>>               (make-gadget "two")
>>               (make-gadget "three")
>>               (make-gadget "four")))))
>>
>>
>> (run-frame-top-level (make-application-frame 'test-gadgets))
>>
>> -- cut --
>>
>> Best regards,
>>
>> Daniel
>>
>>
>>
>> On 11.11.2017 21:07, John Morrison wrote:
>>
>>> Hi;
>>>
>>> In another app I am writing, I BELIEVE gadgets used to come out stacked
>>> vertically.  After an upgrade (to current git), I think they come out
>>> "diagonally," in that the x & y of successive gadgets increase (presumbly
>>> by the dimensions of its preceding gadget).  Please find attached the
>>> simplest test program I could cons up that displays the behavior, along
>>> with a screenshot that shows the behavior.
>>>
>>> What is the idiomatic/best way to get them to stack vertically?  I
>>> messed about (again, mostly unsuccessfully, or I wouldn't be pestering you
>>> all) with various approaches, but every time I find myself with a complex
>>> solution, it turns out there is indeed a Better, Simpler Way.
>>>
>>> Thanks,
>>>
>>> -jm
>>>
>>>
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20171111/1d2731bc/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-gadgets-v01.png
Type: image/png
Size: 7763 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20171111/1d2731bc/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: test-gadgets-v01.lisp
Type: application/octet-stream
Size: 852 bytes
Desc: not available
URL: <https://mailman.common-lisp.net/pipermail/mcclim-devel/attachments/20171111/1d2731bc/attachment.obj>


More information about the mcclim-devel mailing list