Sunday, June 14, 2009

Workarounds for gtk2

In the last day I found two workarounds for incooperative window managers. The first one is about minimized applications, where all windows are minimized together with the main form, but are not restored when the main form is restored later. Programmatical restoration in an event handler of the main form seems not to work, but an entry "Restore All" in the Window menu will do the job.

The next workaround is about docking forms. Assuming that we want to dock windows rarely, a (checkable) menu entry "Dock" in the Window menu can make visible (or hide) an dockable frame in every dockable application window. This frame can be docked in all widgetsets, and when finally an UnDock of the dropped frame is denied, the *form* is docked instead of the frame! This certainly is not expected behaviour, but it will do exactly what we need for now :-)

The docking behaviour of the SynEdit component has become worse in the last revisions. While a SynEdit still refuses to dock in a given location, with a given size, it now also refuses to drag at all. Before it had been possible to drag it from the gutter area, which now doesn't work any more. This may be related to some general change in the behaviour of (windowed?) controls, which seem to reject any BeginDrag requests, by possibly changing the request from the start of a drag-dock into a drag-drop.

1 comment:

  1. Sorry, I misinterpreted some facts in the above post. Actually the form itself was dragged (by Self), when the control's BeginDrag was called. The only requirement for docking forms is a component that starts dragging the form. Since BeginDrag is not a virtual method, the control to be dragged has to be put into the dock object, created on the control's StartDock method.

    ReplyDelete