MenuBar image sizes

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

MenuBar image sizes

Brennan Williams
I use MenuBar from enthought.traits.ui.menu in my Traits based app...

which I set up as follows....

    menubar = MenuBar(
    Menu(
            Action(name='Project',action='file_new_project'),
            ....
    )

and ....

    new_project_action = Action( name='New
Project',action='file_new_project',
                          image = ImageResource( "images/project",
                                     search_path=[IMAGE_LOCATION]))

My project.png is 32x32 but is displayed as 16x16.

I forget whether this can be overridden to keep the image size at its
original 32x32 or to specify an image size.

 
Regards

Brennan



_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: MenuBar image sizes

Robert Kern
On Thu, Feb 11, 2010 at 15:26, Brennan Williams
<[hidden email]> wrote:

> I use MenuBar from enthought.traits.ui.menu in my Traits based app...
>
> which I set up as follows....
>
>    menubar = MenuBar(
>    Menu(
>            Action(name='Project',action='file_new_project'),
>            ....
>    )
>
> and ....
>
>    new_project_action = Action( name='New
> Project',action='file_new_project',
>                          image = ImageResource( "images/project",
>                                     search_path=[IMAGE_LOCATION]))
>
> My project.png is 32x32 but is displayed as 16x16.
>
> I forget whether this can be overridden to keep the image size at its
> original 32x32 or to specify an image size.

I'm pretty sure this is up to the windowing system, not us.

--
Robert Kern

"I have come to believe that the whole world is an enigma, a harmless
enigma that is made terrible by our own mad attempt to interpret it as
though it had an underlying truth."
  -- Umberto Eco
_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: MenuBar image sizes

Brennan Williams
In reply to this post by Brennan Williams
Ugh, I need a better night's sleep.

I mean to say ToolBar, not MenuBar...

and then I realised that I asked this same question a while back and
didn't implement the answer/change

I should be using...

toolbar=ToolBar(Action(...),Action(...),image_size=(32,32))

Brennan


Brennan Williams wrote:

> I use MenuBar from enthought.traits.ui.menu in my Traits based app...
>
> which I set up as follows....
>
>     menubar = MenuBar(
>     Menu(
>             Action(name='Project',action='file_new_project'),
>             ....
>     )
>
> and ....
>
>     new_project_action = Action( name='New
> Project',action='file_new_project',
>                           image = ImageResource( "images/project",
>                                      search_path=[IMAGE_LOCATION]))
>
> My project.png is 32x32 but is displayed as 16x16.
>
> I forget whether this can be overridden to keep the image size at its
> original 32x32 or to specify an image size.
>
>  
> Regards
>
> Brennan
>
>
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>
>  


_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev
Reply | Threaded
Open this post in threaded view
|

Re: MenuBar image sizes

bryce hendrix-2
On 02/11/2010 03:31 PM, Brennan Williams wrote:

> Ugh, I need a better night's sleep.
>
> I mean to say ToolBar, not MenuBar...
>
> and then I realised that I asked this same question a while back and
> didn't implement the answer/change
>
> I should be using...
>
> toolbar=ToolBar(Action(...),Action(...),image_size=(32,32))
>
>    

Or, as I recommend, make a view containing SVGs and SVGButtonEditor's.
They will usually look nicer (depending on gradients and filters), the
layout is better and icon sizes are changeable at runtime.

Here is an old blog post with a simple example

http://blog.enthought.com/?p=89

Bryce

> Brennan
>
>
> Brennan Williams wrote:
>    
>> I use MenuBar from enthought.traits.ui.menu in my Traits based app...
>>
>> which I set up as follows....
>>
>>      menubar = MenuBar(
>>      Menu(
>>              Action(name='Project',action='file_new_project'),
>>              ....
>>      )
>>
>> and ....
>>
>>      new_project_action = Action( name='New
>> Project',action='file_new_project',
>>                            image = ImageResource( "images/project",
>>                                       search_path=[IMAGE_LOCATION]))
>>
>> My project.png is 32x32 but is displayed as 16x16.
>>
>> I forget whether this can be overridden to keep the image size at its
>> original 32x32 or to specify an image size.
>>
>>
>> Regards
>>
>> Brennan
>>
>>
>>
>> _______________________________________________
>> Enthought-Dev mailing list
>> [hidden email]
>> https://mail.enthought.com/mailman/listinfo/enthought-dev
>>
>>
>>      
>
> _______________________________________________
> Enthought-Dev mailing list
> [hidden email]
> https://mail.enthought.com/mailman/listinfo/enthought-dev
>    

_______________________________________________
Enthought-Dev mailing list
[hidden email]
https://mail.enthought.com/mailman/listinfo/enthought-dev