Re[3]: [UI] chang tab font in a flap ?

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

Re[3]: [UI] chang tab font in a flap ?

Herbert König
Hello Tony,

HK> Trying to help you how to fish, cause in the time I have I didn't
HK> manage to do it myself.
HK> I'll try later to make it work and report here.
I'll write up my findings as I go along: (in the end there is a
solution but I think most important is you see methods to find out
something.)

Browsing IconicButton (which is what the Flaps contain) it seems to me
that the label is not a Text or a TextMorph so it doesn't have a font
you can change.

I guess from looking at the code that an Iconic button uses a
StringMorph to get the Form of its label and then adds that graphic to
its own graphic.

So the task seems twofold:
1- Find out which font is used for building the labels of the icons in
the flaps
2- Find out how to rebuild the flaps.

The second task was easier. I used the method finder to look for
methods with "flaps" in their name.

addStandardFlaps looked promising but the comment to the method said
that the method itself does not display the flaps. But browsing for
senders of addStandardFlaps revealed the class side method
reinstateDefaultFlaps of Flaps class.

So Flaps reinstateDefaultFlaps in a Workspace removes all flaps and
rebuilds them. Give it some time when you run it the first time.

So next I copied the Preferences class method chooseFlapsFont to a
workspace, changed every self to Preferences and made it set the
button font. This looked like:

Preferences chooseFontWithPrompt: 'Choose a flapsIcons font' translated
andSendTo: Preferences withSelector: #setButtonFontTo:
highlight: Preferences standardButtonFont

But rebuilding the flaps with

Flaps reinstateDefaultFlaps

still gave me the old fonts.

So I think we need to solve a third problem, that's to regenerate the
IconicButtons in the Flaps and maybe step 2 from above isn't needed at
all.

After I followed that false trail for a while I found in IconicButton

initializeWithThumbnail:withLabel:andColor:andSend:to:

and in this method I saw that IconicButton uses standardEtoysFont
which can be set from the world menu as described in earlier mails.

That finally did it. I had an interesting time finding it out.

To sum it up:
In the world menu set the etoys font to what you like in your Flaps.
Then in a Workspace run:
Flaps reinstateDefaultFlaps

Then reset the etoys font to what you like for etoys.

The first time you use the new Flaps you probably have to pull them
out manually to accommodate the wider font.

Cheers

Herbert                            mailto:[hidden email]


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: Re[3]: [UI] chang tab font in a flap ?

work open
Hello Herbert,

It's so kind of you ! I am newly to Squeak, and want to try Samlltalk, I feel friendly and helpful in Squeak community. Vielen Dank !

tonyliu.

2007/11/10, Herbert König < [hidden email]>:
Hello Tony,

HK> Trying to help you how to fish, cause in the time I have I didn't
HK> manage to do it myself.
HK> I'll try later to make it work and report here.
I'll write up my findings as I go along: (in the end there is a
solution but I think most important is you see methods to find out
something.)

Browsing IconicButton (which is what the Flaps contain) it seems to me
that the label is not a Text or a TextMorph so it doesn't have a font
you can change.

I guess from looking at the code that an Iconic button uses a
StringMorph to get the Form of its label and then adds that graphic to
its own graphic.

So the task seems twofold:
1- Find out which font is used for building the labels of the icons in
the flaps
2- Find out how to rebuild the flaps.

The second task was easier. I used the method finder to look for
methods with "flaps" in their name.

addStandardFlaps looked promising but the comment to the method said
that the method itself does not display the flaps. But browsing for
senders of addStandardFlaps revealed the class side method
reinstateDefaultFlaps of Flaps class.

So Flaps reinstateDefaultFlaps in a Workspace removes all flaps and
rebuilds them. Give it some time when you run it the first time.

So next I copied the Preferences class method chooseFlapsFont to a
workspace, changed every self to Preferences and made it set the
button font. This looked like:

Preferences chooseFontWithPrompt: 'Choose a flapsIcons font' translated
andSendTo: Preferences withSelector: #setButtonFontTo:
highlight: Preferences standardButtonFont

But rebuilding the flaps with

Flaps reinstateDefaultFlaps

still gave me the old fonts.

So I think we need to solve a third problem, that's to regenerate the
IconicButtons in the Flaps and maybe step 2 from above isn't needed at
all.

After I followed that false trail for a while I found in IconicButton

initializeWithThumbnail:withLabel:andColor:andSend:to:

and in this method I saw that IconicButton uses standardEtoysFont
which can be set from the world menu as described in earlier mails.

That finally did it. I had an interesting time finding it out.

To sum it up:
In the world menu set the etoys font to what you like in your Flaps.
Then in a Workspace run:
Flaps reinstateDefaultFlaps

Then reset the etoys font to what you like for etoys.

The first time you use the new Flaps you probably have to pull them
out manually to accommodate the wider font.

Cheers

Herbert                            mailto:[hidden email]


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners


_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

simple server?

Don McLane
I'm trying to learn to write network objects in squeak.  I read the
chapter "Networking Squeak" by Parsia, Kerimbaev, and Spoon, from Mark
Guzdials book.  But I wanted to start at a more basic level.

My first attempt is to write the simplest possible server.  This server
should wait for a connection, then print the first line sent to it,
finally close.  Unfortunately, it gets a "primitive failed" error.  I
got the same result on XP and Vista.  Here's my code:

| serverSocket connectionSocket |
Socket initializeNetwork.
serverSocket := Socket newTCP.
serverSocket listenOn: 8080.
connectionSocket := serverSocket accept.
Transcript show: (connectionSocket upToAll: String crlf).
connectionSocket close.
serverSocket close.

I found some old code for the PWS and looked around.  It makes a
ServerSocket object, but I can't find that class in my image (3.9-7067).

If I do get a server socket to return a connection socket, is there a
way to convert that socket into a SocketStream?

Can anyone get me un-stuck?  I've been trying to get past this for a
couple evenings now.

Thanks much,
Don

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: simple server?

Michael van der Gulik-3
Don McLane wrote:

> I'm trying to learn to write network objects in squeak.  I read the
> chapter "Networking Squeak" by Parsia, Kerimbaev, and Spoon, from Mark
> Guzdials book.  But I wanted to start at a more basic level.
>
> My first attempt is to write the simplest possible server.  This server
> should wait for a connection, then print the first line sent to it,
> finally close.  Unfortunately, it gets a "primitive failed" error.  I
> got the same result on XP and Vista.  Here's my code:
>
> | serverSocket connectionSocket |
> Socket initializeNetwork.
> serverSocket := Socket newTCP.
> serverSocket listenOn: 8080.
> connectionSocket := serverSocket accept.
> Transcript show: (connectionSocket upToAll: String crlf).
> connectionSocket close.
> serverSocket close.
>
> I found some old code for the PWS and looked around.  It makes a
> ServerSocket object, but I can't find that class in my image (3.9-7067).
>
> If I do get a server socket to return a connection socket, is there a
> way to convert that socket into a SocketStream?
>
> Can anyone get me un-stuck?  I've been trying to get past this for a
> couple evenings now.
>  
Hi Don.

You'll be wanting to do:
ss := SocketStream on: serverSocket.

I would recommend looking at a simple network service. One I can think
of is REPLServer, which is a telnet server, but there may be simpler
ones out there for e.g. HTTP.

Also, if you want faster help, I recommend joining the #squeak IRC channel.

Michael.

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: simple server?

Don McLane
Thanks Michael.

My problem may have become immediately obvious when I tried to load
REPLServer.  I need TCPService.  But where do I get that?  It's not on
SqueakMap.  Google isn't helpful.

Don

p.s. I'm not IRC literate yet, but I'll look into that next.

Michael van der Gulik wrote:

> Don McLane wrote:
>  
>> I'm trying to learn to write network objects in squeak.  I read the
>> chapter "Networking Squeak" by Parsia, Kerimbaev, and Spoon, from Mark
>> Guzdials book.  But I wanted to start at a more basic level.
>>
>> My first attempt is to write the simplest possible server.  This server
>> should wait for a connection, then print the first line sent to it,
>> finally close.  Unfortunately, it gets a "primitive failed" error.  I
>> got the same result on XP and Vista.  Here's my code:
>>
>> | serverSocket connectionSocket |
>> Socket initializeNetwork.
>> serverSocket := Socket newTCP.
>> serverSocket listenOn: 8080.
>> connectionSocket := serverSocket accept.
>> Transcript show: (connectionSocket upToAll: String crlf).
>> connectionSocket close.
>> serverSocket close.
>>
>> I found some old code for the PWS and looked around.  It makes a
>> ServerSocket object, but I can't find that class in my image (3.9-7067).
>>
>> If I do get a server socket to return a connection socket, is there a
>> way to convert that socket into a SocketStream?
>>
>> Can anyone get me un-stuck?  I've been trying to get past this for a
>> couple evenings now.
>>  
>>    
> Hi Don.
>
> You'll be wanting to do:
> ss := SocketStream on: serverSocket.
>
> I would recommend looking at a simple network service. One I can think
> of is REPLServer, which is a telnet server, but there may be simpler
> ones out there for e.g. HTTP.
>
> Also, if you want faster help, I recommend joining the #squeak IRC channel.
>
> Michael.
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>  

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: simple server?

