Hello, folks--

First post, sort of (I made an attempt to learn Factor early last year,
and didn't get very far, but now I'm trying again--maybe this time I'll
reach "escape velocity").

As a learning exercise (and maybe an excuse to have a game on my laptop,
which thus far has been free of such distractions ;-) I am trying to
implement the classic Minesweeper game. So, for each cell in the grid, I
need a gadget with the following characteristics:

 * At least 2 visual states, clicked and un-clicked, typically shown
 with a raised or flat appearance

 * Left-click and right-click event handlers

 * The ability to display an icon or a character, and to change the icon
 at runtime

It doesn't appear that there is any existing gadget that has all these
characteristics, and I'm not sure what would be the best one to
customize, but in other GUI toolkits I've worked with, button widgets
work pretty well for this kind of thing, so I thought I would start by
taking the border-button gadget and giving it a raised appearance. I
created 3 TIFF images the same sizes as those used by the plain tile pen
of the button pen of the border-button gadget. Then I created a new
tile-pen using those images and new BG and FG colors, and assigned them
to the plain slot of the button-pen.

The result does indeed look different from the default, but it also
looks different from what I expected, and quite ugly. I thought I would
keep looking through the docs for an answer, but I'm just getting lost.
I can post my code if people want to see it, but I think the real
problem is not really a programming error, but rather that I don't
understand how the various images and colors are used in constructing
the button.

So can someone explain how border-buttons are rendered (noting that,
while I am reasonably familiar with 2D graphics terminology, I do *not*
understand OpenGL [I've tried to learn it, failed, maybe try again
someday, but not today, please])? Or perhaps provide a working example
of gadget customization?

Thanks for any & all info!

-- 
Matt Gushee
m...@gushee.net

------------------------------------------------------------------------------
Throughout its 18-year history, RSA Conference consistently attracts the
world's best and brightest in the field, creating opportunities for Conference
attendees to learn about information security's most important issues through
interactions with peers, luminaries and emerging and established companies.
http://p.sf.net/sfu/rsaconf-dev2dev
_______________________________________________
Factor-talk mailing list
Factor-talk@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/factor-talk

Reply via email to