It is currently Fri Sep 10, 2010 9:02 am



Search




advanced search


Random member

Samy.Fox

Join:07.9.2010
Posts:0
Occupation:drivers in St.Petersburg Russia
Web page

Clock



Calendar

<< September 2010 >>
Su Mo Tu We Th Fr Sa
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30

No birthdays today

Link to us

Please feel free to link to HMGforum.com. Use the following HTML:




Welcome

Welcome to HMG Forum, an Exclusive forum for HMG, a Free / Open Source xBase WIN32 / GUI Development System


Latest global announcements

HMG.4 New Linux Binaries+Source Release


Hi All,

Updated Linux binaries containing the latest modifications to HBQT and HMG library.

http://www.sourceforge.net/projects/hmg

Enjoy!

Views: 196  •  Comments: 3  •  Write comments

Latest news

Hello Linux


This is Roberto's post:

Hi All,

For those finding interesting the experimentation, here are some tips:

1. Install Ubuntu 10.04.

2. Download and install Harbour compiler for Ubuntu:

3. Install Development files for the GTK+ library. You can do it with Synaptic Package Manager (libgtk2.0-dev).

4. Create a file called test.prg (with the code below) and build it with hbmk test `pkg-config --cflags --libs gtk+-2.0` command . Run it with ./test

test.prg:
Code:

function main()

   PUBLIC bButtonAction &#58;= { || GTK_MSGINFO('Click!!!') }

   GTK_INIT()

   aRet &#58;= GTK_DEFINEWINDOW( 100 , 100 , 400 , 200 , &quot;hello Linux!!!!&quot; )

   GTK_DEFINEBUTTON ( aRet &#91;2&#93; , 50 , 50 , 'Click Me!!' )

   GTK_ACTIVATEWINDOW()

return nil

*----------------------------------------------------------------------------------------------*
PROCEDURE HMG_BUTTON_CALLBACK ( HANDLE )
*----------------------------------------------------------------------------------------------*
   EVAL ( bButtonAction )
RETURN
*----------------------------------------------------------------------------------------------*
#pragma BEGINDUMP
#include &lt;gtk/gtk&#46;h&gt;
// BUTTON ONCLICK EVENT HANDLER ////////////////////////////////////
static long button_clicked ( GtkWidget *handle )
{
   static PHB_DYNS Dyns = 0 ;
   long int r;
   if( ! Dyns )
   {
      Dyns = hb_dynsymFindName( &quot;HMG_BUTTON_CALLBACK&quot; );
   }
   hb_vmPushSymbol( hb_dynsymSymbol( Dyns ) );
   hb_vmPushNil();
   hb_vmPushLong( (long) handle );
   hb_vmPushLong( 0 );
   hb_vmPushLong( 0 );
   hb_vmPushLong( 0 );
   hb_vmDo( 4 );

   r = hb_parnl( -1 );

   return r;
}
static gboolean delete_event( GtkWidget *widget,GdkEvent  *event, gpointer   data )
{
    g_print (&quot;delete event occurred\n&quot;);
    return FALSE;
}
static void destroy( GtkWidget *widget, gpointer   data )
{
    gtk_main_quit ();
}
//--------------------------------------------------------------------------------------------//
HB_FUNC ( GTK_INIT )
//--------------------------------------------------------------------------------------------//
{
    gtk_init ( 0 , 0 );
}
//--------------------------------------------------------------------------------------------//
HB_FUNC ( GTK_DEFINEWINDOW )
//--------------------------------------------------------------------------------------------//
{
   GtkWidget *window;
   GtkWidget *fixed;
   char* cTitle = (gchar*) hb_parc(5);
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);
   g_signal_connect (window, &quot;delete-event&quot;,G_CALLBACK (delete_event), NULL);
   g_signal_connect (window, &quot;destroy&quot;,G_CALLBACK (destroy), NULL);
   gtk_window_move( GTK_WINDOW(window) , hb_parni(2), hb_parni(1) );
   gtk_widget_set_size_request( GTK_WIDGET(window) , hb_parni(3) , hb_parni(4) );
   gtk_window_set_title( GTK_WINDOW(window) , cTitle );
   /* Create a Fixed Container */
   fixed = gtk_fixed_new ();
   gtk_container_add (GTK_CONTAINER (window), fixed);
   gtk_widget_show (fixed);
   gtk_widget_show  (window);
   hb_reta(2);
   hb_storvnl( window , -1 , 1 );
   hb_storvnl( fixed , -1 , 2 );
}
//--------------------------------------------------------------------------------------------//
HB_FUNC ( GTK_DEFINEBUTTON )
//--------------------------------------------------------------------------------------------//
{
   GtkWidget *button;
   button = gtk_button_new_with_label ( (gchar*) hb_parc(4));
   gtk_fixed_put (GTK_FIXED ((long) hb_parnl(1)), button, hb_parni(2), hb_parni(3) );
   gtk_widget_show (button);
g_signal_connect (G_OBJECT (button), &quot;clicked&quot;, G_CALLBACK (button_clicked), (gpointer) button );
}
//--------------------------------------------------------------------------------------------//
HB_FUNC ( GTK_ACTIVATEWINDOW )
//--------------------------------------------------------------------------------------------//
{
   gtk_main ();
}
//--------------------------------------------------------------------------------------------//
HB_FUNC ( GTK_MSGINFO )
//--------------------------------------------------------------------------------------------//
{
GtkWidget *dialog;
   dialog = gtk_message_dialog_new ( 0 ,
                                  GTK_DIALOG_MODAL,
                                  GTK_MESSAGE_INFO,
                                  GTK_BUTTONS_OK,
                                  (gchar*) hb_parc (1) ,&quot;Hi1&quot; );

   gtk_dialog_run (GTK_DIALOG (dialog));
   gtk_widget_destroy (dialog);

#pragma ENDDUMP


Enjoy!

Views: 168  •  Comments: 0  •  Write comments



Login

Username:


Password:


remember me
hide me


Statistics

Total
Total posts 13341
Total topics 1463
Total announcment 162
Total sticky 3
Total attachments 1247

Topics per day: 2
Posts per day: 17
Users per day: 0
Topics per user: 4
Posts per user: 38
Posts per topic: 9

Total members 348

Who is online

Total:5

Registered:1
Hidden:0
Guest:4

Most users ever online was 74 on Tue Aug 31, 2010 2:06 pm

Registered users: Google [Bot]

Legend :: Administrators, Global moderators, HMG Posters

Powered by phpBB © phpBB Group.
Designed by Vjacheslav Trushkin for Free Forum/DivisionCore.