Support request #27: dialogs without main window (GTK/LINUX)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
(and multithread support, with "gtwvg")
Programs:
- test/gtk_test/hexdump.prg
- test/Ticket27.prg
In the appended posted sample, i use a trick:
I created a main window, but don't activate it.
After all function calls i close the main windows
and the program terminates (a pointer to the object of the main window).
At the end of program the following message appeared:
(hexdump:4307): Gtk-CRITICAL **: 22:27:25.254: IA__gtk_main_quit: assertion 'main_loops != NULL' failed
==> Ignore this message.
Reference:
"Harbour for beginners", chapter "3.11 Multithreading".
( http://www.kresin.ru/en/hrbfaq.html )
Contents of "test.prg":
.......................
#include "hwgui.ch"
CLASS HWVG INHERIT HControl
DATA winclass Init "HWVG"
DATA nGT
DATA hWnd
METHOD New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight, ;
bInit, bSize, bPaint, bcolor, oStyle )
METHOD onEvent() INLINE { || Nil }
METHOD Init() INLINE { || Nil }
METHOD Paint() INLINE { || Nil }
METHOD Release() INLINE { || Nil }
ENDCLASS
METHOD New( oWndParent, nId, nStyle, nLeft, nTop, nWidth, nHeight, ;
bInit, bSize, bPaint, bcolor, oStyle ) CLASS HPanel
LOCAL oParent := iif( oWndParent == Nil, ::oDefaultParent, oWndParent )
hb_gtReload( "WVG" )
::nGT := hb_gtSelect() // hook events for keyboard/mouse/others
::hWnd := hb_gtInfo( HB_GTI_WINHANDLE )
// set size
// set parent
RETURN Self
Contents of "test.prg" in archive "test.zip":
.............................................
Contens
#include "wvgparts.ch"
#include "hbgtwvg.ch"
#include "wvtwin.ch"
ANNOUNCE HB_GTSYS
REQUEST HB_GT_WVG_DEFAULT
FUNCTION Main()
LOCAL nCont
FOR nCont = 1 TO 5
hb_ThreadStart( { || Test() } )
NEXT
hb_ThreadWaitForAll()
RETURN Nil
FUNCTION Test()
LOCAL cTexto := Space(20), cTexto2 := Space(20), GetList := {}
hb_gtReload( "WVG" )
SetMode( 25, 80 )
SetColor( "W/B" )
CLS
@ 12, 20 GET cTexto
@ 14, 20 GET cTexto2
READ
RETURN Nil
Saudações,
Itamar M. Lins Jr.