Re: gtkdialog maximum size

2017-09-13 Thread Rúben Rodrigues
Thanks. I don't solved my other problem yet. I leave the problem with 
two dialog for other time. But using GtkScrolledWindow i resolved this 
problem.

Why are you saying that using a scrolled window with parts invisible is 
not user frindly?

Best regards,

Ruben


Às 11:16 de 13/09/2017, Stefan Salewski escreveu:
> On Wed, 2017-09-13 at 10:59 +0100, Emmanuele Bassi wrote:
>> Why are you using a GtkDialog? You should be using a GtkWindow for a
>> complex UI.
>>
>> Additionally, the size of a top-level is given by its contents,
>> unless
>> you specify a size yourself. If your UI is too big, you'll have to
>> arrange it differently.
> For a plain Window he may use of course a GtkScrolledWindow. I am not
> sure if that would work for a dialog too, but I think so.
>
> But of course a scrolled window with parts invisible is not really user
> friendly...
>
> Ruben, what do you expect when contents do not fit onto screen? And
> have you solved your other problem with the two dialogs following each
> other? I have seen a long reply of somebody to your question -- did
> that helped you?
>
> Next question may be how to detect that content is too large for
> screen, and how to shrink content. Maybe check allocation for window
> first. And when larger than screen, maybe reduce text size, widget size
> or hide some widgets.


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

gtkdialog maximum size

2017-09-13 Thread Rúben Rodrigues
Hi guys,

Someone knows how to limite the maximum size of gtkdialog? My problem is 
that as the dialog does resize itself, sometimes it gets bigger that the 
screen.

You can see here:

https://ibin.co/3a9dsXej5ArN.png

Best regards,

Ruben Rodrigues


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Show dialog after hide another

2017-09-09 Thread Rúben Rodrigues
Please!!

Help..


Às 17:08 de 06/09/2017, Rúben Rodrigues escreveu:
> Hi guys,
>
>
> I have i problem when trying to hide a dialog and show another at the
> same moment.
>
> I have a dialog that have an OK button that calls this function:
>
> void on_button_Util_Firmware_Update_clicked(GtkButton *button, gpointer
> user_data)
> {
>       GtkLabel    *gLabel_Result;
>       FILE        *fp;
>       gchar        pcTmp[BUFSIZ];
>
>       // Fecha a janela.
> gtk_widget_hide(GTK_WIDGET(gtk_widget_get_toplevel(GTK_WIDGET(button;
>
>       // Mostra a janela de espera.
>       gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(builder,
> "Setup_Wait_dialog")));
>       sleep(10);
>
>    //**Running something inside
>
> // Esconde a janela de espera.
>       gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(builder,
> "Setup_Wait_dialog")));
>
> }
>
> As you can see this is a Waiting dialog to show the status of the
> process, but the problem is  that don't show the Setup_Wait_dialog and
> don't hides the first dialog. What's wrong?
>
> Thanks
>
>
> ---
> Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
> https://www.avast.com/antivirus
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Show dialog after hide another

2017-09-06 Thread Rúben Rodrigues
Hi guys,


I have i problem when trying to hide a dialog and show another at the 
same moment.

I have a dialog that have an OK button that calls this function:

void on_button_Util_Firmware_Update_clicked(GtkButton *button, gpointer 
user_data)
{
     GtkLabel    *gLabel_Result;
     FILE        *fp;
     gchar        pcTmp[BUFSIZ];

     // Fecha a janela.
gtk_widget_hide(GTK_WIDGET(gtk_widget_get_toplevel(GTK_WIDGET(button;

     // Mostra a janela de espera.
     gtk_widget_show(GTK_WIDGET(gtk_builder_get_object(builder, 
"Setup_Wait_dialog")));
     sleep(10);

  //**Running something inside

// Esconde a janela de espera.
     gtk_widget_hide(GTK_WIDGET(gtk_builder_get_object(builder, 
"Setup_Wait_dialog")));

}

As you can see this is a Waiting dialog to show the status of the 
process, but the problem is  that don't show the Setup_Wait_dialog and 
don't hides the first dialog. What's wrong?

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Add idle timout to Menu

2017-07-08 Thread Rúben Rodrigues
Hi guys,

Someone knows any way to add a timeout to a Menu because of touchscreen 
keypress idle event?

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Combobox on touchscreen

2017-06-27 Thread Rúben Rodrigues
Hi guys,

Following this post that didn't receive an answer 
https://mail.gnome.org/archives/gtk-app-devel-list/2016-June/msg00030.html 
, want to ask if someone knows this problem. Sometimes combobox works, 
but i think that is dificult to change the state of the combobox. There 
is a workaround?


Thanks.


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

gtk_rgba_parse retunr wrong color

2017-06-23 Thread Rúben Rodrigues
Hi,

Someone knows why gdk_rgba_parse returns worng color?

I have this gdk_rgba_parse(_color,"rgb(8,178,23)");
   cairo_set_source_rgba(cr, front_color.red, front_color.blue, 
front_color.green, front_color.alpha);

The color should be green but returns blue...

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Creating custom widget linker error

2017-06-23 Thread Rúben Rodrigues
Hi,

I'm trying to create a custom widget like in this example: 
http://djcj.org/gtk/

The example works, but when i try to make something similar i get a 
linker error, and don't understand why!

Error:

make all
Building target: ConsolaGrafica
Invoking: Cross GCC Linker
arm-linux-gnueabihf-gcc -L/opt/x-tools/rootfs/rpi/usr/local/lib 
-L/lib/arm-linux-gnueabihf -L/opt/x-tools/rootfs/rpi/home/pi/jsmn 
-L/usr/lib/gcc-cross/arm-linux-gnueabi/5/ 
-L/opt/x-tools/rootfs/rpi/home/pi/linechart-dist/anychart 
-L/usr/lib/arm-linux-gnueabihf --sysroot=/opt/x-tools/rootfs/rpi 
`pkg-config --libs gmodule-export-2.0` 
/opt/x-tools/rootfs/rpi/usr/lib/arm-linux-gnueabihf/libstdc++.so.6 -o 
"ConsolaGrafica"  ./src/home/Home_Alarms.o ./src/home/Home_Cooling.o 
./src/home/Home_Houses.o ./src/home/Home_Sensors.o  
./src/gtk-linechart/gtk-linechart.o ./src/dialogs/Setup_Alarms.o 
./src/dialogs/Setup_Cooling_Reduction.o ./src/dialogs/Setup_Exits.o 
./src/dialogs/Setup_Heating.o ./src/dialogs/Setup_Lighting.o 
./src/dialogs/Setup_ProbeEnable.o ./src/dialogs/Setup_Progression.o 
./src/dialogs/Setup_Super_Coolers.o ./src/dialogs/Setup_Super_Cooling.o 
./src/dialogs/Setup_Super_ProbeCal.o ./src/dialogs/Setup_TimeDate.o 
./src/dialogs/Setup_Weight.o ./src/dialogs/ask_passcode.o  
./src/customwidgets/circulargauge.o 
./src/customwidgets/circularprogressbar.o ./src/customwidgets/gtkmeter.o 
./src/customwidgets/mycpu.o ./src/customwidgets/psquare.o 
./src/customwidgets/stroker-nodalcontainer.o  ./src/Database.o 
./src/EditableTable.o ./src/Keypad.o ./src/LogView.o ./src/Main.o 
./src/SaveConfig.o ./src/StatusBar.o ./src/UpdateConfig.o 
./src/UpdateStatus.o ./src/callbacks.o   -lgtk-3 -lX11 -lcurl -lgdk-3 
-lpangocairo-1.0 -lpango-1.0 -latk-1.0 -lcairo-gobject -lcairo 
-lgdk_pixbuf-2.0 -lgio-2.0 -lgobject-2.0 -lglib-2.0 -lgmodule-2.0 
-lpthread -lmysqlclient -lz -ldl -lm -lpangoft2-1.0 -lfontconfig 
-lfreetype -lgthread-2.0 -lanychart -lstdc++ -ljsmn
./src/customwidgets/circularprogressbar.o: In function 
`circular_progressbar_set_property':
/home/autofran_ruben/dev/consola/ConsolaGrafica/RaspberryPiDebug/../src/customwidgets/circularprogressbar.c:145:
 
undefined reference to `circular_progress_bar_get_type'


Definition (.h file):

GType  circular_progress_bar_get_type (void) G_GNUC_CONST;

#define GTK_CIRCULAR_PROGRESSBAR_TYPE (circular_progress_bar_get_type ())
#define GTK_CIRCULAR_PROGRESSBAR(obj) (G_TYPE_CHECK_INSTANCE_CAST 
((obj), GTK_CIRCULAR_PROGRESSBAR_TYPE, CircularProgressBar))
#define GTK_CIRCULAR_PROGRESSBAR_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST 
((klass), GTK_CIRCULAR_PROGRESSBAR_TYPE, CircularProgressBarClass))
#define GTK_CIRCULAR_IS_PROGRESSBAR(obj) (G_TYPE_CHECK_INSTANCE_TYPE 
((obj), GTK_CIRCULAR_PROGRESSBAR_TYPE))
#define GTK_CIRCULAR_IS_PROGRESSBAR_CLASS(klass) 
(G_TYPE_CHECK_CLASS_TYPE ((klass), GTK_CIRCULAR_PROGRESSBAR_TYPE))
#define GTK_CIRCULAR_PROGRESSBAR_GET_CLASS(obj) 
(G_TYPE_INSTANCE_GET_CLASS ((obj), GTK_CIRCULAR_PROGRESSBAR_TYPE, 
CircularProgressBarClass))

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re.: GtkDrawingArea size request

2017-06-22 Thread Rúben Rodrigues
Solved.

Someone have a example of how to create a custom widget with cairo in C?
Thanks

 Mensagem original 
Assunto: Fwd: GtkDrawingArea size request
De: Rúben Rodrigues
Para: gtk-app-devel-list@gnome.org
CC:

Someone received my question?

Thanks


 Mensagem reencaminhada 
Assunto:GtkDrawingArea size request
Data:   Wed, 21 Jun 2017 10:08:15 +0100
De: Rúben Rodrigues <ruben...@live.com.pt><mailto:ruben...@live.com.pt>
Para:   gtk-app-devel-list@gnome.org<mailto:gtk-app-devel-list@gnome.org> 
<gtk-app-devel-list@gnome.org><mailto:gtk-app-devel-list@gnome.org>



Hi,

I create a drawing area to draw a circular gauge with cairo.

GtkWidget *drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (drawing_area, 100, 100);
gtk_box_pack_start (GTK_BOX(gtk_builder_get_object(builder,
"box30")),drawing_area,FALSE,TRUE,0);

The problem is that the drawing area is not 100x100 but the entire of
screen.

This is the callback function:



gboolean on_circular_gauge_draw(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{

  int width, height;
  gint percentage, linewidth;

  width = gtk_widget_get_allocated_width (widget);
  height = gtk_widget_get_allocated_height (widget);


  linewidth = (MIN (width, height) / 2.0 * 30.0) / 100.0;

  cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.6);
  cairo_set_line_width (cr, linewidth);
  cairo_arc(cr, width/2.0, height/2.0,  MIN (width, height) / 2.0 -
linewidth, angle1, angle2);
  cairo_stroke (cr);

  cairo_set_source_rgba (cr, 0.0, 0.9, 0.0, 1.0);
  cairo_set_line_width (cr, linewidth);
  cairo_arc(cr, width/2.0, height/2.0, MIN (width, height) / 2.0  -
linewidth, 180.0  * (M_PI/180.0),315.0  * (M_PI/180.0) );
  cairo_stroke (cr);



  return FALSE;
}



[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Sem vírus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GtkDrawingArea size request

2017-06-22 Thread Rúben Rodrigues
Hi,

I create a drawing area to draw a circular gauge with cairo.

GtkWidget *drawing_area = gtk_drawing_area_new ();
 gtk_widget_set_size_request (drawing_area, 100, 100);
 gtk_box_pack_start (GTK_BOX(gtk_builder_get_object(builder, 
"box30")),drawing_area,FALSE,TRUE,0);

The problem is that the drawing area is not 100x100 but the entire of 
screen.

This is the callback function:



gboolean on_circular_gauge_draw(GtkWidget *widget, cairo_t *cr,
 gpointer user_data)
{

   int width, height;
   gint percentage, linewidth;

   width = gtk_widget_get_allocated_width (widget);
   height = gtk_widget_get_allocated_height (widget);


   linewidth = (MIN (width, height) / 2.0 * 30.0) / 100.0;

   cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.6);
   cairo_set_line_width (cr, linewidth);
   cairo_arc(cr, width/2.0, height/2.0,  MIN (width, height) / 2.0 - 
linewidth, angle1, angle2);
   cairo_stroke (cr);

   cairo_set_source_rgba (cr, 0.0, 0.9, 0.0, 1.0);
   cairo_set_line_width (cr, linewidth);
   cairo_arc(cr, width/2.0, height/2.0, MIN (width, height) / 2.0  - 
linewidth, 180.0  * (M_PI/180.0),315.0  * (M_PI/180.0) );
   cairo_stroke (cr);



   return FALSE;
}


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Fwd: GtkDrawingArea size request

2017-06-21 Thread Rúben Rodrigues
Someone received my question?

Thanks


 Mensagem reencaminhada 
Assunto:GtkDrawingArea size request
Data:   Wed, 21 Jun 2017 10:08:15 +0100
De: Rúben Rodrigues <ruben...@live.com.pt><mailto:ruben...@live.com.pt>
Para:   gtk-app-devel-list@gnome.org<mailto:gtk-app-devel-list@gnome.org> 
<gtk-app-devel-list@gnome.org><mailto:gtk-app-devel-list@gnome.org>



Hi,

I create a drawing area to draw a circular gauge with cairo.

GtkWidget *drawing_area = gtk_drawing_area_new ();
gtk_widget_set_size_request (drawing_area, 100, 100);
gtk_box_pack_start (GTK_BOX(gtk_builder_get_object(builder,
"box30")),drawing_area,FALSE,TRUE,0);

The problem is that the drawing area is not 100x100 but the entire of
screen.

This is the callback function:



gboolean on_circular_gauge_draw(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{

  int width, height;
  gint percentage, linewidth;

  width = gtk_widget_get_allocated_width (widget);
  height = gtk_widget_get_allocated_height (widget);


  linewidth = (MIN (width, height) / 2.0 * 30.0) / 100.0;

  cairo_set_source_rgba (cr, 1.0, 1.0, 1.0, 0.6);
  cairo_set_line_width (cr, linewidth);
  cairo_arc(cr, width/2.0, height/2.0,  MIN (width, height) / 2.0 -
linewidth, angle1, angle2);
  cairo_stroke (cr);

  cairo_set_source_rgba (cr, 0.0, 0.9, 0.0, 1.0);
  cairo_set_line_width (cr, linewidth);
  cairo_arc(cr, width/2.0, height/2.0, MIN (width, height) / 2.0  -
linewidth, 180.0  * (M_PI/180.0),315.0  * (M_PI/180.0) );
  cairo_stroke (cr);



  return FALSE;
}



[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Sem vírus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: undefined reference to gtk label set xalign

2017-06-19 Thread Rúben Rodrigues
I add the full library path to linker and works, but now the function don't 
makes anything id xalign is 1.0. A change to 0.0 and works.. What's going on?

Code:

for(i=0;i<2;i++)
if(xHouseList[i].box == NULL){
xHouseList[i].box = gtk_box_new(GTK_ORIENTATION_VERTICAL,0);
xHouseList[i].button = gtk_button_new();
//gtk_grid_attach(GTK_GRID(),,i,j,1,1);
gtk_widget_set_size_request (xHouseList[i].button,256,-1);
//gtk_widget_get_preferred_width_for_height 
(xHouseList[i].button,266,256,NULL);
//gtk_widget_get_preferred_width 
(xHouseList[i].button,256,NULL);
gtk_box_pack_start (GTK_BOX(gtk_builder_get_object(builder, 
"Home_Houses_Box")),xHouseList[i].button,FALSE,TRUE,0);
if(i==0)
g_signal_connect (xHouseList[i].button, "clicked", 
G_CALLBACK (on_House_Button_clicked), NULL);

gtk_container_add(xHouseList[i].button,xHouseList[i].box);

sprintf(pcTmp,"Pavilhão %d",i+1);
xHouseList[i].name_label = gtk_label_new(pcTmp);
gtk_box_pack_start 
(GTK_BOX(xHouseList[i].box),xHouseList[i].name_label,TRUE,TRUE,0);

gtk_widget_set_name(xHouseList[i].name_label,"House_Name_Label");

//gtk_style_context_add_class(gtk_widget_get_style_context(xHouseList[i].name_label),"House_Name_Label");
gtk_widget_set_margin_top (xHouseList[i].name_label,10);
//HUmidity Box
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
gtk_box_pack_start (GTK_BOX(xHouseList[i].box),box,TRUE,TRUE,0);
xHouseList[i].hum_label = gtk_label_new("50");
gtk_box_pack_start 
(GTK_BOX(box),xHouseList[i].hum_label,TRUE,TRUE,0);
gtk_label_set_xalign(GTK_LABEL(xHouseList[i].hum_label),1.0);

gtk_widget_set_name(xHouseList[i].hum_label,"House_Hum_Num");
label = gtk_label_new("%");
gtk_label_set_xalign (GTK_LABEL(label),1.0);
gtk_box_pack_start (GTK_BOX(box),label,TRUE,TRUE,1);
gtk_widget_set_name(label,"House_Hum_Label");
//Temperature Box
box = gtk_box_new(GTK_ORIENTATION_HORIZONTAL,0);
gtk_box_pack_start (GTK_BOX(xHouseList[i].box),box,TRUE,TRUE,0);
xHouseList[i].temp_label = gtk_label_new("32");
gtk_box_pack_start 
(GTK_BOX(box),xHouseList[i].temp_label,TRUE,TRUE,1);
gtk_label_set_xalign(GTK_LABEL(xHouseList[i].temp_label),1);

gtk_widget_set_name(xHouseList[i].temp_label,"House_Temp_Num");
label = gtk_label_new("ºC");
gtk_label_set_xalign (GTK_LABEL(label),1.0);
gtk_box_pack_start (GTK_BOX(box),label,TRUE,TRUE,1);
gtk_widget_set_name(label,"House_Temp_Label");


gtk_style_context_add_class(gtk_widget_get_style_context(xHouseList[i].box),"House_Box");
//g_object_unref(label);

}


Thanks

Às 14:38 de 17/06/2017, Chris Moller escreveu:
ldconfig creates links and caches for runtime libraries.  It looks like, even 
though you've installed GTK+ 3.22, it's not yet in the runtime library path and 
you're still linking to GTK+ 3.14, which doesn't have gtk_label_set_xalign.  
Running ldconfig might fix this.

Chris Moller

On 06/17/17 06:11, Rúben Rodrigues wrote:

No,

What this makes?

Às 03:04 de 17/06/2017, Chris Moller escreveu:
Have you tried running sudo /sbin/ldconfig since you installed 3.22.12?

On 06/16/17 04:58, Rúben Rodrigues wrote:

Hi guys,

Someone could help with this?
https://stackoverflow.com/questions/44547398/undefined-reference-to-gtk-label-set-xalign

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org<mailto:gtk-app-devel-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list





[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Sem vírus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

undefined reference to gtk label set xalign

2017-06-16 Thread Rúben Rodrigues
Hi guys,

Someone could help with this? 
https://stackoverflow.com/questions/44547398/undefined-reference-to-gtk-label-set-xalign

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Integrate IP Camera stream in GTK app

2017-06-14 Thread Rúben Rodrigues
Hi Eric,

I know that we can do with gstreamer, but i'm using an raspberry pi and what i 
tested dont't works because raspberry pi just shows an image of camera and 
don't play the stream. I get an error of "computer to slow", but just stay slow 
after run gstreamer.

I used vlc too, and in my computer works fine, but not in raspberry pi..

Thanks


Às 18:42 de 13/06/2017, cecas...@aol.com escreveu:

Hi Ruben,

I am sure you can do that with GTK and GStreamer. That way the code would be 
portable across platforms.

I don't have any examples of using GStreamer to get video from an ip camera. I 
have some test code that will show the video from the local webcam.

https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Sound/webcam3.c

There are a couple of other programs in the Sound folder that uses GStreamer 
with GTK if that is of any help. Also, I have an updated GStreamer 
basic-tutorial5 that will play local video or video from over the web if that 
would be of any help to you.

Eric




[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]
  Sem vírus. 
www.avast.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Integrate IP Camera stream in GTK app

2017-06-13 Thread Rúben Rodrigues
Hi guys,

Someone knows how to integrate IP Camera stream in GTK+ app? I tested 
with libvlc an gstreamer in my raspberrry pi, but don't works.. Any 
other library to make this?

Thanks

Rúben


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Gtk Assistant check entries

2017-05-15 Thread Rúben Rodrigues
Hi guys,

I ahve a assistant page, and i want to check all entrie in first page to 
mark as complete. You can see assistant here:

https://ibin.co/3MXmlhjIHrgA.png


I used GtkEditable -> changed signal, but after i changed entrie there 
is no call to the function callback:

static void on_entry_changed (GtkWidget *widget, gpointer data)
{
   GtkAssistant *assistant = GTK_ASSISTANT (data);
   GtkWidget *current_page;
   gint page_number;
   const gchar *text;

   page_number = gtk_assistant_get_current_page (assistant);
   current_page = gtk_assistant_get_nth_page (assistant, page_number);
   text = gtk_entry_get_text (GTK_ENTRY (widget));

   if (text && *text)
 gtk_assistant_set_page_complete (assistant, current_page, TRUE);
   else
 gtk_assistant_set_page_complete (assistant, current_page, FALSE);
}

The code don't check all entries, just one, and don´t works the 
callback. How can i check all entries in this page? And which signal can 
i use?


Thanks


Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Gtk+3.22 compile app error

2017-04-22 Thread Rúben Rodrigues
Hi guys,

I'm working with raspbian and the version installed by apt-get install 
is older, so i download and compile 3.22 version and installed. Now when 
i'm trying to compile my application i get this error:

- undefined reference to `pango_fc_font_map_config_changed'.

The newest version need some extra library? I installed the required 
libraries that is in the gtk.org website.

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

CheckButton background color

2017-04-21 Thread Rúben Rodrigues
Hi,

Someone knows how to change gtkcheckbutton background and size in CSS?

i tried this:

Checkbutton CSS for Red:

GtkCheckButton .check {
  background: red;
  color: white;
  min-width: 8px;
  min-height: 8px;
  border-width: 0px;
}

and

checkbutton check {
  background: red;
  color: white;
  min-width: 8px;
  min-height: 8px;
  border-width: 0px;
}
but don't works.

I appreciate your help. Thanks.

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]
  Sem vírus. 
www.avast.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Update Gtk+3.0

2017-04-21 Thread Rúben Rodrigues
Hi guys,

I'm in trouble with gtk version i think. When i run pkg-config 
--modversion gtk+-3.0 in my Raspberry Pi that is running Raspbian OS, i 
get 3.14.5 version.

If i try to update with sudo apt-get update and sudo apt-get upgrade, i 
have the same version. How i can update to gtk+-3.20 version that is the 
lastest stable version?


Thanks guys.


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Doubt

2017-04-21 Thread Rúben Rodrigues
Hi guys,

i have a problem with callback functions. I have a struct in parameter but 
always give null values. Here is an example:


struct pxToggleData{
LineChartSeries *series;
LineChart *chart;
GtkWidget *canvas;
};

xTempToggle.canvas = canvas;
xTempToggle.chart = chart;

xTempToggle.series = pxLogView_TempSensors[iProbe].series;

g_signal_connect((GObject *)pxLogView_TempSensors[iProbe].cButton, "toggled", 
(GCallback)series_toggled, );

Someone could help me? Why it give always xTempToggle null in series_toggled 
callback function?

--
Rúben Rodrigues
AUTOFRAN, Lda
www.autofran.net<http://www.autofran.net>

[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
  Sem vírus. 
www.avast.com<https://www.avast.com/sig-email?utm_medium=email_source=link_campaign=sig-email_content=emailclient>
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

scroll bar

2017-04-19 Thread Rúben Rodrigues
Hi guys,

Someone could help with scroll bar, zoom gesture and pan gesture ?

I add this zoom callback, and i need to change the scroll bar. But i 
don't understand the paramentes of gtk_adjustment_configure().

static void
zoom_scale_changed (GtkGestureZoom *gesture,
 gdouble scale,
 GtkWidget  *widget)
{

 double lower = gtk_adjustment_get_lower(hadjustment);
 double upper = gtk_adjustment_get_upper(hadjustment);

double dif = ((upper - lower)*scale - (upper -lower) ) / 2.0 ;

if(dif > 0){
 linechart_set_xaxis_minmax(chart, dif , PAGE_SIZE - dif);
   gtk_adjustment_configure(hadjustment, dif, lower, PAGE_SIZE - 
dif, 1.0, 1.0, PAGE_SIZE);
 }else{
 linechart_set_xaxis_minmax(chart, 0.0 , PAGE_SIZE);
 gtk_adjustment_configure(hadjustment, 0.0, 0.0, PAGE_SIZE, 1.0, 
1.0, PAGE_SIZE);
 }
 gtk_widget_queue_draw (widget);
}

static void pan_pos_changed (GtkGesturePan  *gesture,
 GtkPanDirection direction,
 gdouble offset,
 GtkWidget  *widget){
 double value = gtk_adjustment_get_value(hadjustment);
 double lower = gtk_adjustment_get_lower(hadjustment);
 double upper = gtk_adjustment_get_upper(hadjustment);

 switch (direction){
 case GTK_PAN_DIRECTION_LEFT:
 linechart_set_xaxis_minmax(chart, lower - offset , upper - 
offset);
 break;
 case GTK_PAN_DIRECTION_RIGHT:
 linechart_set_xaxis_minmax(chart, lower + offset , upper + 
offset);
 break;
 }

 gtk_widget_queue_draw (widget);
}

To configure callback and gesture i use this:

 /* Zoom */
 gesture = gtk_gesture_zoom_new (canvas);
 g_signal_connect (gesture, "scale-changed",
 G_CALLBACK (zoom_scale_changed), canvas);
 gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER 
(gesture),
GTK_PHASE_BUBBLE);
 g_object_weak_ref (G_OBJECT (canvas), (GWeakNotify) g_object_unref, 
gesture);

 /* Pan */
 gesture = gtk_gesture_pan_new(canvas,GTK_ORIENTATION_HORIZONTAL);
 g_signal_connect (gesture, "pan",
 G_CALLBACK (pan_pos_changed), canvas);
 gtk_event_controller_set_propagation_phase (GTK_EVENT_CONTROLLER 
(gesture),
GTK_PHASE_BUBBLE);
 g_object_weak_ref (G_OBJECT (canvas), (GWeakNotify) g_object_unref, 
gesture);

hadjustment = gtk_adjustment_new(0, 0, 0, 0, 0, 0);

g_signal_connect(G_OBJECT(hadjustment), "value-changed", 
(GCallback)value_changed, NULL);

hscrollbar = gtk_scrollbar_new(GTK_ORIENTATION_HORIZONTAL, hadjustment);

gtk_adjustment_configure(hadjustment, 0.0, 0.0, PAGE_SIZE, 1.0, 1.0, 
PAGE_SIZE);

The pan gesture don't works, never go to callback function.

Thanks



---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

gtk function with argv

2017-04-08 Thread Rúben Rodrigues
Why guys,

I have a doubt that is more about C language that gtk+ but it's to apply 
to gtk+.

I have this function:

GtkChart vChart_Init(GtkWidget *widget, GtkSeries *series)

My doubt is: How can i use function like this: 
vChart_Init(GTK_WIDGET(widget), "Series A", "Series B", "Series C");

I need that second parameter is dynamic  and is a string (that contains 
the name of serie)

THanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: SpinButton size

2017-03-29 Thread Rúben Rodrigues
Hi,

Thsnks.

I need for GTK3


On 29-03-2017 08:51, Stefan Salewski wrote:
> On Mon, 2017-03-27 at 14:23 +0000, Rúben Rodrigues wrote:
>> hi guysm
>>
>> it's possible to change size of spinbuttons? In touchscreen mode
>> spinbutton are still small.. We can change it's size with css
>> provider?
>>
>>   
> That may be possible...
>
> I found some example code in gedit C sources for changing widget sizes,
> that code has changed from GTK version to GTK version. For 3.20 I have
> working code like:
>
># from 3.20 gedit-documents-panel.c
>let closeButton = button(newObject(typeButton, "relief", ReliefStyle.NONE, 
> "focus-on-click", false, nil))
>let context = closeButton.getStyleContext
>context.addClass("flat")
>context.addClass("small-button")
>let icon = newThemedIconWithDefaultFallbacks("window-close-symbolic")
>let image: Image = newImage(icon, IconSize.MENU)
>objectUnref(icon)
>closeButton.add(image)
>discard gSignalConnect(closeButton, "clicked", gCallback(closeTab), 
> scrolled)
>
> Well, that is not for spin button, but ordinary button. And again you
> did not said if you want a solution for GTK2 or GTK4 on macosx.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gdk_threads_leave is possible to cause segmentation fault?

2017-03-28 Thread Rúben Rodrigues
Thanks!
So i could replate enter and leave to g_iddle_add, right?

gdk_threads_enter();
 g_printf("UpdateConfigNow\n");
 iUpdateConfigNow();
gdk_threads_leave();

To

g_idle_add((GCallback)iUpdateConfigNow, NULL);

Why i get this error?

Main.c:1824: undefined reference to `g_iddle_add'

Thanks


Às 11:49 de 28/03/2017, Gabriele Greco escreveu:

In gdk manual i see thath gdk_threads_enter and leave has been
deprecated and alll gdk and gtk+ calls should be made from main thread.
How we do this? Someone have any example?

You have to call g_idle_add (that is thread safe) every time you need to update 
one or more widgets from an external thread.

Let's think about a common situation, for instance you are encoding a video 
file and you want to update a progress bar:

[from encoding thread]
struct progress {
char label[50];
float value;
};

myprg = malloc(sizeof(struct progress));
myprg->value = 75.0;
strncpy(myprg->label, "Second pass", sizeof(myprg->label));
g_idle_add((GCallback)progress_update, myprg);

gboolean progress_update(struct progress *p);
{
 gtk_progress_bar_set_text(p->label);
 gtk_progress_bar_set_fraction(p->value);
 free(p);
 return FALSE; // it means that you want to run this only once
}

--
Bye,
 Gabry


[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]
  Sem vírus. 
www.avast.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

SpinButton size

2017-03-28 Thread Rúben Rodrigues
hi guysm

it's possible to change size of spinbuttons? In touchscreen mode 
spinbutton are still small.. We can change it's size with css provider?

Thanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gdk_threads_leave is possible to cause segmentation fault?

2017-03-28 Thread Rúben Rodrigues
Hi guys,

My application sometimes have segmentation fault error. In debug mode 
and using g_print() i see that the applications stops in 
gdk_thread_leave function.

In gdk manual i see thath gdk_threads_enter and leave has been 
deprecated and alll gdk and gtk+ calls should be made from main thread. 
How we do this? Someone have any example?

Thanks!


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


How can i change background color of first column data

2017-03-24 Thread Rúben Rodrigues
Hi guys,

I have a problem with treeview. My first column of treeview where we 
have data, is yellow. I want to change to other color. How i make this 
in css? I changed the background color of column header with this code:

column-header .button{
 background-color: #5b5b5b;
 color: black;
}

But i don't know how to change first column background just in the data.

THanks


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How use gnome-calculator in my gtk+ app

2017-03-24 Thread Rúben Rodrigues
the best is full interface, if it possible to add gnome-calculator. If not, i 
will implement just a basic calculator.

But i think that is a way to insert other application inside mine, i'm wrong?

Thanks

On 22-03-2017 09:43, Roth Robert wrote:
Hi Ruben,

That depends on what do you mean by adding a calculator:
* do you only need a text-field to evaluate calculations from? (easier to 
implement, spawn a process for the command-line version of calculator to 
calculate the result, just like the calculator gnome shell search provider does)
* do you need the full interface (including calculations history, buttons) - 
this is harder to do, calculator is not designed to do this, as this seems to 
me like a very rare usecase. Feel free to contact me for more details on how 
and what.

I'm also interested in other people's ideas and suggestions (as a more generic 
topic) on embedding an applications UI in another's one, e.g. GtkSocket/GtkPlug 
and/or other solutions.

Regards,
Robert

On Wed, Mar 22, 2017 at 11:28 AM Rúben Rodrigues 
<ruben...@live.com.pt<mailto:ruben...@live.com.pt>> wrote:
Hi guys,

I need to add to my app a calculator. It's possible to add
gnome-calculator as child of a container in my app?

Thanks

Ruben


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org<mailto:gtk-app-devel-list@gnome.org>
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

How use gnome-calculator in my gtk+ app

2017-03-22 Thread Rúben Rodrigues
Hi guys,

I need to add to my app a calculator. It's possible to add 
gnome-calculator as child of a container in my app?

Thanks

Ruben


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Detect user idle time or inactivity

2017-03-20 Thread Rúben Rodrigues
Hi guys,

There is any way to detect user inactivity in my application?

Thanks

Ruben

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: on screen keyboard error with gtk_main_do_event

2017-03-18 Thread Rúben Rodrigues
Someone could help me?

Thanks


On 16-03-2017 16:54, Ruben ROdrigues wrote:
> HI guys,
>
> I have a on-screen keyboard that was made for gtk2. Now in gtk3 i get 
> this errors:
>
> Gdk-CRITICAL **: gdk_window_get_user_data: assertion 'GDK_IS_WINDOW 
> (window)' failed
>
> Gdk-CRITICAL **: gdk_window_get_display: assertion 'GDK_IS_WINDOW 
> (window)' failed
>
>  Gdk-WARNING **: Event with type 8 not holding a GdkDevice. It is most 
> likely synthesized outside Gdk/GTK+
>
>
>  Gdk-CRITICAL **: gdk_window_get_display: assertion 'GDK_IS_WINDOW 
> (window)' failed
>
> Gdk-CRITICAL **: gdk_display_get_device_manager: assertion 
> 'GDK_IS_DISPLAY (display)' failed
>
> Gdk-CRITICAL **: gdk_device_manager_get_client_pointer: assertion 
> 'GDK_IS_DEVICE_MANAGER (device_manager)' failed
>
> Gdk-CRITICAL **: gdk_device_get_associated_device: assertion 
> 'GDK_IS_DEVICE (device)' failed
>
>  Gdk-CRITICAL **: gdk_device_grab_info_libgtk_only: assertion 
> 'GDK_IS_DISPLAY (display)' failed
>
>
> This appears in this line of code : gtk_main_do_event(pxEvent);
>
> Here is complete code:
>
>
> void on_Keypad_button_clicked(GtkButton *button, gpointer data)
> {
> GdkEvent*pxEvent = NULL;
>
> GdkKeymapKey*keys;
> gintiNkeys;
>
> guintcKey;
>
> GtkEntryBuffer*pxBuffer;
>
>
> struct xParam_Widget_Keycode*pxData;
>
> pxData = (struct xParam_Widget_Keycode *)data;
>
> switch(cKey = pxData->iKeyCode) {
> case GDK_KEY_BackSpace:
> pxBuffer = gtk_entry_get_buffer(GTK_ENTRY(pxData->pxWidget));
> gtk_entry_buffer_delete_text(pxBuffer, 
> gtk_entry_buffer_get_length(pxBuffer) - 1, -1);
> break;
> default:
> pxEvent = gdk_event_new(GDK_KEY_PRESS);
> if(gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), cKey, 
> , )) {
> pxEvent->key.hardware_keycode = keys[0].keycode;
> pxEvent->key.group = keys[0].group;
> g_free(keys);
> pxEvent->key.keyval = gdk_unicode_to_keyval(cKey);
> } else {
> pxEvent->key.keyval = cKey;
> }
>
> pxEvent->key.window = g_object_ref(gtk_widget_get_screen 
> (pxData->pxWidget));
> pxEvent->key.state = 0;
>
> pxEvent->key.send_event = FALSE;
> pxEvent->key.time = GDK_CURRENT_TIME;
>
> gtk_main_do_event(pxEvent);
> pxEvent->key.type = GDK_KEY_RELEASE;
> gtk_main_do_event(pxEvent);
> gdk_event_free(pxEvent);
> }
> }
>
> Thanks
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
Thanks! In some containers we can't change color of label? I have labels 
inside GtkLayout, and don't change color with Css but other labels out 
of this layout change.

Why don't works?

I do this dynamically but don't works too:

GtkCssProvider *css_provider = gtk_css_provider_new();
 gtk_css_provider_load_from_data (css_provider,
  "#label_Sensors {"
  "  color: red;"
  "}",
  -1,
  NULL);
 gtk_style_context_add_provider 
(gtk_widget_get_style_context(gtk_builder_get_object(builder,"Home_Sensors_Spare_window")),
 GTK_STYLE_PROVIDER (css_provider),
GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 g_object_unref(css_provider);




On 16-03-2017 10:23, Stefan Salewski wrote:
> On Thu, 2017-03-16 at 09:55 +, Rúben Rodrigues wrote:
>> Hi,
>>
>> THanks. This is dynamically? I need in c language if possible :S
>>
>> Thanks
> Yes. The example
>
> https://github.com/ngtk3/nim-gtk3/blob/master/test/colors.nim
>
> is dynamically, I used it to generate some color schemes. Entered color
> hex value in a text entry widget, and that color was applied.
>
> As I said, it was working for 3.18. I think for 3.20 and above some CSS
> names have changed, I had not the time to really investigate that.
>
> I have no C code currently, I think my Nim code was inspired by Python
> code, but I have no link to that python code currently. For C it is the
> same pattern -- generate a CSS string and apply it.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

on screen keyboard error with gtk_main_do_event

2017-03-16 Thread Rúben Rodrigues
HI guys,

I have a on-screen keyboard that was made for gtk2. Now in gtk3 i get 
this errors:

Gdk-CRITICAL **: gdk_window_get_user_data: assertion 'GDK_IS_WINDOW 
(window)' failed

Gdk-CRITICAL **: gdk_window_get_display: assertion 'GDK_IS_WINDOW 
(window)' failed

  Gdk-WARNING **: Event with type 8 not holding a GdkDevice. It is most 
likely synthesized outside Gdk/GTK+


  Gdk-CRITICAL **: gdk_window_get_display: assertion 'GDK_IS_WINDOW 
(window)' failed

Gdk-CRITICAL **: gdk_display_get_device_manager: assertion 
'GDK_IS_DISPLAY (display)' failed

Gdk-CRITICAL **: gdk_device_manager_get_client_pointer: assertion 
'GDK_IS_DEVICE_MANAGER (device_manager)' failed

Gdk-CRITICAL **: gdk_device_get_associated_device: assertion 
'GDK_IS_DEVICE (device)' failed

  Gdk-CRITICAL **: gdk_device_grab_info_libgtk_only: assertion 
'GDK_IS_DISPLAY (display)' failed


This appears in this line of code : gtk_main_do_event(pxEvent);

Here is complete code:


void on_Keypad_button_clicked(GtkButton *button, gpointer data)
{
 GdkEvent*pxEvent = NULL;

 GdkKeymapKey*keys;
 gintiNkeys;

 guintcKey;

 GtkEntryBuffer*pxBuffer;


 struct xParam_Widget_Keycode*pxData;

 pxData = (struct xParam_Widget_Keycode *)data;

 switch(cKey = pxData->iKeyCode) {
 case GDK_KEY_BackSpace:
 pxBuffer = gtk_entry_get_buffer(GTK_ENTRY(pxData->pxWidget));
 gtk_entry_buffer_delete_text(pxBuffer, 
gtk_entry_buffer_get_length(pxBuffer) - 1, -1);
 break;
 default:
 pxEvent = gdk_event_new(GDK_KEY_PRESS);
if(gdk_keymap_get_entries_for_keyval(gdk_keymap_get_default(), cKey, 
, )) {
 pxEvent->key.hardware_keycode = keys[0].keycode;
 pxEvent->key.group = keys[0].group;
 g_free(keys);
 pxEvent->key.keyval = gdk_unicode_to_keyval(cKey);
 } else {
 pxEvent->key.keyval = cKey;
 }

 pxEvent->key.window = g_object_ref(gtk_widget_get_screen 
(pxData->pxWidget));
 pxEvent->key.state = 0;

 pxEvent->key.send_event = FALSE;
 pxEvent->key.time = GDK_CURRENT_TIME;

 gtk_main_do_event(pxEvent);
 pxEvent->key.type = GDK_KEY_RELEASE;
 gtk_main_do_event(pxEvent);
 gdk_event_free(pxEvent);
 }
}

Thanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
You are right. I don't know why don't works before, because I had 
already tested and doesn't work... BU apparently now works with 
gdk_screen_get_default();

THanks for your help.



On 16-03-2017 14:07, Tilo Villwock wrote:
> Am Donnerstag, den 16.03.2017, 13:50 + schrieb Rúben Rodrigues:
>> I get this error:
>>
>> gtk-CRITICAL **: gtk_style_context_add_provider_for_screen:
>> assertion
>> 'GDK_IS_SCREEN (screen)' failed
>>
>> COde:
>> gtk_style_context_add_provider_for_screen(gtk_widget_get_style_contex
>> t(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
>>   GTK_STYLE_PROVIDER (css_provider),
>>   G_MAXUINT);
> Of course you do. The first argument is meant to be a GdkScreen object.
> Which makes me wonder if you even read the documentation. Anyways, you
> can obtain the object by invoking
>
>  gdk_screen_get_default()
>
> and the last argument is supposed to be a priority constant like
>
>  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION
>
> Look them up. I'd also recommend installing devhelp and gtk3-docs if
> you haven't already.
>
> --Tilo

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
OK, now works:

 if(css_provider == NULL){
 css_provider = gtk_css_provider_new();

apply_css(gtk_builder_get_object(builder,"window_Main"),css_provider);
 g_object_unref(css_provider);

 }
 gtk_css_provider_load_from_data (css_provider,"#label_Sensors { 
color: red; }",-1,NULL);


static void apply_css(GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider(gtk_widget_get_style_context(widget), 
GTK_STYLE_PROVIDER(provider),G_MAXUINT);
 if(GTK_IS_CONTAINER(widget))
 gtk_container_forall(GTK_CONTAINER(widget),(GtkCallback) 
apply_css,provider);

}

I need to create a different selector for each of label that i want to 
change to red color?


On 16-03-2017 13:19, Emmanuele Bassi wrote:
> You keep using an id in the selector, but you never show how you set
> the id on the widget. I suspect you think the buildable ID you use
> with GtkBuilder is also the ID used when theming — which is definitely
> not the case. You will need gtk_widget_set_name(), instead. Of course,
> that comes with its own set of caveats, most importantly: there's no
> uniqueness of widget name enforced by GTK+ itself.
>
> If you want to avoid all of this, use a CSS class; you can add a class
> programmatically using gtk_style_context_add_class() or you can
> specify the class in the GtkBuilder XML file.
>
> Ciao,
>   Emmanuele.
>
>
> On 16 March 2017 at 12:49, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> I provide my code in previous emails.
>>
>> This is my code now:
>>
>> if(css_provider == NULL){
>>   css_provider = gtk_css_provider_new();
>>
>>   gtk_style_context_add_provider
>> (gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
>>   GTK_STYLE_PROVIDER (css_provider),
>>   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>>   g_object_unref(css_provider);
>>
>>   }
>>   gtk_css_provider_load_from_data (css_provider,"#label_Sensors {
>> color: red; }",-1,NULL);
>>
>>
>> On 16-03-2017 12:41, Tilo Villwock wrote:
>>> Am Donnerstag, den 16.03.2017, 11:58 + schrieb Rúben Rodrigues:
>>>> Hi,
>>>>
>>>> This is what i have, and don't works...
>>> The code I provided works. What GTK3 version are you using? Also nobody
>>> will be able to help you if you don't show us your code.
>>>
>>> --Tilo
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
I get this error:

gtk-CRITICAL **: gtk_style_context_add_provider_for_screen: assertion 
'GDK_IS_SCREEN (screen)' failed

COde: 
gtk_style_context_add_provider_for_screen(gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
 GTK_STYLE_PROVIDER (css_provider),
 G_MAXUINT);

On 16-03-2017 13:19, Tilo Villwock wrote:
> Am Donnerstag, den 16.03.2017, 12:49 + schrieb Rúben Rodrigues:
>> I provide my code in previous emails.
>>
>> This is my code now:
>>
>> if(css_provider == NULL){
>>   css_provider = gtk_css_provider_new();
>>
>>   gtk_style_context_add_provider
>> (gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(build
>> er,"window_Main"))),
>>   GTK_STYLE_PROVIDER (css_provider),
>>   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>>   g_object_unref(css_provider);
>>
>>   }
>>   gtk_css_provider_load_from_data (css_provider,"#label_Sensors {
>> color: red; }",-1,NULL);
> My apologies. You are right. I missed the earlier one. However, quoting
> the documentation for gtk_style_context_add_provider:
>
> "Note that a style provider added by this function only affects the
> style of the widget to which context belongs. If you want to affect the
> style of all widgets, use gtk_style_context_add_provider_for_screen()."
>
> I'm guessing `window_Main` is a window? So either you attach the
> provider to all the labels you want to change or you use
> gtk_style_context_add_provider_for_screen.
>
> Hope that helps.
>
> --Tilo

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
No! This is the ID: https://ibin.co/3FlPSBGuokBB.png

and this is the widget name https://ibin.co/3FlPnPaDN7Zl.png that i used 
in css provider. This is not the problem because in start of the program 
i change the label to other color to understand if css provider is 
working. And works, but when i tried in the middle of the code change 
again with this code don't works..

How can i add a Css class? How it works? I tried insert style classes in 
glade, but the value that i write disappear.

Thanks


On 16-03-2017 13:19, Emmanuele Bassi wrote:
> You keep using an id in the selector, but you never show how you set
> the id on the widget. I suspect you think the buildable ID you use
> with GtkBuilder is also the ID used when theming — which is definitely
> not the case. You will need gtk_widget_set_name(), instead. Of course,
> that comes with its own set of caveats, most importantly: there's no
> uniqueness of widget name enforced by GTK+ itself.
>
> If you want to avoid all of this, use a CSS class; you can add a class
> programmatically using gtk_style_context_add_class() or you can
> specify the class in the GtkBuilder XML file.
>
> Ciao,
>   Emmanuele.
>
>
> On 16 March 2017 at 12:49, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> I provide my code in previous emails.
>>
>> This is my code now:
>>
>> if(css_provider == NULL){
>>   css_provider = gtk_css_provider_new();
>>
>>   gtk_style_context_add_provider
>> (gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
>>   GTK_STYLE_PROVIDER (css_provider),
>>   GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>>   g_object_unref(css_provider);
>>
>>   }
>>   gtk_css_provider_load_from_data (css_provider,"#label_Sensors {
>> color: red; }",-1,NULL);
>>
>>
>> On 16-03-2017 12:41, Tilo Villwock wrote:
>>> Am Donnerstag, den 16.03.2017, 11:58 + schrieb Rúben Rodrigues:
>>>> Hi,
>>>>
>>>> This is what i have, and don't works...
>>> The code I provided works. What GTK3 version are you using? Also nobody
>>> will be able to help you if you don't show us your code.
>>>
>>> --Tilo
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
I provide my code in previous emails.

This is my code now:

if(css_provider == NULL){
 css_provider = gtk_css_provider_new();

 gtk_style_context_add_provider 
(gtk_widget_get_style_context(GTK_WIDGET(gtk_builder_get_object(builder,"window_Main"))),
 GTK_STYLE_PROVIDER (css_provider),
 GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
 g_object_unref(css_provider);

 }
 gtk_css_provider_load_from_data (css_provider,"#label_Sensors { 
color: red; }",-1,NULL);


On 16-03-2017 12:41, Tilo Villwock wrote:
> Am Donnerstag, den 16.03.2017, 11:58 + schrieb Rúben Rodrigues:
>> Hi,
>>
>> This is what i have, and don't works...
> The code I provided works. What GTK3 version are you using? Also nobody
> will be able to help you if you don't show us your code.
>
> --Tilo

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
Hi,

This is what i have, and don't works...


On 16-03-2017 11:20, Tilo Villwock wrote:
> Am Donnerstag, den 16.03.2017, 09:55 + schrieb Rúben Rodrigues:
>> Hi,
>>
>> THanks. This is dynamically? I need in c language if possible :S
> Dynamic version:
>
> ...
>
> static GtkCssProvider* provider = NULL;
>
> static void
> set_label_color(GtkWidget* label, const char* color)
> {
>  const char* format = "label { color: %s; }";
>  size_t length = strlen(format) - 2 + 1;
>  char style[length];
>  sprintf(style, format, color);
>
>  if (provider == NULL) {
>  /* only create and add the provider the first time */
>  provider = gtk_css_provider_new();
>  gtk_style_context_add_provider(
>  gtk_widget_get_style_context(label),
>  GTK_STYLE_PROVIDER(provider),
>  GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>  g_object_unref(provider);
>  }
>
>  gtk_css_provider_load_from_data(provider, style, -1, NULL);
> }
>
> ...
>
> This might not be ideal in all situations. Just make sure you don't
> create a new provider everytime you set a new color. Hope that helps.
>
> --Tilo

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
Please help me. I don't see nothing with web to change label color 
dynamically but i need this urgent

THanks again!


On 16-03-2017 09:55, Rúben Rodrigues wrote:
> Hi,
>
> THanks. This is dynamically? I need in c language if possible :S
>
> Thanks
>
>
> On 16-03-2017 07:29, Stefan Salewski wrote:
>> On Wed, 2017-03-15 at 15:11 +, Rúben Rodrigues wrote:
>>> Hi,
>>>
>>> Now i need to change GtkLabel color dinamically, so i thing that i
>>> can't
>>> use Css to do this.. I do this in Gtk2:
>>>
>>> gtk_widget_modify_fg(GTK_WIDGET(gtk_builder_get_object(builder,"label
>>> ")),GTK_STATE_NORMAL,
>>> );
>>>
>>> How can i change the color in Gtk3?
>>>
>>>
>> You can do it with CSS. But it has changed a bit for 3.20. You may
>> compare this thread:
>>
>> https://mail.gnome.org/archives/gtk-list/2016-November/msg6.html
>>
>> Well, that was not for label widget, but for tooltip. But label widget
>> should behave similar. And with similar code I once set foreground and
>> background for button widgets -- I had that working for 3.18, but I
>> have not yet fixed that for 3.20. (https://github.com/ngtk3/nim-gtk3/bl
>> ob/master/test/colors.nim)
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: How to change GTK+3 label color dynamically

2017-03-16 Thread Rúben Rodrigues
Hi,

THanks. This is dynamically? I need in c language if possible :S

Thanks


On 16-03-2017 07:29, Stefan Salewski wrote:
> On Wed, 2017-03-15 at 15:11 +0000, Rúben Rodrigues wrote:
>> Hi,
>>
>> Now i need to change GtkLabel color dinamically, so i thing that i
>> can't
>> use Css to do this.. I do this in Gtk2:
>>
>> gtk_widget_modify_fg(GTK_WIDGET(gtk_builder_get_object(builder,"label
>> ")),GTK_STATE_NORMAL,
>> );
>>
>> How can i change the color in Gtk3?
>>
>>   
> You can do it with CSS. But it has changed a bit for 3.20. You may
> compare this thread:
>
> https://mail.gnome.org/archives/gtk-list/2016-November/msg6.html
>
> Well, that was not for label widget, but for tooltip. But label widget
> should behave similar. And with similar code I once set foreground and
> background for button widgets -- I had that working for 3.18, but I
> have not yet fixed that for 3.20. (https://github.com/ngtk3/nim-gtk3/bl
> ob/master/test/colors.nim)

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

How to change GTK+3 label color dynamically

2017-03-15 Thread Rúben Rodrigues
Hi,

Now i need to change GtkLabel color dinamically, so i thing that i can't 
use Css to do this.. I do this in Gtk2:

gtk_widget_modify_fg(GTK_WIDGET(gtk_builder_get_object(builder,"label")),GTK_STATE_NORMAL,
 
);

How can i change the color in Gtk3?

Thanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk3 layout background image

2017-03-15 Thread Rúben Rodrigues
Hi again,

I tested with GtkBox and don't works.. My code is correct?

GFile *file= g_file_new_for_path("custom.css");
 GtkStyleProvider *css_provider = 
GTK_STYLE_PROVIDER(gtk_css_provider_new());
gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(css_provider), file, 
);
 gtk_style_context_reset_widgets(gdk_screen_get_default());

custom.css:

GtkBox#Home_PrincipalScreen_table.background{
 background-image: url('background.png');
}

GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
 color: white;
}

GtkLabel#Home_Sensors_MoistAvg_value{
 font-family: Segoe UI;
 font-weight: lighter;
 font-size: 25px;
}


Thanks


On 14-03-2017 14:46, Emmanuele Bassi wrote:
> On 14 March 2017 at 14:31, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Just window can have background?
> I was referring to GdkWindow, not GtkWindow.
>
> GtkBox draws background, for instance; GtkGrid does as well.
>
>> I don't know why is a violation, because in my case my
>> applicationdoesn't make sense without background image..
> I think the issue, here, is that you're not aware that 15 years passed
> in the internals of GTK+.
>
> Changing the background pixmap of a GdkWindow is a layering violation
> because it assumes that you're essentially working on X11 and you
> control the X server as well; on X11, you're telling the X server to
> clear the contents of the native window used by GtkLayout using the
> bytes you're passing. This worked in 1997, but it's not how modern
> toolkits work — and it's not even how different windowing systems
> work. Widgets do not have their own native window for rendering any
> more, for instance.
>
> If your application window has a background image then use the
> background-image CSS property on your GtkWindow widget.
>
> Ciao,
>   Emmanuele.
>
>> On 14-03-2017 14:01, Emmanuele Bassi wrote:
>>> You were not changing the background with your theme: you were
>>> programmatically replacing the base pixmap of the GdkWindow used by
>>> GtkLayout. It was essentially a layering violation, and would actually
>>> break your theme.
>>>
>>> The API reference for each GTK widget should tell you the CSS styling
>>> available; see the "CSS nodes" section, for instance, of GtkBox:
>>> https://developer.gnome.org/gtk3/stable/GtkBox.html
>>>
>>> Ciao,
>>>Emmanuele.
>>>
>>>
>>> On 14 March 2017 at 13:55, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>> Thanks!
>>>>
>>>> But in GTK+2 we could change background in layout with this:
>>>>
>>>> // Set picture as background.
>>>> //gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>>>> //style = gtk_style_new ();
>>>> //style->bg_pixmap[0] = background;
>>>> //homeWindow = GTK_WIDGET(gtk_builder_get_object(builder,
>>>> "layout_Home"));
>>>> //gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));
>>>>
>>>> How i know witch containers draw background?
>>>>
>>>> THanks
>>>>
>>>>
>>>> On 14-03-2017 12:55, Emmanuele Bassi wrote:
>>>>> Not all GTK containers draw a background, mostly for historical
>>>>> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>>>>>
>>>>> In particular, GtkLayout does not draw any background with CSS, so you
>>>>> will need to either subclass GtkLayout, override the GtkWidget::draw
>>>>> virtual function, and call gtk_render_* functions yourself; or you
>>>>> will need to put a GtkLayout into a parent container that does draw a
>>>>> background. You will, of course, need to style the parent container's
>>>>> background, not the GtkLayout itself.
>>>>>
>>>>> Ciao,
>>>>> Emmanuele.
>>>>>
>>>>>
>>>>> On 14 March 2017 at 12:43, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>>>> I verify that i can't use css provider, don't works.
>>>>>>
>>>>>> My css file is :
>>>>>>
>>>>>> GtkLayout#layout_Home.background{
>>>>>> background-image: url('background.png');
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
>>>>>> color: white;
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Sensors_MoistAvg_value{
>>>

Re: gtk3 layout background image

2017-03-15 Thread Rúben Rodrigues
Thanks, it works!


On 15-03-2017 12:49, mhora...@gmail.com wrote:
> You need to give the widget a "name" property - than you can select it
> in CSS!
>
> Best,
> Martin
>
> On Wed, 2017-03-15 at 10:28 +, Rúben Rodrigues wrote:
>> Hi,
>>
>> I see now, that the problem i'm not do in correct mode. I do this:
>>
>> GtkButton{
>>
>>   color: blue;
>> }
>>
>> and works. All buttons change to blue color. But when i'm changing a
>> specific label or GtkBox to put background i do this:
>>
>> GtkLabel#label_Avg_Temp_value{
>>   color: red;
>>   font-family: Segoe UI;
>>   font-size: 25px;
>> }
>>
>> And don't change label_Avg_Temp_value . What is the correct way to
>> change a specific widget?
>>
>> Thanks
>>
>>
>> Às 14:46 de 14/03/2017, Emmanuele Bassi escreveu:
>>> On 14 March 2017 at 14:31, Rúben Rodrigues <ruben...@live.com.pt>
>>> wrote:
>>>> Just window can have background?
>>> I was referring to GdkWindow, not GtkWindow.
>>>
>>> GtkBox draws background, for instance; GtkGrid does as well.
>>>
>>>> I don't know why is a violation, because in my case my
>>>> applicationdoesn't make sense without background image..
>>> I think the issue, here, is that you're not aware that 15 years
>>> passed
>>> in the internals of GTK+.
>>>
>>> Changing the background pixmap of a GdkWindow is a layering
>>> violation
>>> because it assumes that you're essentially working on X11 and you
>>> control the X server as well; on X11, you're telling the X server
>>> to
>>> clear the contents of the native window used by GtkLayout using the
>>> bytes you're passing. This worked in 1997, but it's not how modern
>>> toolkits work — and it's not even how different windowing systems
>>> work. Widgets do not have their own native window for rendering any
>>> more, for instance.
>>>
>>> If your application window has a background image then use the
>>> background-image CSS property on your GtkWindow widget.
>>>
>>> Ciao,
>>>Emmanuele.
>>>
>>>> On 14-03-2017 14:01, Emmanuele Bassi wrote:
>>>>> You were not changing the background with your theme: you were
>>>>> programmatically replacing the base pixmap of the GdkWindow
>>>>> used by
>>>>> GtkLayout. It was essentially a layering violation, and would
>>>>> actually
>>>>> break your theme.
>>>>>
>>>>> The API reference for each GTK widget should tell you the CSS
>>>>> styling
>>>>> available; see the "CSS nodes" section, for instance, of
>>>>> GtkBox:
>>>>> https://developer.gnome.org/gtk3/stable/GtkBox.html
>>>>>
>>>>> Ciao,
>>>>> Emmanuele.
>>>>>
>>>>>
>>>>> On 14 March 2017 at 13:55, Rúben Rodrigues <ruben...@live.com.p
>>>>> t> wrote:
>>>>>> Thanks!
>>>>>>
>>>>>> But in GTK+2 we could change background in layout with this:
>>>>>>
>>>>>> // Set picture as background.
>>>>>> //gdk_pixbuf_render_pixmap_and_mask (pixbuf,
>>>>>> , NULL, 0);
>>>>>> //style = gtk_style_new ();
>>>>>> //style->bg_pixmap[0] = background;
>>>>>> //homeWindow =
>>>>>> GTK_WIDGET(gtk_builder_get_object(builder,
>>>>>> "layout_Home"));
>>>>>> //gtk_widget_set_style (GTK_WIDGET(homeWindow),
>>>>>> GTK_STYLE(style));
>>>>>>
>>>>>> How i know witch containers draw background?
>>>>>>
>>>>>> THanks
>>>>>>
>>>>>>
>>>>>> On 14-03-2017 12:55, Emmanuele Bassi wrote:
>>>>>>> Not all GTK containers draw a background, mostly for
>>>>>>> historical
>>>>>>> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>>>>>>>
>>>>>>> In particular, GtkLayout does not draw any background with
>>>>>>> CSS, so you
>>>>>>> will need to either subclass GtkLayout, override the
>>>>>>> GtkWidget::draw
>>>>>>> virtual function, and call

Re: gtk3 layout background image

2017-03-15 Thread Rúben Rodrigues
Hi,

I see now, that the problem i'm not do in correct mode. I do this:

GtkButton{

 color: blue;
}

and works. All buttons change to blue color. But when i'm changing a 
specific label or GtkBox to put background i do this:

GtkLabel#label_Avg_Temp_value{
 color: red;
 font-family: Segoe UI;
 font-size: 25px;
}

And don't change label_Avg_Temp_value . What is the correct way to 
change a specific widget?

Thanks


Às 14:46 de 14/03/2017, Emmanuele Bassi escreveu:
> On 14 March 2017 at 14:31, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Just window can have background?
> I was referring to GdkWindow, not GtkWindow.
>
> GtkBox draws background, for instance; GtkGrid does as well.
>
>> I don't know why is a violation, because in my case my
>> applicationdoesn't make sense without background image..
> I think the issue, here, is that you're not aware that 15 years passed
> in the internals of GTK+.
>
> Changing the background pixmap of a GdkWindow is a layering violation
> because it assumes that you're essentially working on X11 and you
> control the X server as well; on X11, you're telling the X server to
> clear the contents of the native window used by GtkLayout using the
> bytes you're passing. This worked in 1997, but it's not how modern
> toolkits work — and it's not even how different windowing systems
> work. Widgets do not have their own native window for rendering any
> more, for instance.
>
> If your application window has a background image then use the
> background-image CSS property on your GtkWindow widget.
>
> Ciao,
>   Emmanuele.
>
>> On 14-03-2017 14:01, Emmanuele Bassi wrote:
>>> You were not changing the background with your theme: you were
>>> programmatically replacing the base pixmap of the GdkWindow used by
>>> GtkLayout. It was essentially a layering violation, and would actually
>>> break your theme.
>>>
>>> The API reference for each GTK widget should tell you the CSS styling
>>> available; see the "CSS nodes" section, for instance, of GtkBox:
>>> https://developer.gnome.org/gtk3/stable/GtkBox.html
>>>
>>> Ciao,
>>>Emmanuele.
>>>
>>>
>>> On 14 March 2017 at 13:55, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>> Thanks!
>>>>
>>>> But in GTK+2 we could change background in layout with this:
>>>>
>>>> // Set picture as background.
>>>> //gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>>>> //style = gtk_style_new ();
>>>> //style->bg_pixmap[0] = background;
>>>> //homeWindow = GTK_WIDGET(gtk_builder_get_object(builder,
>>>> "layout_Home"));
>>>> //gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));
>>>>
>>>> How i know witch containers draw background?
>>>>
>>>> THanks
>>>>
>>>>
>>>> On 14-03-2017 12:55, Emmanuele Bassi wrote:
>>>>> Not all GTK containers draw a background, mostly for historical
>>>>> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>>>>>
>>>>> In particular, GtkLayout does not draw any background with CSS, so you
>>>>> will need to either subclass GtkLayout, override the GtkWidget::draw
>>>>> virtual function, and call gtk_render_* functions yourself; or you
>>>>> will need to put a GtkLayout into a parent container that does draw a
>>>>> background. You will, of course, need to style the parent container's
>>>>> background, not the GtkLayout itself.
>>>>>
>>>>> Ciao,
>>>>> Emmanuele.
>>>>>
>>>>>
>>>>> On 14 March 2017 at 12:43, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>>>> I verify that i can't use css provider, don't works.
>>>>>>
>>>>>> My css file is :
>>>>>>
>>>>>> GtkLayout#layout_Home.background{
>>>>>> background-image: url('background.png');
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
>>>>>> color: white;
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Sensors_MoistAvg_value{
>>>>>> font-family: Segoe UI;
>>>>>> font-weight: lighter;
>>>>>> font-size: 25px;
>>>>>> }
>>>>>>
>>>>&g

