[VW7.8] Image turns irresponsive with more than one error notification(?) - more info

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
17 messages Options
Reply | Threaded
Open this post in threaded view
|

[VW7.8] Image turns irresponsive with more than one error notification(?) - more info

Christian Haider

Some more information:

 

When such an error occurs, the first notification dialog shows some text for a split second (until the other notifications come up, I guess).

 

The Windows task manager shows no activity of the Smalltalk process.

 

Event-faithful debugging does not change anything.

 

This is on Win7 64bit with a quad-core processor.

 

Really hope that this can be resolved….

                Christian


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] Image turns irresponsive with more than one error notification(?) - more info

Andres Valloud-6
Is there any way you might be able to modify the default handler for the
UnhandledException so that it dumps e.g.: thisContext printStack to a
file before opening the notifier?

On 5/20/2011 2:03 AM, Christian Haider wrote:

> Some more information:
>
> When such an error occurs, the first notification dialog shows some text
> for a split second (until the other notifications come up, I guess).
>
> The Windows task manager shows no activity of the Smalltalk process.
>
> Event-faithful debugging does not change anything.
>
> This is on Win7 64bit with a quad-core processor.
>
> Really hope that this can be resolved….
>
> Christian
>
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] Image turns irresponsive with more than one errornotification(?) - more info

Steven Kelly
In reply to this post by Christian Haider

Are you using the 64-bit VM, in preview for Windows?

Maybe you can follow the instructions here to get some more debugging info:

http://www.cincomsmalltalk.com/CincomSmalltalkWiki/VM+Info

Steve

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christian Haider
Sent: 20. toukokuuta 2011 12:03
To: [hidden email]
Subject: [vwnc] [VW7.8] Image turns irresponsive with more than one errornotification(?) - more info

 

Some more information:

 

When such an error occurs, the first notification dialog shows some text for a split second (until the other notifications come up, I guess).

 

The Windows task manager shows no activity of the Smalltalk process.

 

Event-faithful debugging does not change anything.

 

This is on Win7 64bit with a quad-core processor.

 

Really hope that this can be resolved….

                Christian


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] Image turns irresponsive with more than one errornotification(?) - more info

Christian Haider
In reply to this post by Christian Haider

No, I’m using the regular 32bit VM.

 

Thanks,

                Christian

 

Von: Steven Kelly [mailto:[hidden email]]
Gesendet: Freitag, 20. Mai 2011 13:01
An: Christian Haider; [hidden email]
Betreff: RE: [vwnc] [VW7.8] Image turns irresponsive with more than one errornotification(?) - more info

 

Are you using the 64-bit VM, in preview for Windows?

Maybe you can follow the instructions here to get some more debugging info:

http://www.cincomsmalltalk.com/CincomSmalltalkWiki/VM+Info

Steve

 

From: [hidden email] [mailto:[hidden email]] On Behalf Of Christian Haider
Sent: 20. toukokuuta 2011 12:03
To: [hidden email]
Subject: [vwnc] [VW7.8] Image turns irresponsive with more than one errornotification(?) - more info

 

Some more information:

 

When such an error occurs, the first notification dialog shows some text for a split second (until the other notifications come up, I guess).

 

The Windows task manager shows no activity of the Smalltalk process.

 

Event-faithful debugging does not change anything.

 

This is on Win7 64bit with a quad-core processor.

 

Really hope that this can be resolved….

                Christian


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] Image turns irresponsive with more than one error notification(?) - more info

jarober
In reply to this post by Christian Haider
Every time I've seen something like this, it's been related to code that is trying to update some Window, and failing - revealing the Window generates the error again (rinse, repeat).  


On May 20, 2011, at 5:03 AM, Christian Haider wrote:

Some more information:
 
When such an error occurs, the first notification dialog shows some text for a split second (until the other notifications come up, I guess).
 
The Windows task manager shows no activity of the Smalltalk process.
 
Event-faithful debugging does not change anything.
 
This is on Win7 64bit with a quad-core processor.
 
Really hope that this can be resolved….
                Christian
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc



_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [VW7.8] Image turns irresponsive with more than one error notification(?) - more info

Christian Haider
In reply to this post by Christian Haider
Thank you for this tip. This narrows it down a bit. Among the errors I expected there was one with the following trace:

Pixmap(Object)>>doesNotUnderstand:
InputState>>processUnknownEvent:for:
InputState>>send:noOp:
InputState>>process:
InputState>>run
optimized [] in InputState class>>install
BlockClosure>>on:do:
optimized [] in Process class>>forBlock:priority:

This seems to hang the image.
The #printStack message does not provide too much info. If you know something simple to print more info, let me know and will send you the results.

The situation in my app (only exemplary, since I think that problem occurred in other circumstances):
I fork off of a number of requests to a data provider.
When an answer comes back I display the result. The displaying method had a simple error (MNU).
Usually I get a notifier for each of the errors, which is what I want.
But sometimes, unfortunately not deterministic, the image locks up - presumable with the error above.
I tried to find a reproducible case in a vanilla visual.im, but have not succeeded so far.

Cheers,
        Christian

> -----UrsprĂĽngliche Nachricht-----
> Von: [hidden email] [mailto:[hidden email]] Im
> Auftrag von Andres Valloud
> Gesendet: Freitag, 20. Mai 2011 11:46
> An: [hidden email]
> Betreff: Re: [vwnc] [VW7.8] Image turns irresponsive with more than one
> error notification(?) - more info
>
> Is there any way you might be able to modify the default handler for the
> UnhandledException so that it dumps e.g.: thisContext printStack to a file
> before opening the notifier?
>
> On 5/20/2011 2:03 AM, Christian Haider wrote:
> > Some more information:
> >
> > When such an error occurs, the first notification dialog shows some
> > text for a split second (until the other notifications come up, I guess).
> >
> > The Windows task manager shows no activity of the Smalltalk process.
> >
> > Event-faithful debugging does not change anything.
> >
> > This is on Win7 64bit with a quad-core processor.
> >
> > Really hope that this can be resolved....
> >
> > Christian
> >
> >
> >
> > _______________________________________________
> > vwnc mailing list
> > [hidden email]
> > http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Programmatically setting a font

Carl Gundel
In reply to this post by Andres Valloud-6
I've dug around a bit and can't seem to figure out how to set a font programmatically.  For example, how would I change the font for the TextEditorSpec at the end of this script?  Thanks.

-Carl

| builder firstModel secondModel answerModel checkBox |
        builder := UIBuilder new.
builder window: MainWindowApplicationWindow new.
firstModel := '3' asValue.
secondModel := '4' asValue.
answerModel := '' asValue.
builder add: (WindowSpec label: 'my window').
builder add: ((InputFieldSpec model: firstModel layout: (10@10 extent: 50@25)) name: 'first').
builder add: (InputFieldSpec model: secondModel layout: (70@10 extent: 50@25)).
builder add: ((ActionButtonSpec model:
        [
                answerModel
                        value: (firstModel value asNumber + secondModel value asNumber) printString
        ] layout: (130@10 extent: 30@25)) label: 'Add'; yourself).
builder add: (InputFieldSpec model: answerModel layout: (170@10 extent: 50@25)).
checkBox := builder add: (CheckBoxSpec model: true asValue layout: (10@45 extent: 100@25)).
checkBox labelString: 'test'.
builder add: ((TextEditorSpec model: '' asValue layout: (10@80 extent: 280@110)) name: 'editor').
builder openWithExtent: 300@200.
builder window
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Programmatically setting a font

Boris Popov, DeepCove Labs (SNN)

Carl,

 

builder add: ((TextEditorSpec model: '' asValue layout: (10 @ 80 extent: 280 @ 110))

name: 'editor';

                                style: (TextAttributes defaultFontQuery: ((FontDescription new)

                                                                                                                                                family: 'courier';

                                                                                                                                                pixelSize: 18;

                                                                                                                                                boldness: 0.5;

                                                                                                                                                italic: false;

                                                                                                                                                underline: true;

                                                                                                                                                yourself));

                                yourself).

 

 

-Boris

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Carl Gundel
Sent: 25 May 2011 18:39
To: VWNC
Subject: [vwnc] Programmatically setting a font

 

I've dug around a bit and can't seem to figure out how to set a font programmatically.  For example, how would I change the font for the TextEditorSpec at the end of this script?  Thanks.

 

