Harbour Snippets¶
BEGIN/RECOVER , OS, AT¶
BEGIN SEQUENCE
IF At( "WINDOWS", cOs ) != 0 .OR. At( "DOS", cOs ) != 0 .OR. At( "OS/2", cOs ) != 0
cShell := GetEnv( "COMSPEC" )
RUN ( cShell )
ELSEIF At( "LINUX", cOs ) != 0 .OR. At( "BSD", cOs ) != 0 .OR. At( "DARWIN", cOs ) != 0
cShell := GetEnv( "SHELL" )
RUN ( cShell )
ELSE
Alert( "Not implemented yet!" )
ENDIF
RECOVER USING oE
Alert( "Error: " + oE:description )
END SEQUENCE
ISPOINTER¶
// foregound Color column xhgtk fgcolor := ::aCols[i, 9] if ISPOINTER( fgcolor ) gtk_widget_modify_fg( renderer, GTK_STATE_NORMAL, fgcolor ) ... endif
hbcompat.ch:
#xtranslate ISPOINTER( <xValue> ) => HB_ISPOINTER( <xValue> )
Win32 Gui app behavior: "REQUEST HB_GT_NUL_DEFAULT"¶
build.sh
..
if [ $HB_COMPILER = mingw32 ]; then
LIBFILES="$LIBFILES -lgtwin -lgtgui "
fi
..
samples/functions/browse01.prg
#include "common.ch"
#include "xhgtk.ch"
Static lbutton1 := .f.
Static lbutton4 := .f.
Static lbutton5 := .f.
Static button1, button2, button3, button4, button5, button6, ...
REQUEST HB_GT_NUL_DEFAULT <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
Function Main ()
Local window
Local e
Local vbox, hbox
Local model
Local oBrowse
gtk_init()
window := gtk_window_new (GTK_WINDOW_TOPLEVEL)
gtk_window_set_title(window, "XHGTK Browse demo")
gtk_widget_set_size_request(window, 700, 480)
gtk_window_set_position(window, GTK_WIN_POS_CENTER)
gtk_signal_connect(window, "destroy", {||gtk_main_quit()})
....
End
[Harbour] [SOLVED] Win32 Gui app behavior. "Roberto Lopez" <roberbox@gmail.com>
Hi All, I've read /doc/gtapi.txt and adopted one of the solutions presented there. I've added the following to my GUI lib: REQUEST HB_GT_NUL_DEFAULT And the console is gone.
FILE READ¶
harbour/contrib/hbmisc/tests/readfile.prg
#include "fileio.ch"
PROCEDURE Main( cFile )
LOCAL oFile := TFileRead():New( cFile )
LOCAL cNewLine := HB_OSNewLine()
oFile:Open()
IF oFile:Error()
QOUT( oFile:ErrorMsg( "FileRead: " ) )
ELSE
WHILE oFile:MoreToRead()
OUTSTD( oFile:ReadLine() )
OUTSTD( cNewLine )
END WHILE
oFile:Close()
END IF
QUIT