How would one go about creating a GTK3 Application (using the new fancy Application framework) in Gtkmm?

2012-07-23 Thread Filip Lamparski
Hello,

I was wondering how would one go about doing such thing. The wrappers are
mostly there, but it's the methodology that interests me.
I know that in Gtkmm3 the main loop is being phased out in favour of
Gtk::Application, but how should I go about using the framework it provides?

I'd like to hear your take on this.

Have a nice day!

-- 
_
Filip Lamparski - FB https://www.facebook.com/filip.lamparski -
G+https://plus.google.com/105688569486178456264/posts
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


vbc.tgz and dD.c == voptions.c enclosed.

2012-07-23 Thread Gary Kline

Folks,

Attached in my vbc.tgz tarball; this is my working VBC
program.  As-is, it works/installs only with /home/kline/.VBC;
then runs when you type make.  make builds ./vbc.

Typing /home/kline/.VBC/vbc brings up the application.
Mouse-clicking on the second of the three lower buttons, 
Run Text-To-Speech invokes gvim and espeak.  

As-is, VBC would only with a male voice and the voice
options.   Below, is the file I need help integration 
into the top menu bar Options.  This lets the speech-
impaired user the choice of changing gender and several
other espeak options.  This is where I get into trouble.

Lines +433-437 or so below explain part of my problems.  
I think I have taken this project about as far as I  can
without some assistance.  I need help from the 
gnome-accessibility group as I work to modify and improve
this program for the disabled.  Just that right *now* I'm 
hoping this list can help me with the voice options code.

thanks much,

gary



-- 
 Gary Kline  kl...@thought.org  http://www.thought.org  Public Service Unix
 Voice By Computer (for Universal Access): http:/www.thought.org/vbc
  Twenty-six years of service to the Unix community.

/*


gcc -Wall -Wextra -g voptions.c -o xV `pkg-config --cflags gtk+-2.0` 
`pkg-config --libs gtk+-2.0`


 */
/* from here make this into:: Options callback */
#include gtk/gtk.h
#include string.h
#include stdlib.h   // for exit()

#define  PITCH 17.0
#define  SPEED 100.0
#define VOLUME 100.0
#define DELAY  3.0

enum 
{ 
  MALE, 
  FEMALE 
};

#define CONFIG /tmp/chatConfig
/* globals */
GtkWidget *gender_radio_male;
GtkWidget *gender_radio_female;
GtkWidget *pitch_scale1;
GtkWidget *speedWPM_scale2;
GtkWidget *volume_scale3;
GtkWidget *delay_scale4;
int valueGender = MALE;  // default 
double valuePitch, valueSpeed, valueVolume, valueDelay;
/* end globals */



/*
main prog writes default; this fn read and asks if ok
 */
void data_inout();

FILE *ifp, *ofp; /* in and out FILE pointers for fopen */


#define  FALSE(0)
#define  TRUE(~0)

static void
cb_gender_toggled (GtkToggleButton *button, gpointer userdata)
{

  int malefemale = (int)userdata;

  if (gtk_toggle_button_get_active (button))
{
if (malefemale == MALE)
   {
fprintf(stdout, Male \n);
   }
else if (malefemale == FEMALE)
   {
fprintf(stdout, Female \n);
   }
}
valueGender = malefemale;
fprintf(stderr,valueGender: %d\n,valueGender);
}

static void hscale_value_changed_pitch (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valuePitch = gtk_range_get_value(hscale);
//fprintf(stderr,hscale pitch value: %g\n,valuePitch);
  if (valueGender == 0)
  {
fprintf(stdout, \ngender is Male\n);
  }
  else
  {
fprintf(stdout, \ngender is Female\n);
  }
  fprintf(stdout,In _pitch_: patch = %g, speed = %g, volume = %g delay = %g\n,
  valuePitch, valueSpeed, valueVolume, valueDelay);

}

static void hscale_value_changed_speed (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueSpeed = gtk_range_get_value(hscale);
fprintf(stderr,hscale speed value: %g\n,valueSpeed);
}

static void hscale_value_changed_volume (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueVolume = gtk_range_get_value(hscale);
fprintf(stderr,hscale volume value: %g\n,valueVolume);
}
static void hscale_value_changed_delay (GtkRange *hscale, GtkWindow 
*parentWindow)
{
valueDelay = gtk_range_get_value(hscale);
fprintf(stderr,hscale delay value: %g\n,valueDelay);
}

int
main (int argc, char *argv[])
{
 

  /*
   * Declare the GTK Widgets used in the program
   */
  GtkWidget *dialog;
  GtkWidget *main_hbox;   //hbox1

  GtkWidget *gender_frame;
  GtkWidget *gender_align;
  GtkWidget *gender_hbox;  // hbox2
  GtkWidget *params_frame;
  GtkWidget *params_align;

  GtkWidget *params_table;
  GtkWidget *temp_widget;
  GtkWidget *parent_window;



  /*
 Initialize GTK
   */
  gtk_init (argc, argv);

  parent_window = NULL; //Set to parent window if you want the dialog box
//to block access to the other windows in the app
//while it is open and running.


  dialog = gtk_dialog_new_with_buttons (Voice Settings, GTK_WINDOW 
(parent_window), 
0, 
GTK_STOCK_REVERT_TO_SAVED,  //revert button which
GTK_RESPONSE_CANCEL,//  returns a cancel response
GTK_STOCK_CLOSE,//close button which
GTK_RESPONSE_ACCEPT,//  returns an accept response
NULL// mark the end of our buttons (we could have 
more)
);

  gtk_window_set_title ( GTK_WINDOW ( dialog ) , VBC Espeak Options);
  gtk_widget_set_usize( GTK_WIDGET ( dialog ) , 600 , 400 );
  //GTK_WINDOW ( dialog ) -allow_shrink = TRUE;

  /*
   * dialog boxes have a 

g_value_set_instance -- how to use?

2012-07-23 Thread James Tappin
There is very little documentation that I can find explaining how
g_value_set_instance is supposed to work. Is the following anywhere near
correct?

void my_gvalue_setter( const GValue *gv,
 gpointer  val,
 Gtype type)
 {
  g_value_unset(gv);
  g_value_init(gv, type);
  g_value_set_instance(gv,  val);
 }

Then provided val is a pointer to a quantity of type type, it's equivalent
to using the specific setting routine or am I barking up quite the wrong
tree?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list