Re: gtk3 layout background image

2017-03-14 Thread Rúben Rodrigues
Thanks again!

So, i will test with gtkbox. thanks for explanation..


Às 14:46 de 14/03/2017, Emmanuele Bassi escreveu:
> On 14 March 2017 at 14:31, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Just window can have background?
> I was referring to GdkWindow, not GtkWindow.
>
> GtkBox draws background, for instance; GtkGrid does as well.
>
>> I don't know why is a violation, because in my case my
>> applicationdoesn't make sense without background image..
> I think the issue, here, is that you're not aware that 15 years passed
> in the internals of GTK+.
>
> Changing the background pixmap of a GdkWindow is a layering violation
> because it assumes that you're essentially working on X11 and you
> control the X server as well; on X11, you're telling the X server to
> clear the contents of the native window used by GtkLayout using the
> bytes you're passing. This worked in 1997, but it's not how modern
> toolkits work — and it's not even how different windowing systems
> work. Widgets do not have their own native window for rendering any
> more, for instance.
>
> If your application window has a background image then use the
> background-image CSS property on your GtkWindow widget.
>
> Ciao,
>   Emmanuele.
>
>> On 14-03-2017 14:01, Emmanuele Bassi wrote:
>>> You were not changing the background with your theme: you were
>>> programmatically replacing the base pixmap of the GdkWindow used by
>>> GtkLayout. It was essentially a layering violation, and would actually
>>> break your theme.
>>>
>>> The API reference for each GTK widget should tell you the CSS styling
>>> available; see the "CSS nodes" section, for instance, of GtkBox:
>>> https://developer.gnome.org/gtk3/stable/GtkBox.html
>>>
>>> Ciao,
>>>Emmanuele.
>>>
>>>
>>> On 14 March 2017 at 13:55, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>> Thanks!
>>>>
>>>> But in GTK+2 we could change background in layout with this:
>>>>
>>>> // Set picture as background.
>>>> //gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>>>> //style = gtk_style_new ();
>>>> //style->bg_pixmap[0] = background;
>>>> //homeWindow = GTK_WIDGET(gtk_builder_get_object(builder,
>>>> "layout_Home"));
>>>> //gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));
>>>>
>>>> How i know witch containers draw background?
>>>>
>>>> THanks
>>>>
>>>>
>>>> On 14-03-2017 12:55, Emmanuele Bassi wrote:
>>>>> Not all GTK containers draw a background, mostly for historical
>>>>> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>>>>>
>>>>> In particular, GtkLayout does not draw any background with CSS, so you
>>>>> will need to either subclass GtkLayout, override the GtkWidget::draw
>>>>> virtual function, and call gtk_render_* functions yourself; or you
>>>>> will need to put a GtkLayout into a parent container that does draw a
>>>>> background. You will, of course, need to style the parent container's
>>>>> background, not the GtkLayout itself.
>>>>>
>>>>> Ciao,
>>>>> Emmanuele.
>>>>>
>>>>>
>>>>> On 14 March 2017 at 12:43, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>>>> I verify that i can't use css provider, don't works.
>>>>>>
>>>>>> My css file is :
>>>>>>
>>>>>> GtkLayout#layout_Home.background{
>>>>>> background-image: url('background.png');
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
>>>>>> color: white;
>>>>>> }
>>>>>>
>>>>>> GtkLabel#Home_Sensors_MoistAvg_value{
>>>>>> font-family: Segoe UI;
>>>>>> font-weight: lighter;
>>>>>> font-size: 25px;
>>>>>> }
>>>>>>
>>>>>> And this code:
>>>>>>
>>>>>> static void apply_css(GtkWidget *widget, GtkStyleProvider *provider)
>>>>>> {
>>>>>> gtk_style_context_add_provider(gtk_widget_get_style_context(widget),
>>>>>> GTK_STYLE_PROVIDER(provider),G_MAXUINT);
>>>&

Re: gtk3 layout background image

2017-03-14 Thread Rúben Rodrigues
Just window can have background?

I don't know why is a violation, because in my case my 
applicationdoesn't make sense without background image..


On 14-03-2017 14:01, Emmanuele Bassi wrote:
> You were not changing the background with your theme: you were
> programmatically replacing the base pixmap of the GdkWindow used by
> GtkLayout. It was essentially a layering violation, and would actually
> break your theme.
>
> The API reference for each GTK widget should tell you the CSS styling
> available; see the "CSS nodes" section, for instance, of GtkBox:
> https://developer.gnome.org/gtk3/stable/GtkBox.html
>
> Ciao,
>   Emmanuele.
>
>
> On 14 March 2017 at 13:55, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Thanks!
>>
>> But in GTK+2 we could change background in layout with this:
>>
>> // Set picture as background.
>> //gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>> //style = gtk_style_new ();
>> //style->bg_pixmap[0] = background;
>> //homeWindow = GTK_WIDGET(gtk_builder_get_object(builder,
>> "layout_Home"));
>> //gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));
>>
>> How i know witch containers draw background?
>>
>> THanks
>>
>>
>> On 14-03-2017 12:55, Emmanuele Bassi wrote:
>>> Not all GTK containers draw a background, mostly for historical
>>> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>>>
>>> In particular, GtkLayout does not draw any background with CSS, so you
>>> will need to either subclass GtkLayout, override the GtkWidget::draw
>>> virtual function, and call gtk_render_* functions yourself; or you
>>> will need to put a GtkLayout into a parent container that does draw a
>>> background. You will, of course, need to style the parent container's
>>> background, not the GtkLayout itself.
>>>
>>> Ciao,
>>>Emmanuele.
>>>
>>>
>>> On 14 March 2017 at 12:43, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>>>> I verify that i can't use css provider, don't works.
>>>>
>>>> My css file is :
>>>>
>>>> GtkLayout#layout_Home.background{
>>>>background-image: url('background.png');
>>>> }
>>>>
>>>> GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
>>>>color: white;
>>>> }
>>>>
>>>> GtkLabel#Home_Sensors_MoistAvg_value{
>>>>font-family: Segoe UI;
>>>>font-weight: lighter;
>>>>font-size: 25px;
>>>> }
>>>>
>>>> And this code:
>>>>
>>>> static void apply_css(GtkWidget *widget, GtkStyleProvider *provider)
>>>> {
>>>> gtk_style_context_add_provider(gtk_widget_get_style_context(widget),
>>>> GTK_STYLE_PROVIDER(provider),G_MAXUINT);
>>>>if(GTK_IS_CONTAINER(widget))
>>>>gtk_container_forall(GTK_CONTAINER(widget),(GtkCallback)
>>>> apply_css,provider);
>>>>
>>>> }
>>>>
>>>> GFile *file= g_file_new_for_path("custom.css");
>>>>GtkStyleProvider *css_provider =
>>>> GTK_STYLE_PROVIDER(gtk_css_provider_new());
>>>> gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(css_provider), file,
>>>> );
>>>> apply_css(gtk_builder_get_object(builder,"window_Main"),css_provider);
>>>>
>>>> This is the code used in gtk3-demo and don't works for me.. Why
>>>>
>>>> THanks
>>>>
>>>> On 14-03-2017 10:00, Rúben Rodrigues wrote:
>>>>> Hi guys,
>>>>>
>>>>> Finnaly i migrate my application to gtk+3. So, now i neet to change some
>>>>> things like image background. I used css provider like in this :
>>>>>
>>>>> custom.css file:
>>>>>
>>>>> GtkLayout:layout_Home{
>>>>> background-color: black;
>>>>> }
>>>>>
>>>>>
>>>>> C Program:
>>>>>
>>>>> GFile *file= g_file_new_for_path("custom.css");
>>>>> GtkCssProvider *css_provider = gtk_css_provider_get_default();
>>>>> gtk_css_provider_load_from_file(css_provider, file, );
>>>>> GtkStyleContext *context = gtk_style_context_new();
>>>>> gtk_style_context_add_provider(context,
>>>>> GTK_STYLE_PROVIDER(css_provider),GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>>>>>
>>>>> But nothing happens. I tried this too:
>>>>>
>>>>> http://stackoverflow.com/questions/7375624/gtk3-window-background-image
>>>>>
>>>>>
>>>>> Someone can help me?
>>>>>
>>>>>
>>>>> THanks
>>>>>
>>>>> ___
>>>>> gtk-app-devel-list mailing list
>>>>> gtk-app-devel-list@gnome.org
>>>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>>> ___
>>>> gtk-app-devel-list mailing list
>>>> gtk-app-devel-list@gnome.org
>>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>>
>
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gtk3 layout background image

2017-03-14 Thread Rúben Rodrigues
Thanks!

But in GTK+2 we could change background in layout with this:

// Set picture as background.
//gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
//style = gtk_style_new ();
//style->bg_pixmap[0] = background;
//homeWindow = GTK_WIDGET(gtk_builder_get_object(builder, 
"layout_Home"));
//gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));

How i know witch containers draw background?

THanks


On 14-03-2017 12:55, Emmanuele Bassi wrote:
> Not all GTK containers draw a background, mostly for historical
> reasons. This has been true for GTK 1.x, 2.x, and 3.x.
>
> In particular, GtkLayout does not draw any background with CSS, so you
> will need to either subclass GtkLayout, override the GtkWidget::draw
> virtual function, and call gtk_render_* functions yourself; or you
> will need to put a GtkLayout into a parent container that does draw a
> background. You will, of course, need to style the parent container's
> background, not the GtkLayout itself.
>
> Ciao,
>   Emmanuele.
>
>
> On 14 March 2017 at 12:43, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> I verify that i can't use css provider, don't works.
>>
>> My css file is :
>>
>> GtkLayout#layout_Home.background{
>>   background-image: url('background.png');
>> }
>>
>> GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
>>   color: white;
>> }
>>
>> GtkLabel#Home_Sensors_MoistAvg_value{
>>   font-family: Segoe UI;
>>   font-weight: lighter;
>>   font-size: 25px;
>> }
>>
>> And this code:
>>
>> static void apply_css(GtkWidget *widget, GtkStyleProvider *provider)
>> {
>> gtk_style_context_add_provider(gtk_widget_get_style_context(widget),
>> GTK_STYLE_PROVIDER(provider),G_MAXUINT);
>>   if(GTK_IS_CONTAINER(widget))
>>   gtk_container_forall(GTK_CONTAINER(widget),(GtkCallback)
>> apply_css,provider);
>>
>> }
>>
>> GFile *file= g_file_new_for_path("custom.css");
>>   GtkStyleProvider *css_provider =
>> GTK_STYLE_PROVIDER(gtk_css_provider_new());
>> gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(css_provider), file,
>> );
>> apply_css(gtk_builder_get_object(builder,"window_Main"),css_provider);
>>
>> This is the code used in gtk3-demo and don't works for me.. Why
>>
>> THanks
>>
>> On 14-03-2017 10:00, Rúben Rodrigues wrote:
>>> Hi guys,
>>>
>>> Finnaly i migrate my application to gtk+3. So, now i neet to change some
>>> things like image background. I used css provider like in this :
>>>
>>> custom.css file:
>>>
>>> GtkLayout:layout_Home{
>>>background-color: black;
>>> }
>>>
>>>
>>> C Program:
>>>
>>> GFile *file= g_file_new_for_path("custom.css");
>>>GtkCssProvider *css_provider = gtk_css_provider_get_default();
>>>gtk_css_provider_load_from_file(css_provider, file, );
>>>GtkStyleContext *context = gtk_style_context_new();
>>>gtk_style_context_add_provider(context,
>>> GTK_STYLE_PROVIDER(css_provider),GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>>>
>>> But nothing happens. I tried this too:
>>>
>>> http://stackoverflow.com/questions/7375624/gtk3-window-background-image
>>>
>>>
>>> Someone can help me?
>>>
>>>
>>> THanks
>>>
>>> ___
>>> gtk-app-devel-list mailing list
>>> gtk-app-devel-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gtk3 layout background image

2017-03-14 Thread Rúben Rodrigues
I verify that i can't use css provider, don't works.

My css file is :

GtkLayout#layout_Home.background{
 background-image: url('background.png');
}

GtkLabel#Home_Cooling_Tunnel1_Cooler_label1{
 color: white;
}

GtkLabel#Home_Sensors_MoistAvg_value{
 font-family: Segoe UI;
 font-weight: lighter;
 font-size: 25px;
}

And this code:

static void apply_css(GtkWidget *widget, GtkStyleProvider *provider)
{
gtk_style_context_add_provider(gtk_widget_get_style_context(widget), 
GTK_STYLE_PROVIDER(provider),G_MAXUINT);
 if(GTK_IS_CONTAINER(widget))
 gtk_container_forall(GTK_CONTAINER(widget),(GtkCallback) 
apply_css,provider);

}

GFile *file= g_file_new_for_path("custom.css");
 GtkStyleProvider *css_provider = 
GTK_STYLE_PROVIDER(gtk_css_provider_new());
gtk_css_provider_load_from_file(GTK_CSS_PROVIDER(css_provider), file, 
);
apply_css(gtk_builder_get_object(builder,"window_Main"),css_provider);

This is the code used in gtk3-demo and don't works for me.. Why

THanks

On 14-03-2017 10:00, Rúben Rodrigues wrote:
> Hi guys,
>
> Finnaly i migrate my application to gtk+3. So, now i neet to change some
> things like image background. I used css provider like in this :
>
> custom.css file:
>
> GtkLayout:layout_Home{
>   background-color: black;
> }
>
>
> C Program:
>
> GFile *file= g_file_new_for_path("custom.css");
>   GtkCssProvider *css_provider = gtk_css_provider_get_default();
>   gtk_css_provider_load_from_file(css_provider, file, );
>   GtkStyleContext *context = gtk_style_context_new();
>   gtk_style_context_add_provider(context,
> GTK_STYLE_PROVIDER(css_provider),GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);
>
> But nothing happens. I tried this too:
>
> http://stackoverflow.com/questions/7375624/gtk3-window-background-image
>
>
> Someone can help me?
>
>
> THanks
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk3 layout background image

