Main index > Usage problems > window transparency and submenu bug? [SOLVED]

By ZeroDivide (Desklet Author), on Fri Mar 11 03:28:46 2005, last edited on Mon Mar 14 02:03:04 2005: window transparency and submenu bug? [SOLVED].

Transparent windows seem to get messed up when using submenus.

I'm not sure if its just my system, but heres a modified version of bumpmap.py that should show what im talking about.

sorry if this wasn't the right forum to post this in.

Code:

#! /usr/bin/env python
"""
bumpmap.py - S.Fourmanoit <syfou@users.sourceforge.net>, 2005

Short, but more involved adesklets test script. It demonstrates
Imlib2 dynamic filtering capabilities and how you can modify
a background image dynamically.

Note: I strongly advise against using an effect that CPU intensive
in real life desklets - remember adesklets was made to be 'light'.

To try it:
        - Install adesklets with python support enabled (default)
        - Run python bumpmap.py from this directory.
"""
import adesklets

class My_Events(adesklets.Events_handler):
    x = 100     # Initial spot position
    y = 100
    
    def __init__(self):
        adesklets.Events_handler.__init__(self)
        
    def __del__(self):
        adesklets.Events_handler.__del__(self)
        
    def ready(self):
        adesklets.window_resize(200,200)
        adesklets.window_set_background_image(adesklets.clone_image())
        adesklets.window_set_transparency(True)
        #adesklets.window_reset(adesklets.WINDOW_MANAGED)

        # Now, let us set a 'Test!' text on foreground image:
        # we will not modify it any more
        #
        adesklets.context_set_image(0)
        adesklets.context_set_font(adesklets.load_font('Vera/60'))
        adesklets.context_set_color(255,0,0,200)
        adesklets.context_set_direction(adesklets.TEXT_TO_ANGLE)
        adesklets.context_set_angle(45)
        adesklets.text_draw(20,0,'Test!')
        adesklets.free_font(0)
        
        adesklets.menu_add_separator()
        adesklets.menu_add_item('README')       
        adesklets.menu_add_submenu('Configure')
        adesklets.menu_add_item('Edit_Config')
        adesklets.menu_add_item('Reload_Config')
        adesklets.menu_add_submenu('BorderToggle')
        adesklets.menu_add_item('Left')
        adesklets.menu_add_item('Right')
        adesklets.menu_add_item('Top')
        adesklets.menu_add_item('Bottom')
        adesklets.menu_end_submenu()
        adesklets.menu_end_submenu()
        
        adesklets.window_show()
        self._display()
       
    def background_grab(self,delayed):
        self._display()
        
    """
    def motion_notify(self, delayed, x, y):
        if not delayed:
            self.x = x
            self.y = y
            self._display()
    """
        
    def _display(self):
        """
        The  drawing method. Please remember this nomenclature:
        
          image 0: foreground image, left untouched here
          image 1: original background, automatically kept up to date
                   by adesklets - hence we keep ourselves from modify it.
          image 2: Our displayed background - set My_Events::ready() for
                   initialisation details
          image 3: transient image on which we operate the
                   current transformation, before updating image 2
                   and destroying it.
        """
        adesklets.context_set_image(1)
        adesklets.context_set_image(adesklets.clone_image())
        adesklets.apply_filter("bump_map_point(x=%d,y=%d);" % (self.x, self.y))
        adesklets.context_set_image(2)
        adesklets.blend_image_onto_image(3,0,0,0,200,200,0,0,200,200)
        adesklets.free_image(3)
        
My_Events().pause()

By syfou (Core Developer & Desklet Author), on Fri Mar 11 04:54:37 2005.

ZeroDivide wrote:


Transparent windows seem to get messed up when using submenus.I'm not sure if its just my system, but heres a modified version of bumpmap.py that should show what im talking about.

Thanks for taking the time to produce it. This is not your system: this is my mistake - I hardcoded something I shouldn't have, this was a three lines correction (applies not on all transparent windows, but on those with a user-defined background). If you need it badly, here is a patch against adesklets 0.4.4 (contains many other things - in fact it updates the tree to current bitkeeper snapshot).

This will be included anyway in the next revision release.

ZeroDivide wrote:


sorry if this wasn't the right forum to post this in.


There is not really any place on the forum for this... This kind of issues should generally be posted on the adesklets-devel mailing list. But that's not really a concern for now. Regards,

By ZeroDivide (Desklet Author), on Fri Mar 11 13:14:30 2005.

Thanks for the patch.
Adesklets wouldn't compile with the whole patch applied so I ripped out everything but the menu part and its up and running fine.

By syfou (Core Developer & Desklet Author), on Fri Mar 11 13:29:28 2005.

Did you run autoreconf? :-)
Well, as long as it works!

By ZeroDivide (Desklet Author), on Fri Mar 11 13:43:33 2005.

I guess that would have been the smart thing to do.
Especially after having already read it in the diff.. :oops:
anyway.. it compiles fine now with the whole patch applied


adesklets is proud to be hosted on:

SourceForge.net Logo

Back to adesklets.sf.net.