On 27 Oct 2003 at 14:58, P Witte wrote: > > I hadnt thought of that, (I dont yet have the new Qmenu). But Id still > prefer to know how to do it myself ;)
Fair enough. > > if not, I've dug up some old code I hd used previously for a button > > with a standard border > <> > I feared, but was hoping I wouldnt have to, go there ???? > Thank you for your code ;) I think this is just what Im looking for. I shall > test it as soon as I can. OK let me know if it breaks. (...) > By DOing the liberated button, I want it to jump back into the BF, but > whatever the x-coordinate I provide, wm.prpos positions the button wherever > it thinks fit. Eg, if the free button was at (0,100) wm.prpos puts it in > the correct place at the end of the row of buttons at the top of the screen, > eg (764,0), exactly as specified. However, if the free button was at the > other screen edge, eg (972,50), wm.prpos puts it at (0,0)! If the free > button was anywhere in between, wm.prpos puts it in some intermediate > position (xxx,0). Surely this must be an "issue"? BTW, this behaviour is the > same whether QPC is running in HiColor or QLColor mode ? This something I'm unable to reproduce. OK, AFAIK, the button frame only tells you where there is space to put a button of size x,y. Of course, you should free the place occupied by freeing the button frame when you don't need it anymore. You don't have to do this, if you want to keep the space formerly occupied by the button but in this case the user won't necessarily understand that a space that seems to be free in the button frame can't be occupied by anything else. Anyway, the BF doesn't place anything anywhere, it is your code that does so. The second code example I've sent you should tell you how to position your wdw again where you want it. Just as a recap, let me remind you how the PE positions (primary) windows. If you tell it to position a window at coords x,y, it puts the POINTER at x,y. Then it draws the wdw around the pointer in such a way that the pointer, being at coords x,y, will be located within the window at the coords x2,y2 (relative to the wdw origin), the coords x2,y2 being the coords given in ww_xorg in the working definition (!!!!!!!). In other words, when positioning primary wdws, ww_xorg and ww_yorg contain not the window position, but the initial pointer position of the pointer within the window. I'm sorry if the above sounded pedantic and only told you things you already knew! (...) > Thanks a lot for the code! I'll see if I can make it work for me. I hope it works. Wolfgang