1. Jiri's Widgets Help

Jiri,

I want to display a bitmap file in a window... Using jiri's widgets, how
would I go about doing that?

If not in a window, how about in a frame?

If I'm using widgets.e, when I load a bitmap, do I have to set
all_palette 'n' stuff, or does widgets do that for me?

It's past 1am here. The only reason I'm asking is because I'm going to bed
now. I'll resume my research on the morrow.

Thanks!
ck

new topic     » topic index » view message » categorize

2. Re: Jiri's Widgets Help

Hi, ck,

> I want to display a bitmap file in a window... Using jiri's widgets,
> how would I go about doing that?

> If not in a window, how about in a frame?

You can place your bitmap anywhere you like, in a window or directly
on the screen. But be warned, I have not implemented any sort of
clipping so far. You can use the standard display_image(), or one of
several routines built into the widgets that allow you to merge or xor
your images.

> If I'm using widgets.e, when I load a bitmap, do I have to set
> all_palette 'n' stuff, or does widgets do that for me?

Life is not supposed to be that easy, ck. Palette manipulation is
usually quite tricky, but I believe it can also be fun, unless you are
colorblind as I am. Just remember to reserve the first 16 colors as
system colors, do not touch those, otherwise you will get some funny
colored widgets. There are plenty of tools for color twiddling
available in the archives, just from memory Colin Taylor made a set,
Pete and Mic probably too, possibly several other, including mine.

Do not use all_palette(), use my set_colors(), it's part of the
widgets too. It is much faster and it allows you to selectively modify
any part of the palette, as long as it is a *contiguous* range of
colors.

I would love to tell you to hold your horses, completely reworked,
friendlier version of the widgets is on its way, but I can't. I had a
stupid, dreadful disaster this morning: half asleep I wanted to copy
my working directory on to the floppy to take it to work (for safety I
usually store every thing important on at least two machines), but
instead of typing copy *.* a:\ I typed copy a:\*.*. You guessed it, I
copied an old version from the floppy over the new version. Almost a
week of work up in smoke inside 20 seconds...

jiri

Btw, I think it was also you talking about cards, shuffling. Have a
look at my deal.ex, a short bridge hand dealer. You will find it in my
Euphoria pages. It's nothing much, just a simple illustration of some
clever techniques of card handling, but it has also the best, fastest
shuffle under the sun...;)

new topic     » goto parent     » topic index » view message » categorize

3. Re: Jiri's Widgets Help

jiri

i've been looking into this too - haven't got far yet.
i had a theory, which i hadn't had a chance to test, that if you want the
bmp to be a child of the window, and inherit charcterisitics like moving
when the window moves and closing when the window closes, you should create
a widget bmp with pic.e for example and then add that widget to the window
as a component.
is this correct?
i came up with this when i tried to get the exit flag (exitf = true) to
work in response to a wait_key routine. nothing happened - but when i
splice it to a widget, it works.
i got some widget things to work in response to wait_key, such as show(),
but my theory is that loop() will only recognise tracked widget events, not
ordinary DOS events.

cheers

ps sad to hear of new widgets' demise, but it gives me a chance to keep up
with you.

tacitus

new topic     » goto parent     » topic index » view message » categorize

4. Re: Jiri's Widgets Help

On Tue, 21 Nov 2000 00:35:38 +1300, jiri babor <jbabor at PARADISE.NET.NZ>
wrote:

>Hi, ck,
>
>> I want to display a bitmap file in a window... Using jiri's widgets,
>> how would I go about doing that?
>
>You can place your bitmap anywhere you like, in a window or directly
>on the screen. But be warned, I have not implemented any sort of
>clipping so far. You can use the standard display_image(), or one of
>several routines built into the widgets that allow you to merge or xor
>your images.

I'm wanting to display portions of a playfield map, with appropriate
scrollbars when required to additional portions of the playfield. I was
thinking of putting the playfield map in a window, so the user could custom
size and position it.

>friendlier version of the widgets is on its way, but I can't. I had a
>stupid, dreadful disaster this morning: half asleep I wanted to copy
>my working directory on to the floppy to take it to work (for safety I
>usually store every thing important on at least two machines), but
>instead of typing copy *.* a:\ I typed copy a:\*.*. You guessed it, I
>copied an old version from the floppy over the new version. Almost a
>week of work up in smoke inside 20 seconds...

I feel your pain and I hope you recover quickly...

>Btw, I think it was also you talking about cards, shuffling. Have a
>look at my deal.ex, a short bridge hand dealer. You will find it in my
>Euphoria pages. It's nothing much, just a simple illustration of some
>clever techniques of card handling, but it has also the best, fastest
>shuffle under the sun...;)

I'll have a look!

Thanks!
ck

new topic     » goto parent     » topic index » view message » categorize

5. Re: Jiri's Widgets Help

On 21 Nov 2000, at 0:35, jiri babor wrote:

