Hm. Try to do the following:
mymenudrawericon = widget({ type = "imagebox" })
mymenudrawericon.image = image(beautiful.widget_menu)
-- ...
mymenudrawericon:add_signal("mouse::enter", function ()
mymenudirect:show()
end)
-- Comment it out
--mymenudrawericon:add_signal("mouse::leave", function ()
-- mymenudirect:hide()
--end)
-- Hook function to execute when a new client appears.
client.add_signal("manage", function (c, startup)
-- Sets hook for any particular client @c
c:add_signal("mouse::enter", function(x)
mymenudirect:hide()
end)
end)
I can't test it now, but hope it will work.
> Perhaps the explanation is in the way you built your menu :
>> mymainmenu = myrc.mainmenu.build() -- My local menu builder
>> -- ...
No, myrc.mainmenu.build() just detects GUI apps and calls common
awful.menu() on them
2010/4/8 Duflot Jean-Luc <[email protected]>:
> Hi,
> Thanks for your answer.
>
> I am sorry, I am not very skillful neither in programming, neither in lua...
> But I am trying to improve my desktop.
>
> I have done this :
>
> --**********************************
> mymenudrawericon = widget({ type = "imagebox" })
> mymenudrawericon.image = image(beautiful.widget_menu)
> -- ...
> mymenudrawericon:add_signal("mouse::enter", function ()
> mymenudirect:show()
> end)
> mymenudrawericon:add_signal("mouse::leave", function ()
> mymenudirect:hide()
> end)
>
> -- the list of applications that I want to have a direct access
>
> mymenudirect = awful.menu({ items = { {"digikam", digikam,
> beautiful.digikam_icon },
> { "grisbi", grisbi,
> beautiful.grisbi_icon },
> { "iceweasel", iceweasel,
> beautiful.iceweasel_icon },
> { "k3b", k3b, beautiful.k3b_icon },
> { "kate", kate, beautiful.kate_icon },
> { "kateroot", kateroot },
> { "klavaro", klavaro,
> beautiful.klavaro_icon },
> { "konqueror", konqueror,
> beautiful.konqueror_icon },
> { "konquerorroot", konqueroroot },
> { "kpilot", kpilot,
> beautiful.kpilot_icon },
> { "openoffice", ooffice,
> beautiful.ooffice_icon },
> { "roxterm", roxterm,
> beautiful.roxterm_icon },
> { "roxtermroot", roxtermroot },
> { "synaptic", synaptic,
> beautiful.synaptic_icon },
> { "usermount", usermountroot },
> { "thunderbird", thunderbird,
> beautiful.thunderbird_icon },
> }
> })
> --**********************************
>
> I did not use the lines
>> mymountbox = widget({ type = "textbox", align="right" }) -- Some widget
>> -- ...
> because I don't see what to do with that. I prefered an icon, so an
> "imagebox" type
>
>
> But there is a problem with the code above :
> If I have the lines for hiding, when the mouse leaves the icon, the menu
> disappears.
> If I have not them, the menu is still displayed after the mouse has gone
> above, and disappears only when I click on an application.
>
> Could you help me one more time ?
>
> Perhaps the explanation is in the way you built your menu :
>> mymainmenu = myrc.mainmenu.build() -- My local menu builder
>> -- ...
>
> If that could help, could you send me your menu or a part of it ?
>
> Thanks in advance,
>
> Jean-Luc
>
>
>
> Le 01/04/2010 20:04, Sergey Mironov a écrit :
>>
>> Hi!
>> I checked following code:
>>
>> mymainmenu = myrc.mainmenu.build() -- My local menu builder
>> -- ...
>> mymountbox = widget({ type = "textbox", align="right" }) -- Some widget
>> -- ...
>> mymountbox:add_signal("mouse::leave", function ()
>> mymainmenu:hide()
>> end)
>> mymountbox:add_signal("mouse::enter", function ()
>> mymainmenu:show()
>> end)
>>
>> it works.
>>
>> I am using awesome v3.4.4 (Jet Sex)
>>
>> 2010/4/1 Duflot Jean-Luc<[email protected]>:
>>>
>>> Well, I received no answer to my question (:-(
>>>
>>> Maybe it is so simple that I should find the solution by myself ; but if
>>> I
>>> am asking it, it's because I don't know how to get it...
>>>
>>> May be my question is not clear. So I reformulate it :
>>>
>>> I would like the awesome menu appears when the mouse cursor is above the
>>> menu widget (without clicking), and disappears when it moves away. How to
>>> combine the " add_signal("mouse::enter", function () " with the awesome
>>> menu widget ?
>>>
>>> Thanks for your answer !
>>>
>>> Jean-Luc
>>>
>>>
>>>
>>> Le 25/03/2010 11:58, Duflot Jean-Luc a écrit :
>>>>
>>>> I tried several things to display the awesome menu only when the mouse
>>>> goes above its icon (without click on it), but no one works.
>>>>
>>>> I have two things working well :
>>>>
>>>> 1) a widget icon from where, if the mouse goes above, the apwal
>>>> application is launched, which displays itself a set of application
>>>> icons that I can click on to launch one of them :
>>>>
>>>> wmdrawericon = widget({ type = "imagebox" })
>>>> wmdrawericon.image = image(beautiful.widget_drawer)
>>>> wmdrawericon:add_signal("mouse::enter", function ()
>>>> awful.util.spawn("apwal")
>>>> end)
>>>>
>>>> 2) the standard awesome menu launcher :
>>>>
>>>> mylauncher = awful.widget.launcher({ image =
>>>> image(beautiful.awesome_icon),
>>>> menu = mymainmenu })
>>>>
>>>>
>>>> So, I don't understand if the "wmdrawericon:add_signal..." function must
>>>> be inserted inside the "mylauncher = awful....." function, or at
>>>> contrary, if "mylauncher = awful....." must be inserted inside
>>>> "wmdrawericon:add_signal...", and where exactly. In fact, how to combine
>>>> both functions ?
>>>>
>>>> Some help would be very appreciated.
>>>>
>>>> Jean-Luc
>>>>
>>>>
>>>>
>>>> Le 22/03/2010 18:53, Adrian C. a écrit :
>>>>>
>>>>> On Mon, 22 Mar 2010, Duflot Jean-Luc wrote:
>>>>>
>>>>>> So I understand the awful menu can be modified to extend the main menu
>>>>>> (awesome, open terminal, Debian, in my original menu) to get several
>>>>>> lines more with an application icon inside each one.
>>>>>
>>>>> Not just that. You can create your own independant menus and menu
>>>>> launchers, ones that could consist only of icons (to imitate the
>>>>> wmdrawer look and behaviour).
>>>>>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> To unsubscribe, send mail to [email protected].
>>>
>>
>>
>>
>
>
>
--
Thanks,
Sergey
--
To unsubscribe, send mail to [email protected].