2017-03-14 Thread Rúben Rodrigues
Hi guys,

Finnaly i migrate my application to gtk+3. So, now i neet to change some 
things like image background. I used css provider like in this :

custom.css file:

GtkLayout:layout_Home{
 background-color: black;
}


C Program:

GFile *file= g_file_new_for_path("custom.css");
 GtkCssProvider *css_provider = gtk_css_provider_get_default();
 gtk_css_provider_load_from_file(css_provider, file, );
 GtkStyleContext *context = gtk_style_context_new();
 gtk_style_context_add_provider(context, 
GTK_STYLE_PROVIDER(css_provider),GTK_STYLE_PROVIDER_PRIORITY_APPLICATION);

But nothing happens. I tried this too:

http://stackoverflow.com/questions/7375624/gtk3-window-background-image


Someone can help me?


THanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Migrate to gtk3.0

2017-03-10 Thread Rúben Rodrigues
Thanks Mr. Bassi!

Yes, i'm using GtkPlot! SO, I think I'm unable to migrate this to gtk3 
because of graphs. SOmeone who knows something about this charts? 
http://madebyryan.blogspot.pt/2011/08/smooth-curves-for-gtk-chart-component.html


Thanks.


On 10-03-2017 15:26, Emmanuele Bassi wrote:
> On 10 March 2017 at 15:11, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Hi,
>>
>> i'm trying to migrate from gtk2.0 to gtk3.0 and i'm following gnome
>> tutorial
>> https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3
>>
>> When i put
>>
>> make CFLAGS+="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"
>>
>> to don't use deprecated symbols I get this  errors:
>>
>> /opt/x-tools/rootfs/rpi/usr/include/gtkextra-3.0/gtkextra/gtkdirtree.h:54:3:
>> error: unknown type name ‘GtkCTree’
>>  GtkCTree ctree;
>>  ^
>> /opt/x-tools/rootfs/rpi/usr/include/gtkextra-3.0/gtkextra/gtkdirtree.h:73:3:
>> error: unknown type name ‘GtkCTreeClass’
>>  GtkCTreeClass parent_class;
>>
>> I put CFLAGS in Eclipse, Project proprieties -> Cross GCC Compiler ->
>> Preprocessor -> Defined Symbols (-D)
>>
>> ->GTK_DISABLE_SINGLE_INCLUDES
>>
>> ->GTK_DISABLE_DEPRECATED
>>
>> ->GDK_DISABLE_DEPRECATED
>>
>> I can't use gtkextra-3.0 for gtk3 ??
> If GtkExtra is using GtkCTree I would contend that you should not be
> using GtkExtra at all. The library looks like a collection of widgets
> for GTK+ 1.2.
>
> As far as I know, GtkExtra does not have a GTK+ 3.0 compatible version.
>
> Which component of GtkExtra are you using? Outside of GtkPlot, 99% of
> that library is redundant with the GTK+ 2.x API itself:
>
>- GtkIconList: replaced by GtkIconView in GTK+ 2.x and by GtkFlowBox
> in GTK+ 3.x, and the idea of using XPM in 2017 is terrible
>- GtkDirTree, GtkFileList: replaced by GtkFileChooserWidget
>- GtkIconFileSelection: I struggle very hard to figure out a case
> that is not relevant outside of 1997 style UIs, but a GtkIconView is
> perfectly enough
>- GtkComboBox: part of GTK+ itself
>- GtkColorCombo: replaced by GtkColorChooser
>- GtkCheckItem: I don't even want to know
>
> The library itself is a staggering namespace violation of GTK's own
> API namespace, but I guess it's too late to fix that.
>
> Looking at the code it even seems somebody is still maintaining this
> library! Maybe you could just extract the GtkPlot code and include it
> into your own application. Of course, that can only happen if the
> license of your application is licensed under the LGPL v2.1 or GPL v2
> or later licenses.
>
> Ciao,
>   Emmanuele.
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Migrate to gtk3.0

2017-03-10 Thread Rúben Rodrigues
Hi,

i'm trying to migrate from gtk2.0 to gtk3.0 and i'm following gnome 
tutorial 
https://developer.gnome.org/gtk3/stable/gtk-migrating-2-to-3.html#id-1.6.3.3

When i put

make CFLAGS+="-DGDK_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"

to don't use deprecated symbols I get this  errors:

/opt/x-tools/rootfs/rpi/usr/include/gtkextra-3.0/gtkextra/gtkdirtree.h:54:3: 
error: unknown type name ‘GtkCTree’
GtkCTree ctree;
^
/opt/x-tools/rootfs/rpi/usr/include/gtkextra-3.0/gtkextra/gtkdirtree.h:73:3: 
error: unknown type name ‘GtkCTreeClass’
GtkCTreeClass parent_class;

I put CFLAGS in Eclipse, Project proprieties -> Cross GCC Compiler -> 
Preprocessor -> Defined Symbols (-D)

->GTK_DISABLE_SINGLE_INCLUDES

->GTK_DISABLE_DEPRECATED

->GDK_DISABLE_DEPRECATED

I can't use gtkextra-3.0 for gtk3 ??

Thanks


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Homogeneous table

2017-03-10 Thread Rúben Rodrigues
HI,

Thanks for your reply. NExt i will change to gtk3, but i think that i need to 
change many things.. It could be simple to make a homogeneous table and hide 
images, unfortunately not..

On 09-03-2017 18:59, cecas...@aol.com wrote:

Hi Ruben,

Consider using a drawing area and GTK3. There are more drawing and graphical 
capabilities in GTK3. Going forward to GTK4 I expect even more drawing 
capabilities since every computer sold these days has a gpu and the software 
can take advantage of that.

With a drawing area you get better control of what you can do with your image. 
It makes it easy to place the image in different places along with, 
transparency, text, animation, transforms,,, and a lot of other things.

For chicken placement you can use 5 separate drawing areas or merge them into 
one. I have something similar with selecting critters for gauge speed. A png 
picture here.

https://github.com/cecashon/OrderedSetVelociRaptor/tree/master/Misc/AdjustableGauge

There is a simple picture in a drawing area with some animated text over it at

https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/cairo_drawings/draw_chars1.c

The code is simple enough but it needs a picture and picture path for it to 
work. I think that it could be ported to GTK2 but haven't done so. I like the 
graphical capabilities of GTK3 so I sort of stick with that for now.

Eric

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Homogeneous table

2017-03-09 Thread Rúben Rodrigues
Hi guys,

I have this table : https://ibin.co/3EyWlgNYl1uK.png

This table have 5 columns, each column has an image.

I just want to see one image at a time, but I do not want to center that 
image, that is, I want to see it in its correct position.

SO, when i do this next code image should be in correct position and not 
in center. And i'm seeing in the center.

gtk_widget_set_visible(GTK_WIDGET(gtk_builder_get_object(builder, 
"first")), FALSE);
gtk_widget_set_visible(GTK_WIDGET(gtk_builder_get_object(builder, 
"second")), FALSE);
gtk_widget_set_visible(GTK_WIDGET(gtk_builder_get_object(builder, 
"third")), FALSE);
gtk_widget_set_visible(GTK_WIDGET(gtk_builder_get_object(builder, 
"fourth")), FALSE);
gtk_widget_set_visible(GTK_WIDGET(gtk_builder_get_object(builder, 
"fifth")), TRUE);

I use homogeneous propriety in glade for table. and in packing i put 
expand yes and fill yes. What's wrong?


Thanks,


___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
Thanks for your help... Yes i don't understand why gtk doesn't aloow us 
to do some "basic" things..



On 08-03-2017 14:52, Stefan Salewski wrote:
> On Wed, 2017-03-08 at 14:18 +, Rúben Rodrigues wrote:
>> I asked to the Google before, but he don't give me nothing about
>> this
>> :-). PRELIGHT doesn't work too..
> Yes, you are right.
>
> I just took this example:
>
> https://www.spinics.net/lists/gtk/msg00686.html
>
> //gcc -o simple t.c `pkg-config --libs --cflags gtk+-2.0`
> #include 
>
> gint main(gint argc,gchar *argv[])
> {
>GtkWidget *window;
>GtkWidget* bar;
>GdkColor color;
>
>gtk_init (,);
>window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>bar=gtk_progress_bar_new();
>gdk_color_parse("red",);
>gtk_widget_modify_bg(bar,GTK_STATE_NORMAL, );
>gtk_widget_modify_bg(bar,GTK_STATE_PRELIGHT, );
>gtk_widget_modify_bg(bar,GTK_STATE_ACTIVE, );
>gtk_widget_modify_bg(bar,GTK_STATE_SELECTED, );
>gtk_widget_modify_bg(bar,GTK_STATE_INSENSITIVE, );
>
>gtk_widget_modify_fg(bar,GTK_STATE_NORMAL, );
>gtk_widget_modify_fg(bar,GTK_STATE_PRELIGHT, );
>gtk_widget_modify_fg(bar,GTK_STATE_ACTIVE, );
>gtk_widget_modify_fg(bar,GTK_STATE_SELECTED, );
>gtk_widget_modify_fg(bar,GTK_STATE_INSENSITIVE, );
>
>gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar),0.5);
>gtk_container_add(GTK_CONTAINER(window),bar);
>gtk_widget_show_all (window);
>gtk_main();
>return 0;
> }
>
> And on my box the bar is still blue!
>
> GTK can be really hard and stubborn sometimes.
>
> I do not have the GTK2 source codes on my box currently, so I can not
> look at it currently. Maybe Mr Bassi or someone of the other few
> remaining GTK insiders is still following this thread. At least now
> your real goal is clear and we have tried it ourself :-)
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

GtkImage XAlign dynamically

2017-03-08 Thread Rúben Rodrigues
Hi,

In glade gtkImage have xalign property to  change image alignment. How 
can i change  this in code dynamically?

Thanks

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
I tried before run my app with different them like black but don't 
works. So if we don't should change the colors, why themes doesn't 
change too?


On 08-03-2017 15:11, Stefan Salewski wrote:
> On Wed, 2017-03-08 at 15:00 +0000, Rúben Rodrigues wrote:
>> Thanks for your help... Yes i don't understand why gtk doesn't aloow
>> us
>> to do some "basic" things..
> Well, the GTK senior developers will say that such "color hacks" are
> ugly and do not fit theming well. That may be true. But the Problem is:
> When we try to teach Kids GTK programming, one of their first question
> is: How can I change that color. They expect a simple function and
> would have fun playing with it. But we have to tell them: We should not
> do that, it may be possible with CSS... So we have no Kids in GTK for
> more than 10 years now, so so new coders, only a few tired seniors
> left.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
Works for me too. Thank you!


On 08-03-2017 15:02, Stefan Salewski wrote:
> On Wed, 2017-03-08 at 15:52 +0100, Stefan Salewski wrote:
>> On Wed, 2017-03-08 at 14:18 +0000, Rúben Rodrigues wrote:
>>> I asked to the Google before, but he don't give me nothing about
>>> this
>>> :-). PRELIGHT doesn't work too..
>>   
> Well, the fix suggested by Owen Taylor in that old thread solved it for
> me:
>
> #include 
>
> gint main(gint argc,gchar *argv[])
> {
>GtkWidget *window;
>GtkWidget* bar;
>GdkColor color;
>GtkStyle *style;
>
>gtk_init (,);
>window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>bar=gtk_progress_bar_new();
>gdk_color_parse("red",);
>gtk_widget_modify_bg(bar,GTK_STATE_NORMAL, );
>gtk_widget_modify_bg(bar,GTK_STATE_PRELIGHT, );
>gtk_widget_modify_bg(bar,GTK_STATE_ACTIVE, );
>gtk_widget_modify_bg(bar,GTK_STATE_SELECTED, );
>gtk_widget_modify_bg(bar,GTK_STATE_INSENSITIVE, );
>
>gtk_widget_modify_fg(bar,GTK_STATE_NORMAL, );
>gtk_widget_modify_fg(bar,GTK_STATE_PRELIGHT, );
>gtk_widget_modify_fg(bar,GTK_STATE_ACTIVE, );
>gtk_widget_modify_fg(bar,GTK_STATE_SELECTED, );
>gtk_widget_modify_fg(bar,GTK_STATE_INSENSITIVE, );
>
>style = gtk_style_new ();
>gdk_color_parse ("red", >bg[GTK_STATE_PRELIGHT]);
>gtk_widget_set_style (bar, style);
>g_object_unref (style);
>
>gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(bar),0.5);
>gtk_container_add(GTK_CONTAINER(window),bar);
>gtk_widget_show_all (window);
>gtk_main();
>return 0;
> }

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
I asked to the Google before, but he don't give me nothing about this 
:-). PRELIGHT doesn't work too..


