For Programmers: Free Programming Magazines  


Home > Archive > PerlTk > May 2005 > XPMenu









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author XPMenu
Joeri

2005-05-17, 8:57 pm

Hi,

I've written an XP-style Menu in pure perl using Tk::Cloth.

If anyone is interested in it, I will try and post it on CPAN.

How exactly do I do that?

Cheers,

J
Ala Qumsieh

2005-05-17, 8:57 pm

Joeri wrote:
> Hi,
>
> I've written an XP-style Menu in pure perl using Tk::Cloth.


What's an XP-style menu?

> If anyone is interested in it, I will try and post it on CPAN.
>
> How exactly do I do that?


perldoc perlnewmod

--Ala
Jack D

2005-05-17, 8:57 pm


"Ala Qumsieh" <notvalid@email.com> wrote in message
news:86tie.839$kj7.457@newssvr21.news.prodigy.com...
> Joeri wrote:
>
> What's an XP-style menu?


I have the same question?

How about posting a link to a screenshot so we can see what your talking
about.

Jack


MrJ

2005-05-18, 8:57 am


Jack D schreef:
> "Ala Qumsieh" <notvalid@email.com> wrote in message
> news:86tie.839$kj7.457@newssvr21.news.prodigy.com...
>
> I have the same question?
>
> How about posting a link to a screenshot so we can see what your

talking
> about.


A screenshot is here:

http://www.freewebs.com/joerivdv/xpmenu.jpg

There are still a few minor problems, so it may still be a couple of
days
before I put this on CPAN. The main thing is then for you more
experienced
Tk gurus to look at the code and see where improvements might be done
and/or where there are still bugs to fix.

J

Ala Qumsieh

2005-05-19, 3:59 am

MrJ wrote:

> A screenshot is here:
>
> http://www.freewebs.com/joerivdv/xpmenu.jpg


Looks good, but I still don't get it.
Besides the white background, which you can set like this:

$mw->optionAdd('*Menu.background' => 'white');

how is this different from a regular Tk::Menu?

--Ala
Joeri

2005-05-19, 8:56 am

Ala Qumsieh wrote:
> Looks good, but I still don't get it.
> Besides the white background, which you can set like this:
>
> $mw->optionAdd('*Menu.background' => 'white');
>
> how is this different from a regular Tk::Menu?


Well, for starters, the ease with which you can
add png images to your menu entries. Have you ever
tried that with Tk::Menu? Can you try to put up a
screenshot of a regular Tk::Menu which looks roughly
the same as the one I put up with Tk::XPMenu?
Just out of curiousity...?

Secondly, the way it draws a "transparent" rectangle around
a highlighted menu-entry.

The checkbox is different.

All the colors can be set according to your own taste.

In all, I didn't come up with the whole concept,
I just made a perl version of the menubar as it is
used in Office XP, VS 2003 etc.

I am also working on an XPContextMenu, which is
a right-click menu that you can add to your widgets
and looks the same as the XPMenu.

And a bit further down the road there will also be
a Office 2003-styled Menu, or VS 2005-styled Menu
if you want, which I am working on based on Tk::Zinc.

--Joeri
Ala Qumsieh

2005-05-19, 3:58 pm

Joeri wrote:

> Well, for starters, the ease with which you can
> add png images to your menu entries. Have you ever
> tried that with Tk::Menu?


Admittedly, I haven't.

> Can you try to put up a
> screenshot of a regular Tk::Menu which looks roughly
> the same as the one I put up with Tk::XPMenu?
> Just out of curiousity...?


On Win32, a Tk::Menu does look like a regular Win32 menu. From your
screenshot, I see that you're developing this on a *nix platform. That's
good. I think *nix style menus are ugly by default. I usually try to
make them look nicer by doing the following:

$toplevel->optionAdd('*Menu.background' => 'white');
$toplevel->optionAdd('*Menu.borderWidth' => 1);
$toplevel->optionAdd('*Menu.activeBorderWidth' => 0);
$toplevel->optionAdd('*Menu.activeBackground' => 'lightsteelblue');
$toplevel->optionAdd('*Menu.Font' => 'helvetica 12');
$toplevel->optionAdd('*Menu.selectColor' => 'grey25');

which goes a long way, but there's lots of room for improvement. Also,
while I don't prefer this look, you can do:

$toplevel->optionAdd('*Menu.relief' => 'solid');

to give the menu similar borders to Win32 menus.

> Secondly, the way it draws a "transparent" rectangle around
> a highlighted menu-entry.


You can achieve a similar effect using the optionAdd() commands above,
although I don't know of a way to set the outline of the rectangle to a
solid color.

> The checkbox is different.


Yes. The default checkbox is ugly. Yours is much nicer.

All in all, I think it's a good module to have.

--Ala
Joeri

2005-05-19, 3:58 pm

Ala Qumsieh wrote:
> On Win32, a Tk::Menu does look like a regular Win32 menu. From your
> screenshot, I see that you're developing this on a *nix platform.


Actually, this is on WinXP, but I bore easily, so I tend to change
the theme every now and again. I understand the confusion, because
I'm using a Gnome-theme right now. I haven't tested it on *nix systems,
but it's pure perl, so I think it should run fine on *nix as well.

> That's good. I think *nix style menus are ugly by default. I usually try to
> make them look nicer by doing the following:
>
> $toplevel->optionAdd('*Menu.background' => 'white');
> $toplevel->optionAdd('*Menu.borderWidth' => 1);
> $toplevel->optionAdd('*Menu.activeBorderWidth' => 0);
> $toplevel->optionAdd('*Menu.activeBackground' => 'lightsteelblue');
> $toplevel->optionAdd('*Menu.Font' => 'helvetica 12');
> $toplevel->optionAdd('*Menu.selectColor' => 'grey25');
>
> which goes a long way, but there's lots of room for improvement. Also,
> while I don't prefer this look, you can do:
>
> $toplevel->optionAdd('*Menu.relief' => 'solid');
>
> to give the menu similar borders to Win32 menus.
>
>
>
> You can achieve a similar effect using the optionAdd() commands above,
> although I don't know of a way to set the outline of the rectangle to a
> solid color.


There is no way to get a solid outline rectangle around a highlighted
menuitem with the default Win32 Menu. That's actually what got me
started on this module, since I had tried every optionAdd I could think of.

> Yes. The default checkbox is ugly. Yours is much nicer.


I'll pass your compliment on to the guys at MS. :-)

> All in all, I think it's a good module to have.


Just the little encouragement I was looking for.

Hope to be able to post a beta version soon.
Thanks for your time and effort. I will be needing more of it when I
actually get this module public...

Joeri
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com