[Factor-talk] A few questions about the UI vocabulary

2012-11-17 Thread Samuel Proulx
Hi,

It's my first time here, so I hope I'm doing it right.

I'm learning Factor and I'm currently playing with the UI vocabulary.
Although, there are a few things I can't figure out with it. I've already
looked in the Browser, but I can't find what I'm looking for.

My questions are the following :
1. How can I display a full text with automatic line breaks ? The only
thing I found to be able to display text is labels, but I'm not sure it is
the way to go...
2. How can I display an image and how do I make it resize and keep its
proportions ? I tried to use icons in tracks, but, again, I don't think
it's the way to go.
3. I do I make a gradient? I've managed to fill a gadget with a solid
color, but I can't find out how to make a gradient.  in
ui.pens.gradient takes "colors" as parameter but how do I do I give it the
colors ? An array of solid colors ?

Thanks in advance,
Samuel
--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk


Re: [Factor-talk] A few questions about the UI vocabulary

2012-11-17 Thread Alexander J. Vondrak
I've never used the ui vocabs, so grain of salt, but

1. If you have a particular width in mind,

  IN: scratchpad USE: wrap.strings
  IN: scratchpad "a long line" 5 wrap-string print
  a
  long
  line

Thus, use `wrap-string`, and build a `` with the result.  E.g.,

  "a long line" 5 wrap-string  gadget.

I'm not sure if there's a way to do it dynamically, though.

2. There's the images.viewer vocabulary, but it doesn't appear to scale images
with the window size...worth a look, anyway: 
http://docs.factorcode.org/content/vocab-images.viewer.html

3.  `\ gradient help` explains that the `colors` slot is a sequence of `color`
instances.  E.g., try the following at the listener:

  USING: ui.gadgets ui.gadgets.panes colors.constants ui.pens.gradient ;
  
  {
  COLOR: white
  COLOR: black
  }  >>interior
  { 100 100 } >>dim
  horizontal >>orientation
  gadget.

Hope that helps,
--Alex Vondrak

From: Samuel Proulx [proulxsam...@gmail.com]
Sent: Saturday, November 17, 2012 8:20 AM
To: factor-talk@lists.sourceforge.net
Subject: [Factor-talk] A few questions about the UI vocabulary

Hi,

It's my first time here, so I hope I'm doing it right.

I'm learning Factor and I'm currently playing with the UI vocabulary. Although, 
there are a few things I can't figure out with it. I've already looked in the 
Browser, but I can't find what I'm looking for.

My questions are the following :
1. How can I display a full text with automatic line breaks ? The only thing I 
found to be able to display text is labels, but I'm not sure it is the way to 
go...
2. How can I display an image and how do I make it resize and keep its 
proportions ? I tried to use icons in tracks, but, again, I don't think it's 
the way to go.
3. I do I make a gradient? I've managed to fill a gadget with a solid color, 
but I can't find out how to make a gradient.  in ui.pens.gradient 
takes "colors" as parameter but how do I do I give it the colors ? An array of 
solid colors ?

Thanks in advance,
Samuel

--
Monitor your physical, virtual and cloud infrastructure from a single
web console. Get in-depth insight into apps, servers, databases, vmware,
SAP, cloud infrastructure, etc. Download 30-day Free Trial.
Pricing starts from $795 for 25 servers or applications!
http://p.sf.net/sfu/zoho_dev2dev_nov
___
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk