Naive questions about TSpeedButton lazarus / 10-Designer ---------------------------------------------------------------------- giorgiotani · 2009-03-25 14:49 Sorry if those questions are naive, but I'm currently not able to figure out a solution. Using a pair of flat TSpeedButton (Lazarus 0.9.26 on Windows and Linux), I would like to replicate a nice button structure, with a second small button on the right that allows to be clicked and show a menu of options/functions related to the first button. In example, this can be seen in some toolbar buttons of Outlook Express or, differently implemented, on Thunderbird. 1) When the mouse enters a flat TSpeedButton, the object is higlighted in a different way than non-flat buttons (the effect varies on different systems). When the mouse enters (onmouseover) one of the two button of the pair, I would like to get higlighted also the other button, but I need to knwo a workaround to set the other button "higlighted". Setting .flat:=false is not an option, since non-flat buttons are rendered differently than higlighted flat buttons (I could set non- flat both buttons, but the effect results quite ugly). 2) Clicking on the second button of the pair, apopupment.popup(p.x,p.y) shows apopupmenu; clicking on the button again I would need to check if the popup is still shown and, in this case, hide it. What is the most rational method to perfom the check, and hide the popup menu? -- edit: this happens by default compiling the application in GTK2, with no need to write additional code: if the popup menu is shown, casting .popup again results in hiding it. But on Win32 it doesn't happen, so I would like to figure out how make the popup behave the same on the two platforms) -- Thanks in advance! ---------------------------------------------------------------------- Paul Ishenin · 2009-04-08 09:29 To Hide popup you need to call PopupMenu.Close. ---------------------------------------------------------------------- giorgiotani · 2009-04-09 07:45 Quote from: Paul Ishenin on April 08, 2009, 11:29:43 amTo Hide popup you need to call PopupMenu.Close. The problem I'm encountering is how to check if the popup is shown (then close) or not (then popup). I've searched and tried, but I've not found a documented way to do that, which seems strange, so I'm keeping searching. I've even tried to declare a boolean variable and modify it as the popup is shown/hidden, but it leads to not consistent results on Win32: when the popup is closed clicking another component, I set that variable to be modified in the popup's onclose event, but it just doesn't happen. ---------------------------------------------------------------------- Paul Ishenin · 2009-04-10 07:21 Try to check HandleAllocated. Popup menu has handle only when it is visible. Popup menu handle destroying when it hides.