get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extents (Operator)
Name
get_window_extentsT_get_window_extentsGetWindowExtentsGetWindowExtentsget_window_extents — Abfragen von Informationen über die Größe und Position eines Fensters.
Signatur
def get_window_extents(window_handle: HHandle) -> Tuple[int, int, int, int]
Beschreibung
get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents gibt die Position der linken oberen Ecke,
sowie die Breite und die Höhe des Ausgabefensters aus.
Achtung
Die Größe und die Position eines Fensters können durch den Window-Manager
verändert werden, ohne dass dies vom Programm aus vorgenommen wurde. Deshalb
können sich die Werte, die get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents liefert,
durch diesen Seiteneffekt ändern.
Ausführungsinformationen
- Multithreading-Typ: reentrant (läuft parallel zu nicht-exklusiven Operatoren).
- Multithreading-Bereich: global (kann von jedem Thread aufgerufen werden).
- Wird ohne Parallelisierung verarbeitet.
Parameter
WindowHandleWindowHandleWindowHandleWindowHandlewindowHandlewindow_handle (input_control) window → HWindow, HTupleHHandleHTupleHtuple (handle) (IntPtr) (HHandle) (handle)
Fenster-Handle.
RowRowRowRowrowrow (output_control) rectangle.origin.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Zeilenindex der linken oberen Ecke des Fensters.
ColumnColumnColumnColumncolumncolumn (output_control) rectangle.origin.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Spaltenindex der linken oberen Ecke des Fensters.
WidthWidthWidthWidthwidthwidth (output_control) rectangle.extent.x → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Breite des Fensters.
HeightHeightHeightHeightheightheight (output_control) rectangle.extent.y → HTupleintHTupleHtuple (integer) (int / long) (Hlong) (Hlong)
Höhe des Fensters.
Beispiel (HDevelop)
open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)
Beispiel (C)
open_window(100,100,200,200,"root","visible","",&WindowHandle);
fwrite_string(FileHandle,"Move the window with the mouse!");
fnew_line(FileHandle);
create_tuple(&String,1);
do
{
get_mbutton(WindowHandle,NULL,NULL,&Button);
get_window_extents(WindowHandle,&Row,&Column,&Width,&Height);
sprintf(buf,"Row %d Col %d ",Row,Column);
set_s(String,buf,0);
T_fwrite_string(FileHandle, String);
fnew_line(FileHandle);
}
while(Button < 4);
Beispiel (HDevelop)
open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)
Beispiel (HDevelop)
open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)
Beispiel (HDevelop)
open_window(100,100,200,200,'root','visible','',WindowHandle)
fwrite_string(FileHandle, 'Move the window with the mouse!')
fnew_line(FileHandle)
repeat
get_mbutton(WindowHandle,_,_,Button)
get_window_extents(WindowHandle,Row,Column,Width,Height)
fwrite_string(FileHandle, ['(',Row,',',Column,')'])
fnew_line(FileHandle)
until(Button == 4)
Ergebnis
get_window_extentsget_window_extentsGetWindowExtentsGetWindowExtentsGetWindowExtentsget_window_extents liefert den Wert TRUE, falls das Fenster
gültig ist. Ansonsten wird eine Fehlerbehandlung durchgeführt.
Vorgänger
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window,
set_drawset_drawSetDrawSetDrawSetDrawset_draw,
set_colorset_colorSetColorSetColorSetColorset_color,
set_coloredset_coloredSetColoredSetColoredSetColoredset_colored,
set_line_widthset_line_widthSetLineWidthSetLineWidthSetLineWidthset_line_width
Siehe auch
set_window_extentsset_window_extentsSetWindowExtentsSetWindowExtentsSetWindowExtentsset_window_extents,
open_windowopen_windowOpenWindowOpenWindowOpenWindowopen_window
Modul
Foundation