On 08-03-2017 13:53, Stefan Salewski wrote:
> On Wed, 2017-03-08 at 13:30 +0000, Rúben Rodrigues wrote:
>> Yes, doesn't work for me..  Because:
>>
>> gtk_widget_modify_bg(GTK_WIDGET(gtk_builder_get_object(builder,"Menu_
>> Birds_ProgressBr")),GTK_STATE_NORMAL,
>> );
>>
>> This changed background color, and this
>>
>>   
>> gtk_widget_modify_fg(GTK_WIDGET(gtk_builder_get_object(builder,"Menu_
>> Birds_ProgressBar")),GTK_STATE_NORMAL, );
>>
>> Change text color. I want to change bar color..
> Well, than we have to ask Mr Bassi or Google :-) Or look at the code...
>
> http://stackoverflow.com/questions/11172804/pygobject-gtk-entry-changing-progress-bar-color
>
> So please try gtk.STATE_PRELIGHT.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
Yes, doesn't work for me..  Because:

gtk_widget_modify_bg(GTK_WIDGET(gtk_builder_get_object(builder,"Menu_Birds_ProgressBr")),GTK_STATE_NORMAL,
 
);

This changed background color, and this

  
gtk_widget_modify_fg(GTK_WIDGET(gtk_builder_get_object(builder,"Menu_Birds_ProgressBar")),GTK_STATE_NORMAL,
 );

Change text color. I want to change bar color..

THanks




On 08-03-2017 12:49, Stefan Salewski wrote:
> On Wed, 2017-03-08 at 12:29 +, Rúben Rodrigues wrote:
>> Hi,
>>
>> Thanks. Yes i want to change in gtk 2.x and change it in my app
>> only.
>> There's no way in proprieties?
> Do the ordinary GTK2 functions not work for your case?
> Like gtk_widget_modify_fg() and gtk_widget_modify_bg()
>
>
> https://developer.gnome.org/gtk2/stable/GtkWidget.html#gtk-widget-modify-fg
>
> http://stackoverflow.com/questions/99488/how-do-i-change-the-colors-of-an-arbitrary-widget-in-gtk
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk+ progress bar color

2017-03-08 Thread Rúben Rodrigues
Hi,

Thanks. Yes i want to change in gtk 2.x and change it in my app only. 
There's no way in proprieties?


On 07-03-2017 19:48, Stefan Salewski wrote:
> On Tue, 2017-03-07 at 15:43 +0000, Rúben Rodrigues wrote:
>>> Hi guys,
>>>
>>> How can i change progress bar color?
>>>
>>> Thanks
>>>
>>
> For GTK 3.20 and above you can do it, using CSS. I did a similar fix
> for scrollbar width for my 27 inch 4 display. I think I wrote how I did
> it here some months ago. Basically you grap the CSS file, search for
> progressbar, copy that section to ~/.config/gtk-3.0/gtk.css and modify
> the color entry with a text editor. When you restart your application
> you should notice the new color.
>
> But maybe you want to use GTK2, Windows or Mac, or change it only for a
> specific app?
>
> And of course generally it may be a bad idea to modify single colors,
> because it may not really fit for arbitrary themes. And, not all
> widgets have plain colors, some have gradients and more. But I think
> for progressbar there is indeed a single color defined for GTK 3.20.
> And for personal use it should be OK.

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Gtk+ progress bar color

2017-03-07 Thread Rúben Rodrigues

> Hi guys,
>
> How can i change progress bar color?
>
> Thanks
>

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Fwd: Resize and place a background image (Expose Event)

2017-03-02 Thread Rúben Rodrigues
Hi,

Still crash after a while.. but needs more time..

What could be?
Thanks
Às 10:41 de 02/03/2017, Gabriele Greco escreveu:

Now, application crash after start, but i think that is because i make
the unref of pixbuf, and in next expose event, fails (i think)...

GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF
(src)' failed

This happens because your original "pixbuf"  is a global object, remove the 
first of the three _unref and you should be fine!

--
Bye,
 Gabry


[https://ipmcdn.avast.com/images/icons/icon-envelope-tick-round-orange-animated-no-repeat-v1.gif]
  Sem vírus. 
www.avast.com
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Fwd: Resize and place a background image (Expose Event)

2017-03-02 Thread Rúben Rodrigues
Thank you very much!!

I'm not sure if i have to do this every time an expose event occurs.. I 
think that i just need on start of application.. But i test on start of 
application, i i don't have widget->allocation values, to make the resize..

Now, application crash after start, but i think that is because i make 
the unref of pixbuf, and in next expose event, fails (i think)...

GdkPixbuf-CRITICAL **: gdk_pixbuf_scale_simple: assertion 'GDK_IS_PIXBUF 
(src)' failed
GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT 
(object)' failed
Gdk-CRITICAL **: IA__gdk_pixbuf_render_pixmap_and_mask_for_colormap: 
assertion 'GDK_IS_PIXBUF (pixbuf)' failed
GLib-GObject-CRITICAL **: g_object_unref: assertion 'G_IS_OBJECT 
(object)' failed

Às 09:54 de 02/03/2017, Gabriele Greco escreveu:
>> This works, but application blocks after a while..
>>
> I'm quite sure the problem is that you are leaking at least 2 pixbuf and a
> pixmap for every expose event your app receives, and anyway, are you sure
> you have to do it every time an expose event is thrown and not only when
> the window is resized (configure_event)?
>
>
>>
>>   pixbuf = gdk_pixbuf_scale_simple(pixbuf, widget->allocation.width,
>>
> If the original pixbuf has been created just for this operation, this call
> leaks a pixbuf object, you shoud do something like:
>
> GdkPixbuf *scaled = gdk_pixbuf_scale_simple(pixbuf,
> widget->allocation.width, [...]
> g_object_unref(pixbuf);
>
>
>> widget->allocation.height, GDK_INTERP_BILINEAR);
>>   gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
>>
> At this point you leak the second pixbuf, use for instance:
> g_object_unref(scaled);
>
>
>>   style->bg_pixmap[0] = background;
>>   gtk_widget_set_style (GTK_WIDGET(widget), GTK_STYLE(style));
>>
> I'm quite sure set_style will increase reference count for 'background', so
> after this call you should unref that pixmap:
>
> g_object_unref(background);
>
> You'll receive runtime errors if one of my statements here is not correct,
> it's better to add a not needed unref in development and fix it that
> release a version that leaks memory.
>


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Resize and place a background image (Expose Event)

2017-03-02 Thread Rúben Rodrigues
Hi,

I have made progress, i use this function to make the resize: pixbuf = 
gdk_pixbuf_scale_simple(pixbuf, widget->allocation.width, 
widget->allocation.height, GDK_INTERP_BILINEAR);

This works, but application blocks after a while..

Here is the Expose event function:

void on_layout_Home_expose_event(GtkWidget *widget, GdkEvent *event, 
gpointer   user_data){
 GtkAllocation allocation;
 GtkWidget*homeWindow;
 GdkPixmap*background;
 GtkStyle*style;

 pixbuf = gdk_pixbuf_scale_simple(pixbuf, widget->allocation.width, 
widget->allocation.height, GDK_INTERP_BILINEAR);
 gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
 style = gtk_style_new ();

 style->bg_pixmap[0] = background;
 gtk_widget_set_style (GTK_WIDGET(widget), GTK_STYLE(style));

 return TRUE;

}

Thanks



Às 17:04 de 01/03/2017, Rúben Rodrigues escreveu:
> Hi,
>
> I'm trying to make something like this 
> http://www.kksou.com/php-gtk2/sample-codes/place-a-background-image-in-GtkWindow-Part-6-align-bottom-right-GdkDrawable-draw_pixbuf.php
>  
> but in C language. For now i just want to fill background image to 
> it's cointainer (GtkLayout), because the container is bigger than 
> image, image is displayed in tiles...
>
> So, i make something like this:
>
> // Load model drawing from file.
> if((pixbuf = gdk_pixbuf_new_from_file("background.png", )) 
> == NULL) {
> g_print("Error.\n");
> return -1;
> }
>
>
> void on_layout_Home_expose_event(GtkWidget *widget, GdkEvent *event, 
> gpointer   user_data){
> GtkAllocation allocation;
> GtkWidget*homeWindow;
> GdkPixmap*background;
> GtkStyle*style;
>
> int w = gdk_pixbuf_get_width(pixbuf);
> int h = gdk_pixbuf_get_height(pixbuf);
>
> gtk_widget_get_allocation(GTK_WIDGET(widget),);
>
>
> // Set picture as background.
> homeWindow = GTK_WIDGET(gtk_builder_get_object(builder, 
> "layout_Home"));
>
> gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
> style = gtk_style_new ();
> //style->bg_pixmap[0] = background;
> gdk_draw_pixbuf(style->bg_pixmap[0],NULL,pixbuf,0,0,allocation.width-w-10,allocation.height-h-10,-1,-1,GDK_RGB_DITHER_NONE,0,0);
>  
>
>gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));
>
> //if(gtk_container_get_children(widget) != NULL){
> //gtk_widget_send_expose 
> (gtk_container_get_children(widget),event);
> //}
>
> return TRUE;
>
> }
>
> But this doesn't work.. and it's normal that program return everytime 
> to expose_event?
>
> Thanks
>
>
> ---
> Este e-mail foi verificado em termos de vírus pelo software antivírus 
> Avast.
> https://www.avast.com/antivirus
>


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Resize and place a background image

2017-03-01 Thread Rúben Rodrigues
Hi,

I'm trying to make something like this 
http://www.kksou.com/php-gtk2/sample-codes/place-a-background-image-in-GtkWindow-Part-6-align-bottom-right-GdkDrawable-draw_pixbuf.php
 
but in C language. For now i just want to fill background image to it's 
cointainer (GtkLayout), because the container is bigger than image, 
image is displayed in tiles...

So, i make something like this:

// Load model drawing from file.
 if((pixbuf = gdk_pixbuf_new_from_file("background.png", )) == 
NULL) {
 g_print("Error.\n");
 return -1;
 }


void on_layout_Home_expose_event(GtkWidget *widget, GdkEvent *event, 
gpointer   user_data){
 GtkAllocation allocation;
 GtkWidget*homeWindow;
 GdkPixmap*background;
 GtkStyle*style;

 int w = gdk_pixbuf_get_width(pixbuf);
 int h = gdk_pixbuf_get_height(pixbuf);

 gtk_widget_get_allocation(GTK_WIDGET(widget),);


 // Set picture as background.
 homeWindow = GTK_WIDGET(gtk_builder_get_object(builder, 
"layout_Home"));

 gdk_pixbuf_render_pixmap_and_mask (pixbuf, , NULL, 0);
 style = gtk_style_new ();
 //style->bg_pixmap[0] = background;
gdk_draw_pixbuf(style->bg_pixmap[0],NULL,pixbuf,0,0,allocation.width-w-10,allocation.height-h-10,-1,-1,GDK_RGB_DITHER_NONE,0,0);
gtk_widget_set_style (GTK_WIDGET(homeWindow), GTK_STYLE(style));

//if(gtk_container_get_children(widget) != NULL){
//gtk_widget_send_expose (gtk_container_get_children(widget),event);
//}

 return TRUE;

}

But this doesn't work.. and it's normal that program return everytime to 
expose_event?

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

dark theme gtk+2?

2017-03-01 Thread Rúben Rodrigues
Hi guys,


It's possible to make this

g_object_set(gtk_settings_get_default(),
 "gtk-application-prefer-dark-theme", TRUE,
 NULL);

with gtk+2.0?

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk-WARNING **: Could not find signal handler

2017-03-01 Thread Rúben Rodrigues
Thanks everyone!

I´m using eclipse, i i think that i used gmodule-export-2.0 the wrong 
way. Before i add gmodule-export-2.0 in Cross GCC Linker -> Libraries -> 
Libraries (-l), adn it gives an error, i think its because don't find 
this library..

Now i add `pkg-config --libs gmodule-export-2.0` in Cross GCC Linker -> 
Miscellaneous -> Linker flags after everything that was written and 
works... Warning dissapears ...

Thanks guys!!


Às 08:48 de 28/02/2017, Tilo Villwock escreveu:
> Well I don't know what else I could say. Either use
>
>  gtk_builder_add_callback_symbol(...)
>
> to add all the symbols manually or make sure you can link against
> gmodule-export-2.0 which on ARM probably means you have to compile and
> install it yourself.
>
> If you have installed it and your linker still can't find it then you
> probably need to run ldconfig to update your cache.
>
> --Tilo
>
> Am Montag, den 27.02.2017, 18:46 + schrieb Rúben Rodrigues:
>> Please help me...
>>
>> I lost so many hours with this error.. This should work, because the
>> same code works in other machine.. But in raspberry pi don't..
>>
>> Thanks
>>
>>
>> Às 15:19 de 27/02/2017, Rúben Rodrigues escreveu:
>>> Hi,
>>>
>>> I have the same problem of this topic
>>> https://mail.gnome.org/archives/gtk-app-devel-list/2013-December/ms
>>> g00037.html
>>>
>>> I see very similar problems, but didn't find any resolution.
>>>
>>> I get this error in when i'm debuugin gtk app : Gtk-WARNING **:
>>> Could
>>> not find signal handler
>>>
>>> I make this in my code
>>>
>>> if( ! gtk_builder_add_from_file( builder, "ui.glade",  ) )
>>>{
>>>g_warning( "%s", error->message );
>>>g_free( error );
>>>return( 1 );
>>>}
>>>
>>>/* Allocate data structure */
>>>data = g_slice_new( ChData );
>>>
>>>/* Connect signals */
>>>gtk_builder_connect_signals( builder, NULL );
>>>
>>> Because of this, all signals configured in glade do not work.
>>> The documentation at
>>> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder
>>> -connect-signals
>>> suggests that i should be linking against gmodule-export-2.0, but
>>> when i
>>> try this, i get this error:
>>> /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-
>>> gnueabihf/bin/ld: cannot find -lgmodule-export-2.0
>>>
>>> Thanks
>>>
>>> ---
>>> Este e-mail foi verificado em termos de vírus pelo software
>>> antivírus Avast.
>>> https://www.avast.com/antivirus
>>>
>>> ___
>>> gtk-app-devel-list mailing list
>>> gtk-app-devel-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>
>> ---
>> Este e-mail foi verificado em termos de vírus pelo software antivírus
>> Avast.
>> https://www.avast.com/antivirus
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk-WARNING **: Could not find signal handler

2017-03-01 Thread Rúben Rodrigues
Hi,

I don't find this library ..

pi@raspberrypi:~ $ sudo apt-get install gmodule-export-2.0
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gmodule-export-2.0
E: Couldn't find any package by regex 'gmodule-export-2.0'

Thanks


Às 08:48 de 28/02/2017, Tilo Villwock escreveu:
> Well I don't know what else I could say. Either use
>
>  gtk_builder_add_callback_symbol(...)
>
> to add all the symbols manually or make sure you can link against
> gmodule-export-2.0 which on ARM probably means you have to compile and
> install it yourself.
>
> If you have installed it and your linker still can't find it then you
> probably need to run ldconfig to update your cache.
>
> --Tilo
>
> Am Montag, den 27.02.2017, 18:46 + schrieb Rúben Rodrigues:
>> Please help me...
>>
>> I lost so many hours with this error.. This should work, because the
>> same code works in other machine.. But in raspberry pi don't..
>>
>> Thanks
>>
>>
>> Às 15:19 de 27/02/2017, Rúben Rodrigues escreveu:
>>> Hi,
>>>
>>> I have the same problem of this topic
>>> https://mail.gnome.org/archives/gtk-app-devel-list/2013-December/ms
>>> g00037.html
>>>
>>> I see very similar problems, but didn't find any resolution.
>>>
>>> I get this error in when i'm debuugin gtk app : Gtk-WARNING **:
>>> Could
>>> not find signal handler
>>>
>>> I make this in my code
>>>
>>> if( ! gtk_builder_add_from_file( builder, "ui.glade",  ) )
>>>{
>>>g_warning( "%s", error->message );
>>>g_free( error );
>>>return( 1 );
>>>}
>>>
>>>/* Allocate data structure */
>>>data = g_slice_new( ChData );
>>>
>>>/* Connect signals */
>>>gtk_builder_connect_signals( builder, NULL );
>>>
>>> Because of this, all signals configured in glade do not work.
>>> The documentation at
>>> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder
>>> -connect-signals
>>> suggests that i should be linking against gmodule-export-2.0, but
>>> when i
>>> try this, i get this error:
>>> /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-
>>> gnueabihf/bin/ld: cannot find -lgmodule-export-2.0
>>>
>>> Thanks
>>>
>>> ---
>>> Este e-mail foi verificado em termos de vírus pelo software
>>> antivírus Avast.
>>> https://www.avast.com/antivirus
>>>
>>> ___
>>> gtk-app-devel-list mailing list
>>> gtk-app-devel-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>
>> ---
>> Este e-mail foi verificado em termos de vírus pelo software antivírus
>> Avast.
>> https://www.avast.com/antivirus
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Gtk-WARNING **: Could not find signal handler

2017-02-27 Thread Rúben Rodrigues
Please help me...

I lost so many hours with this error.. This should work, because the 
same code works in other machine.. But in raspberry pi don't..

Thanks


Às 15:19 de 27/02/2017, Rúben Rodrigues escreveu:
> Hi,
>
> I have the same problem of this topic
> https://mail.gnome.org/archives/gtk-app-devel-list/2013-December/msg00037.html
>
> I see very similar problems, but didn't find any resolution.
>
> I get this error in when i'm debuugin gtk app : Gtk-WARNING **: Could
> not find signal handler
>
> I make this in my code
>
> if( ! gtk_builder_add_from_file( builder, "ui.glade",  ) )
>   {
>   g_warning( "%s", error->message );
>   g_free( error );
>   return( 1 );
>   }
>
>   /* Allocate data structure */
>   data = g_slice_new( ChData );
>
>   /* Connect signals */
>   gtk_builder_connect_signals( builder, NULL );
>
> Because of this, all signals configured in glade do not work.
> The documentation at
> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-connect-signals
> suggests that i should be linking against gmodule-export-2.0, but when i
> try this, i get this error:
>
> /usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld:
>  cannot find -lgmodule-export-2.0
>
> Thanks
>
> ---
> Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
> https://www.avast.com/antivirus
>
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Error unknown type name ‘GtkSearchEntry’

2017-02-27 Thread Rúben Rodrigues
I tried before, but i think that is very dificult. I need to change many 
things.. I never program gtk before, am i'm taking an application that 
works in other older systems, and i couln't update this older systems. I 
think that doesn't run linux versions after 10.04..


Às 16:07 de 27/02/2017, Emmanuele Bassi escreveu:
> On 27 February 2017 at 15:51, Rúben Rodrigues <ruben...@live.com.pt> wrote:
>> Yes, gtk 2.. So, i can't use libwheather with gtk-2.0?
> You will need a previous version of libgweather; the last release with
> GTK+ 2.x support was the 2.30 release, which was done 6 years ago.
>
> I *strongly* encourage you to port your code to GTK+ 3.x, though.
>
> Ciao,
>   Emmanuele.
>
>> Às 13:09 de 27/02/2017, Colomban Wendling escreveu:
>>> Le 27/02/2017 à 10:51, Rúben Rodrigues a écrit :
>>>> Hi guys,
>>>>
>>>> Someone who knows this error?
>>>>
>>>> DescriptionResourcePathLocationType
>>>> unknown type name ‘GtkSearchEntry’ConsolaGraficaline 39,
>>>> external location:
>>> Too old GTK?  GtkSearchEntry is new in 3.6:
>>> https://developer.gnome.org/gtk3/stable/GtkSearchEntry.html  Many of its
>>> useful stuff is new in newer versions, 3.10 and 3.16, too.
>>>
>>> Regards,
>>> Colomban
>>> ___
>>> gtk-app-devel-list mailing list
>>> gtk-app-devel-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>
>> ---
>> Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
>> https://www.avast.com/antivirus
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>
>


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Error unknown type name ‘GtkSearchEntry’

2017-02-27 Thread Rúben Rodrigues
Yes, gtk 2.. So, i can't use libwheather with gtk-2.0?

Thanks


Às 13:09 de 27/02/2017, Colomban Wendling escreveu:
> Le 27/02/2017 à 10:51, Rúben Rodrigues a écrit :
>> Hi guys,
>>
>> Someone who knows this error?
>>
>> DescriptionResourcePathLocationType
>> unknown type name ‘GtkSearchEntry’ConsolaGraficaline 39,
>> external location:
> Too old GTK?  GtkSearchEntry is new in 3.6:
> https://developer.gnome.org/gtk3/stable/GtkSearchEntry.html  Many of its
> useful stuff is new in newer versions, 3.10 and 3.16, too.
>
> Regards,
> Colomban
> ___
> gtk-app-devel-list mailing list
> gtk-app-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Gtk-WARNING **: Could not find signal handler

2017-02-27 Thread Rúben Rodrigues
Hi,

Thanks for answering.

Yes i'm using hundreds of signals, and i'm working on an ARM Machine 
(Rasberry Pi).

What do you mean with "you're apparently not adding your signal handler 
symbols before calling" ?

Thanks

Às 15:39 de 27/02/2017, Tilo Villwock escreveu:
> It tells you to link GModule because you're apparently not adding your
> signal handler symbols before calling
>
>  gtk_builder_connect_signals(...)
>
> and thus tries to use introspection to look up the symbols. Unless it's
> hundreds of symbols I would suggest you simply call
>
>  gtk_builder_add_callback_symbol(...)
>
> to add all symbols that are referenced in your Glade file.
>
> Also are you actually working on an ARM machine? Otherwise your
> toolchain seems messed up.
>
> --Tilo
>
> Am Montag, den 27.02.2017, 15:19 + schrieb Rúben Rodrigues:
>> Hi,
>>
>> I have the same problem of this topic
>> https://mail.gnome.org/archives/gtk-app-devel-list/2013-December/msg0
>> 0037.html
>>
>> I see very similar problems, but didn't find any resolution.
>>
>> I get this error in when i'm debuugin gtk app : Gtk-WARNING **:
>> Could
>> not find signal handler
>>
>> I make this in my code
>>
>> if( ! gtk_builder_add_from_file( builder, "ui.glade",  ) )
>>   {
>>   g_warning( "%s", error->message );
>>   g_free( error );
>>   return( 1 );
>>   }
>>
>>   /* Allocate data structure */
>>   data = g_slice_new( ChData );
>>
>>   /* Connect signals */
>>   gtk_builder_connect_signals( builder, NULL );
>>
>> Because of this, all signals configured in glade do not work.
>> The documentation at
>> https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-c
>> onnect-signals
>> suggests that i should be linking against gmodule-export-2.0, but
>> when i
>> try this, i get this error:
>>/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-
>> gnueabihf/bin/ld: cannot find -lgmodule-export-2.0
>>
>> Thanks
>>
>> ---
>> Este e-mail foi verificado em termos de vírus pelo software antivírus
>> Avast.
>> https://www.avast.com/antivirus
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Gtk-WARNING **: Could not find signal handler

2017-02-27 Thread Rúben Rodrigues
Hi,

I have the same problem of this topic 
https://mail.gnome.org/archives/gtk-app-devel-list/2013-December/msg00037.html

I see very similar problems, but didn't find any resolution.

I get this error in when i'm debuugin gtk app : Gtk-WARNING **: Could 
not find signal handler

I make this in my code

if( ! gtk_builder_add_from_file( builder, "ui.glade",  ) )
 {
 g_warning( "%s", error->message );
 g_free( error );
 return( 1 );
 }

 /* Allocate data structure */
 data = g_slice_new( ChData );

 /* Connect signals */
 gtk_builder_connect_signals( builder, NULL );

Because of this, all signals configured in glade do not work.
The documentation at 
https://developer.gnome.org/gtk3/stable/GtkBuilder.html#gtk-builder-connect-signals
suggests that i should be linking against gmodule-export-2.0, but when i 
try this, i get this error:
  
/usr/lib/gcc-cross/arm-linux-gnueabihf/5/../../../../arm-linux-gnueabihf/bin/ld:
 cannot find -lgmodule-export-2.0

Thanks

---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Error unknown type name ‘GtkSearchEntry’

2017-02-27 Thread Rúben Rodrigues
Hi guys,

Someone who knows this error?

DescriptionResourcePathLocationType
unknown type name ‘GtkSearchEntry’ConsolaGraficaline 39, 
external location: 
/opt/x-tools/rootfs/rpi/usr/include/libgweather-3.0/libgweather/location-entry.h
 
C/C++ Problem

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Weather API

2017-02-23 Thread Rúben Rodrigues
Hi,
Thanks all. I'm new in gtk+ so it's dificult to understand how to use 
this library without documentation or examples..Anyone could help me?

Again,  thanks everyone.



Às 11:08 de 23/02/2017, infirit escreveu:
> Op 02/22/2017 om 07:44 PM schreef Norbert de Jonge:
>>> gnome-weather [...] I can i use this libraries with C?
>> I think, in theory, the GWeather Reference Manual...
>> https://developer.gnome.org/libgweather/stable/
>> ...should have information about its C functions in the Functions
>> sections. But they are empty, e.g.:
>> https://developer.gnome.org/libgweather/stable/GWeatherLocationEntry.html
>> Maybe someone needs to run GTK-Doc to create the manual?
> Yeah gnome documentation sucks.
>
> A reasonable C example can be found in gnome-applets [1].
>
> ~infirit
>
> [1] https://git.gnome.org/browse/gnome-applets/tree/gweather


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Weather API

2017-02-22 Thread Rúben Rodrigues
Hi,

Thanks for the answer. In gnome-weather source files i don't see any 
code in C language. I can i use this libraries with C?

Thanks


Às 17:36 de 22/02/2017, Hashem Nasarat escreveu:
> Hi Ruben,
>
> Perhaps this link would be useful to you: 
> https://wiki.gnome.org/Projects/LibGWeather
>
> Essentially try using libgweather with geoclue and geocode-glib.
>
> You can also look at the gnome-weather source code to see how it is 
> all used.
>
> Good luck!
> -Hashem
>
> On 02/22/2017 12:28 PM, Rúben Rodrigues wrote:
>> Hi,
>>
>> Someone could tell me which API i can use to display weather information
>> in my application? It is possible to detect location based on internet
>> connection?
>>
>> Thanks
>>
>>
>> ---
>> Este e-mail foi verificado em termos de vírus pelo software antivírus 
>> Avast.
>> https://www.avast.com/antivirus
>>
>> ___
>> gtk-app-devel-list mailing list
>> gtk-app-devel-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
>>


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Weather API

2017-02-22 Thread Rúben Rodrigues
Hi,

Someone could tell me which API i can use to display weather information 
in my application? It is possible to detect location based on internet 
connection?

Thanks


---
Este e-mail foi verificado em termos de vírus pelo software antivírus Avast.
https://www.avast.com/antivirus

___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list