NorbertHartl

On Sun, 2007-11-11 at 21:32 -0800, Don McLane wrote:
> Thanks Michael.
>
> My problem may have become immediately obvious when I tried to load
> REPLServer.  I need TCPService.  But where do I get that?  It's not on
> SqueakMap.  Google isn't helpful.
>
You can find it on squeakmap. It is called KomServices.

Norbert

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: simple server?

Don McLane
Norbert,

Thanks, that was the key information that I needed!

Don

Norbert Hartl wrote:

> On Sun, 2007-11-11 at 21:32 -0800, Don McLane wrote:
>  
>> Thanks Michael.
>>
>> My problem may have become immediately obvious when I tried to load
>> REPLServer.  I need TCPService.  But where do I get that?  It's not on
>> SqueakMap.  Google isn't helpful.
>>
>>    
> You can find it on squeakmap. It is called KomServices.
>
> Norbert
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>  

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners
Reply | Threaded
Open this post in threaded view
|

Re: simple server?

Michael van der Gulik-3
In reply to this post by Don McLane
Yes; sorry about that. REPLServer has dependencies on other packages.

If you use the UniversesBrowser from Squeak 3.10, it will load
dependencies automatically for you.

Michael.

Don McLane wrote:

> Thanks Michael.
>
> My problem may have become immediately obvious when I tried to load
> REPLServer.  I need TCPService.  But where do I get that?  It's not on
> SqueakMap.  Google isn't helpful.
>
> Don
>
> p.s. I'm not IRC literate yet, but I'll look into that next.
>
> Michael van der Gulik wrote:
>  
>> Don McLane wrote:
>>  
>>    
>>> I'm trying to learn to write network objects in squeak.  I read the
>>> chapter "Networking Squeak" by Parsia, Kerimbaev, and Spoon, from Mark
>>> Guzdials book.  But I wanted to start at a more basic level.
>>>
>>> My first attempt is to write the simplest possible server.  This server
>>> should wait for a connection, then print the first line sent to it,
>>> finally close.  Unfortunately, it gets a "primitive failed" error.  I
>>> got the same result on XP and Vista.  Here's my code:
>>>
>>> | serverSocket connectionSocket |
>>> Socket initializeNetwork.
>>> serverSocket := Socket newTCP.
>>> serverSocket listenOn: 8080.
>>> connectionSocket := serverSocket accept.
>>> Transcript show: (connectionSocket upToAll: String crlf).
>>> connectionSocket close.
>>> serverSocket close.
>>>
>>> I found some old code for the PWS and looked around.  It makes a
>>> ServerSocket object, but I can't find that class in my image (3.9-7067).
>>>
>>> If I do get a server socket to return a connection socket, is there a
>>> way to convert that socket into a SocketStream?
>>>
>>> Can anyone get me un-stuck?  I've been trying to get past this for a
>>> couple evenings now.
>>>  
>>>    
>>>      
>> Hi Don.
>>
>> You'll be wanting to do:
>> ss := SocketStream on: serverSocket.
>>
>> I would recommend looking at a simple network service. One I can think
>> of is REPLServer, which is a telnet server, but there may be simpler
>> ones out there for e.g. HTTP.
>>
>> Also, if you want faster help, I recommend joining the #squeak IRC channel.
>>
>> Michael.
>>
>> _______________________________________________
>> Beginners mailing list
>> [hidden email]
>> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>>  
>>    
>
> _______________________________________________
> Beginners mailing list
> [hidden email]
> http://lists.squeakfoundation.org/mailman/listinfo/beginners
>
>  

_______________________________________________
Beginners mailing list
[hidden email]
http://lists.squeakfoundation.org/mailman/listinfo/beginners