-Carl

 

| builder firstModel secondModel answerModel checkBox |

                builder := UIBuilder new.

builder window: MainWindowApplicationWindow new.

firstModel := '3' asValue.

secondModel := '4' asValue.

answerModel := '' asValue.

builder add: (WindowSpec label: 'my window').

builder add: ((InputFieldSpec model: firstModel layout: (10@10 extent: 50@25)) name: 'first').

builder add: (InputFieldSpec model: secondModel layout: (70@10 extent: 50@25)).

builder add: ((ActionButtonSpec model:

                [

                                answerModel

                                                value: (firstModel value asNumber + secondModel value asNumber) printString

                ] layout: (130@10 extent: 30@25)) label: 'Add'; yourself).

builder add: (InputFieldSpec model: answerModel layout: (170@10 extent: 50@25)).

checkBox := builder add: (CheckBoxSpec model: true asValue layout: (10@45 extent: 100@25)).

checkBox labelString: 'test'.

builder add: ((TextEditorSpec model: '' asValue layout: (10@80 extent: 280@110)) name: 'editor').

builder openWithExtent: 300@200.

builder window

_______________________________________________

vwnc mailing list

[hidden email]

http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Programmatically setting a font

Carl Gundel-2
Thanks Boris!  You're a lifesaver!  :-)

-Carl Gundel
Liberty BASIC for Windows - http://www.libertybasic.com
Run BASIC, easy web programming - http://www.runbasic.com

On May 25, 2011, at 7:00 PM, "Boris Popov, DeepCove Labs" <[hidden email]> wrote:

Carl,

 

builder add: ((TextEditorSpec model: '' asValue layout: (10 @ 80 extent: 280 @ 110))

name: 'editor';

                                style: (TextAttributes defaultFontQuery: ((FontDescription new)

                                                                                                                                                family: 'courier';

                                                                                                                                                pixelSize: 18;

                                                                                                                                                boldness: 0.5;

                                                                                                                                                italic: false;

                                                                                                                                                underline: true;

                                                                                                                                                yourself));

                                yourself).

 

 

-Boris

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Carl Gundel
Sent: 25 May 2011 18:39
To: VWNC
Subject: [vwnc] Programmatically setting a font

 

I've dug around a bit and can't seem to figure out how to set a font programmatically.  For example, how would I change the font for the TextEditorSpec at the end of this script?  Thanks.

 

-Carl

 

| builder firstModel secondModel answerModel checkBox |

                builder := UIBuilder new.

builder window: MainWindowApplicationWindow new.

firstModel := '3' asValue.

secondModel := '4' asValue.

answerModel := '' asValue.

builder add: (WindowSpec label: 'my window').

builder add: ((InputFieldSpec model: firstModel layout: (10@10 extent: 50@25)) name: 'first').

builder add: (InputFieldSpec model: secondModel layout: (70@10 extent: 50@25)).

builder add: ((ActionButtonSpec model:

                [

                                answerModel

                                                value: (firstModel value asNumber + secondModel value asNumber) printString

                ] layout: (130@10 extent: 30@25)) label: 'Add'; yourself).

builder add: (InputFieldSpec model: answerModel layout: (170@10 extent: 50@25)).

checkBox := builder add: (CheckBoxSpec model: true asValue layout: (10@45 extent: 100@25)).

checkBox labelString: 'test'.

builder add: ((TextEditorSpec model: '' asValue layout: (10@80 extent: 280@110)) name: 'editor').

builder openWithExtent: 300@200.

builder window

_______________________________________________

vwnc mailing list

[hidden email]

http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Programmatically setting a font

Boris Popov, DeepCove Labs (SNN)

Any time. There are a lot of subtleties in the world of TextAttributes, CharacterAttributes, FontDescriptions etcetera, but this should give you some idea on where to start pulling the strings.

 

Regards,

 

-Boris

 

From: Carl Gundel [mailto:[hidden email]]
Sent: 25 May 2011 19:27
To: Boris Popov, DeepCove Labs
Cc: [hidden email]
Subject: Re: [vwnc] Programmatically setting a font

 

Thanks Boris!  You're a lifesaver!  :-)

-Carl Gundel

Liberty BASIC for Windows - http://www.libertybasic.com

Run BASIC, easy web programming - http://www.runbasic.com


On May 25, 2011, at 7:00 PM, "Boris Popov, DeepCove Labs" <[hidden email]> wrote:

Carl,

 

builder add: ((TextEditorSpec model: '' asValue layout: (10 @ 80 extent: 280 @ 110))

name: 'editor';

                                style: (TextAttributes defaultFontQuery: ((FontDescription new)

                                                                                                                                                family: 'courier';

                                                                                                                                                pixelSize: 18;

                                                                                                                                                boldness: 0.5;

                                                                                                                                                italic: false;

                                                                                                                                                underline: true;

                                                                                                                                                yourself));

                                yourself).

 

 

-Boris

 

-----Original Message-----
From: [hidden email] [mailto:[hidden email]] On Behalf Of Carl Gundel
Sent: 25 May 2011 18:39
To: VWNC
Subject: [vwnc] Programmatically setting a font

 

I've dug around a bit and can't seem to figure out how to set a font programmatically.  For example, how would I change the font for the TextEditorSpec at the end of this script?  Thanks.

 

-Carl

 

| builder firstModel secondModel answerModel checkBox |

                builder := UIBuilder new.

builder window: MainWindowApplicationWindow new.

firstModel := '3' asValue.

secondModel := '4' asValue.

answerModel := '' asValue.

builder add: (WindowSpec label: 'my window').

builder add: ((InputFieldSpec model: firstModel layout: (10@10 extent: 50@25)) name: 'first').

builder add: (InputFieldSpec model: secondModel layout: (70@10 extent: 50@25)).

builder add: ((ActionButtonSpec model:

                [

                                answerModel

                                                value: (firstModel value asNumber + secondModel value asNumber) printString

                ] layout: (130@10 extent: 30@25)) label: 'Add'; yourself).

builder add: (InputFieldSpec model: answerModel layout: (170@10 extent: 50@25)).

checkBox := builder add: (CheckBoxSpec model: true asValue layout: (10@45 extent: 100@25)).

checkBox labelString: 'test'.

builder add: ((TextEditorSpec model: '' asValue layout: (10@80 extent: 280@110)) name: 'editor').

builder openWithExtent: 300@200.

builder window

_______________________________________________

vwnc mailing list

[hidden email]

http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Toolbar images

Carl Gundel
In reply to this post by Carl Gundel
I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.

In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.

I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?

Any help appreciated.  Thanks,

-Carl
_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Toolbar images

jarober
I don't think I ever did a screencast on basic toolbar use, but look at class VisualLauncher.  It has one, and you can do what it does.  iirc, the images have to be a specific size.


On Jun 7, 2011, at 10:41 PM, Carl Gundel wrote:

> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>
> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>
> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>
> Any help appreciated.  Thanks,
>
> -Carl
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc

James Robertson
http://www.jarober.com
[hidden email]




_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Toolbar images

Travis Griggs-4
In reply to this post by Carl Gundel

On Jun 7, 2011, at 7:41 PM, Carl Gundel wrote:

> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>
> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>
> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>
> Any help appreciated.  Thanks,

I *think*... I didn't follow this thru the debugger yet, but I think the class has to respond to visualFor:. Where the nominal implementation for that is to simply do a ^self perform: theArgument. IOW, I note that I can't just put Announcer and toolListIcon there. But If I put BehaviorIcons and the selector  #Model in it, it works, because the AlphaBlendedIcons resource class implements visualFor: as a sort of bw compat for this unfortunate need.

I wish it weren't so, I'll see if I can't figure out an elegant/safe way to lift this restriction.

HTH

--
Travis Griggs
Objologist
Simplicity is the Ultimate Sophistication -- Leonardo da Vinci


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Toolbar images

Carl Gundel
Thanks Travis, but the class I'm specifying is a subclass of ApplicationModel.  That seems to meet the requirement of implementing visualFor:.  Any other ideas?

-Carl

On Jun 8, 2011, at 2:34 AM, Travis Griggs wrote:

>
> On Jun 7, 2011, at 7:41 PM, Carl Gundel wrote:
>
>> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>>
>> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>>
>> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>>
>> Any help appreciated.  Thanks,
>
> I *think*... I didn't follow this thru the debugger yet, but I think the class has to respond to visualFor:. Where the nominal implementation for that is to simply do a ^self perform: theArgument. IOW, I note that I can't just put Announcer and toolListIcon there. But If I put BehaviorIcons and the selector  #Model in it, it works, because the AlphaBlendedIcons resource class implements visualFor: as a sort of bw compat for this unfortunate need.
>
> I wish it weren't so, I'll see if I can't figure out an elegant/safe way to lift this restriction.
>
> HTH
>
> --
> Travis Griggs
> Objologist
> Simplicity is the Ultimate Sophistication -- Leonardo da Vinci
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: [7.4] Toolbar images

Carl Gundel
In reply to this post by jarober
James,

If I open the menu editor on the launcherToolbar method on class VisualLauncher, there are no images specified on the Details tab.  Pretty mysterious.

I forgot to mention that I'm doing this in VW 7.4 if that matters.

-Carl

On Jun 7, 2011, at 11:38 PM, James Robertson wrote:

> I don't think I ever did a screencast on basic toolbar use, but look at class VisualLauncher.  It has one, and you can do what it does.  iirc, the images have to be a specific size.
>
>
> On Jun 7, 2011, at 10:41 PM, Carl Gundel wrote:
>
>> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>>
>> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>>
>> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>>
>> Any help appreciated.  Thanks,
>>
>> -Carl
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
> James Robertson
> http://www.jarober.com
> [hidden email]
>
>
>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

Re: Toolbar images

Holger Guhl
In reply to this post by Carl Gundel
  So the method should be sent to your ApplicationModel subclass. I have never went this way but I
don't see why it shouldn't work. Just to make sure that the basic assumptions are correct: Place a
breakpoint at your resource method (the one returning the picture, must be a class method otherwise
it won't work, since #visualFor: asks the app which is the class at that point), then run the
ApplicationModel. You can also try the MenuEditor but it might be protected against exceptions. If
the breakpoint fires, the problem must be with the graphic. If it doesn't fire, then we must check
out why #visualFor:

What's the result of your picture resource method? To have the same behavior as expected for other
toolbar icons, you should return an OpaqueImageWithEnablement of size 20x20 px.
My approach is always a bit different. In general, I extend ToolbarIconLibrary and add the typical
resource methods on its class side, something like #myIcon20x20 and #myIcon20x20mask.
ToolbarIconLibrary is a good container for that kind of stuff and I can reuse all the caching
behavior. Then I use it in the MenuEditor, with class = ToolbarIconLibrary and selector #myIcon.
Note the resource method name change! ToolbarIconLibrary always appends the suffix 20x20 to the
logical name before it accesses its real resource methods.
Hope that helps...

Holger Guhl
--
Senior Consultant * Certified Scrum Master * [hidden email]
Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
Georg Heeg eK Dortmund
Handelsregister: Amtsgericht Dortmund  A 12812


Am 09.06.2011 18:37, schrieb Carl Gundel:

> Thanks Travis, but the class I'm specifying is a subclass of ApplicationModel.  That seems to meet the requirement of implementing visualFor:.  Any other ideas?
>
> -Carl
>
> On Jun 8, 2011, at 2:34 AM, Travis Griggs wrote:
>
>> On Jun 7, 2011, at 7:41 PM, Carl Gundel wrote:
>>
>>> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>>>
>>> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>>>
>>> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>>>
>>> Any help appreciated.  Thanks,
>> I *think*... I didn't follow this thru the debugger yet, but I think the class has to respond to visualFor:. Where the nominal implementation for that is to simply do a ^self perform: theArgument. IOW, I note that I can't just put Announcer and toolListIcon there. But If I put BehaviorIcons and the selector  #Model in it, it works, because the AlphaBlendedIcons resource class implements visualFor: as a sort of bw compat for this unfortunate need.
>>
>> I wish it weren't so, I'll see if I can't figure out an elegant/safe way to lift this restriction.
>>
>> HTH
>>
>> --
>> Travis Griggs
>> Objologist
>> Simplicity is the Ultimate Sophistication -- Leonardo da Vinci
>>
>
> _______________________________________________
> vwnc mailing list
> [hidden email]
> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>
>

_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
Reply | Threaded
Open this post in threaded view
|

More than one menu Re: Toolbar images

Carl Gundel
Thanks Holger, your advice turned out to be the easiest to make work.

-Carl
http://www.libertybasic.com
http://www.runbasic.com

On Jun 9, 2011, at 1:28 PM, Holger Guhl wrote:

> So the method should be sent to your ApplicationModel subclass. I have never went this way but I don't see why it shouldn't work. Just to make sure that the basic assumptions are correct: Place a breakpoint at your resource method (the one returning the picture, must be a class method otherwise it won't work, since #visualFor: asks the app which is the class at that point), then run the ApplicationModel. You can also try the MenuEditor but it might be protected against exceptions. If the breakpoint fires, the problem must be with the graphic. If it doesn't fire, then we must check out why #visualFor:
>
> What's the result of your picture resource method? To have the same behavior as expected for other toolbar icons, you should return an OpaqueImageWithEnablement of size 20x20 px.
> My approach is always a bit different. In general, I extend ToolbarIconLibrary and add the typical resource methods on its class side, something like #myIcon20x20 and #myIcon20x20mask. ToolbarIconLibrary is a good container for that kind of stuff and I can reuse all the caching behavior. Then I use it in the MenuEditor, with class = ToolbarIconLibrary and selector #myIcon.
> Note the resource method name change! ToolbarIconLibrary always appends the suffix 20x20 to the logical name before it accesses its real resource methods.
> Hope that helps...
>
> Holger Guhl
> --
> Senior Consultant * Certified Scrum Master * [hidden email]
> Tel: +49 231 9 75 99 21 * Fax: +49 231 9 75 99 20
> Georg Heeg eK Dortmund
> Handelsregister: Amtsgericht Dortmund  A 12812
>
>
> Am 09.06.2011 18:37, schrieb Carl Gundel:
>> Thanks Travis, but the class I'm specifying is a subclass of ApplicationModel.  That seems to meet the requirement of implementing visualFor:.  Any other ideas?
>>
>> -Carl
>>
>> On Jun 8, 2011, at 2:34 AM, Travis Griggs wrote:
>>
>>> On Jun 7, 2011, at 7:41 PM, Carl Gundel wrote:
>>>
>>>> I'm trying to create a window with a toolbar.  I have one working in Pollock/Widgetry and I'm trying to port.  So this looks straightforward but I can't make it work.
>>>>
>>>> In the menu editor I click on the Details tab for a menu item.  Then I specify a class and selector for getting my image.  I should be able to specify any class and a selector which returns an instance of a subclass of Image, right?  I install the resulting definition on my window.  The toolbar appears, but the image doesn't (it looks like a dot).  I go back to look at the Details tab for that item in the menu, and I see that the class (and sometimes the selector) do not stick.  The image displays fine in an inspector.
>>>>
>>>> I'm quite frustrated.  This sort of thing should be dead simple to do.  Is there a tutorial for this anywhere?
>>>>
>>>> Any help appreciated.  Thanks,
>>> I *think*... I didn't follow this thru the debugger yet, but I think the class has to respond to visualFor:. Where the nominal implementation for that is to simply do a ^self perform: theArgument. IOW, I note that I can't just put Announcer and toolListIcon there. But If I put BehaviorIcons and the selector  #Model in it, it works, because the AlphaBlendedIcons resource class implements visualFor: as a sort of bw compat for this unfortunate need.
>>>
>>> I wish it weren't so, I'll see if I can't figure out an elegant/safe way to lift this restriction.
>>>
>>> HTH
>>>
>>> --
>>> Travis Griggs
>>> Objologist
>>> Simplicity is the Ultimate Sophistication -- Leonardo da Vinci
>>>
>>
>> _______________________________________________
>> vwnc mailing list
>> [hidden email]
>> http://lists.cs.uiuc.edu/mailman/listinfo/vwnc
>>
>>
>


_______________________________________________
vwnc mailing list
[hidden email]
http://lists.cs.uiuc.edu/mailman/listinfo/vwnc