> I would love to tell you to hold your horses, completely reworked,
> friendlier version of the widgets is on its way, but I can't. I had a
> stupid, dreadful disaster this morning: half asleep I wanted to copy
> my working directory on to the floppy to take it to work (for safety I
> usually store every thing important on at least two machines), but
> instead of typing copy *.* a:\ I typed copy a:\*.*. You guessed it, I
> copied an old version from the floppy over the new version. Almost a
> week of work up in smoke inside 20 seconds...

Jiri, i did that once. Now, i backup the files as needed on a 2nd and 3rd
harddrive (yep, had several hd failures too), and copy the files to the 2nd
puter with a zip drive from the backup files on hd #2, not from the original
files, not from the 3rd hd. I also don't let a running program have access to
a original database file. Computers have made me paranoid as heck about
data and their programs. Why not email the files to yourself at work, Jiri?

Kat,
off to install that LAN finally.....

new topic     » goto parent     » topic index » view message » categorize

6. Re: Jiri's Widgets Help

Kat wrote:

>> I would love to tell you to hold your horses, completely reworked,
>> friendlier version of the widgets is on its way, but I can't. I had
a
>> stupid, dreadful disaster this morning: half asleep I wanted to
copy
>> my working directory on to the floppy to take it to work (for
safety I
>> usually store every thing important on at least two machines), but
>> instead of typing copy *.* a:\ I typed copy a:\*.*. You guessed it,
I
>> copied an old version from the floppy over the new version. Almost
a
>> week of work up in smoke inside 20 seconds...

> Jiri, i did that once. Now, i backup the files as needed on a 2nd
> and 3rd harddrive (yep, had several hd failures too), and copy the
> files to the 2nd puter with a zip drive from the backup files on hd
> #2, not from the original files, not from the 3rd hd.

But, Kat, I haven't got three harddrives. Just one, and that is
getting pretty full now, after I sacrificed a large chunk of it to
accommodate Peanut Linux (I think it will have to go soon, it's cute,
but I have no time or patience to fiddle with it anyway...). Until
quite recently I used my older machine as a back up, and occasionally
I still do, but it's no longer safe, because I had to surrender it,
partly, to my grandchildren to stop them from trashing my newer
machine.

And do not tell me, please, I should buy an additional drive, I know
that. But outside US, the things are not, generally, that simple. New
Zealand is not a third world country, yet, but on average local
hardware prices are more than double of those you enjoy, and our
salaries are less than half of yours. Compute.

While I am on this topic, I must admit, I quite understand what Aku
meant when he equated the price of registered Euphoria with 80 days
food bill. In this light it is truly ridiculous, if not cruel, to
compare the software piracy, a crime construed and prosecuted almost
exclusively for the protection of interests of Bill Gate$ and his ilk,
with rape and murder of innocent children. On the contrary, the
software piracy laws and closely related patent and trademark laws can
be viewed as tools of oppression, devices of the rich to keep the
masses in their right place, in the dark.

> Computers have made me paranoid as heck about data and their
> programs.

I know what you mean, I lost several hard drives in my time, and
funnily enough, the back up services almost invariably tend to fail at
the same time.

> Why not email the files to yourself at work, Jiri?

Good question. I suppose it is quicker to dump them onto a floppy? :)

jiri

new topic     » goto parent     » topic index » view message » categorize

7. Re: Jiri's Widgets Help

Jiri,

> Life is not supposed to be that easy, ck.

But it can be, with all the wonderfully helpful people on this list! (Man,
that's some fine brown-nosin', ain't it?)

Anyway, I've mocked up a simple display system, just for development
purposes, that draws my playfield and the pieces upon it.

> ...use my set_colors()

I've used Mic's BMP Con to convert all my images to a standard palette...
that way, I'm not even having to deal with palette manipulation. In the
future, when development enters the beta-phase, I'm sure I'm going to have
to improve on the graphics a bit, but at that point I'll just hire a
graphics guy (on spec of course). blink

Have you been able to recover your newest widgets?

THANKS,
ck


_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

new topic     » goto parent     » topic index » view message » categorize

8. Re: Jiri's Widgets Help

ck wrote:

>There are many graphics libraries out there... I'm in the earliest of
>development moments and am using widgets.e to help with graphics. I
>noticed there's no BMP-to-screen function with widgets, or am I not a
>Sherlock Holmes?

ck, you have no future as amateur detective: there are three image
transfer routines in widgets. put_image(), xor_image and
merge_image(). put_image() is basically the same as display_image() in
image.e, except for a slightly different form of arguments and it does
not use the superfluous, silly typing.

>If I used Neil (what's Neil2 and when?), would it be faster?

Almost certainly yes. Blitting is always faster then pixel based
routines. Neil also gives you access to much wider selection of screen
resolutions and color depths. Neil2 (son of Neil?) was/is Pete's
attempt to make Neil usable on all three platforms, I think.

>Have you been able to recover your newest widgets?

Almost.

jiri

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu