Re: Glade crash

2017-03-02 Thread Daniel Kasak
There is no attachment. Try sharing it a different way - pastebin or
something.

Dan

On Wed, Mar 1, 2017 at 5:18 AM, pozzugno  wrote:

> Most probably this isn't the most appropriate mailing list, because I
> think my issue is related to Glade (and not Gtk libraries).
>
> Attached is one of my graphical interface, designed with Glade.
> Unfortunately when Glade opens this file, it seems it is very unstable if I
> try to change something.
>
> For example, let's try to delete the row in the fans_store GtkListStore
> object. Glade 3.20 will crash (at least in Windows).
>
> Do you understand why? I tried many things, even editing manually the
> .glade file with a text-editor. Many times, Glade wil crash during opening
> the edited file.
>
>
> ___
> 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: 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: win32 (via Wine): 'image-missing' not present in theme Adwaita

2017-03-02 Thread Norbert de Jonge
> Also the all the *-from-stock (e.g. gtk_button_new_from_stock)
> functions have been deprecated in GTK 3.10 so maybe that’s the issue?

Ah, that must be it, yes. I use gtk_image_new_from_icon_name() for menu
icons, and now that you mention it these indeed do not show up. So,
that must be where it tries to use the 'image-missing' icon. Thanks, I
guess I'll just have to accept that menu items really can no longer
have icons. Thanks for the reply.

Best regards,
Norbert
___
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 Gabriele Greco
>
>
> 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*
___
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: win32 (via Wine): 'image-missing' not present in theme Adwaita

2017-03-02 Thread Code Musings
Hello Norbert,

which GTK version are you porting to and what is the call you’re using that 
causes the GTK Warning about the missing icon? I don’t have a Windows machine 
but the 'image-missing' icon is definitely present on my machine (I checked 
using gtk3-icon-browser).

Also the all the *-from-stock (e.g. gtk_button_new_from_stock) functions have 
been deprecated in GTK 3.10 so maybe that’s the issue?

—Tilo

> Am 01.03.2017 um 06:39 schrieb Norbert de Jonge :
> 
> Hi,
> 
> I'm running my ported GTK+ application via Wine, and it keeps throwing:
> -
> Gtk-WARNING **: Error loading theme icon 'image-missing' for stock:
> Icon 'image-missing' not present in theme Adwaita
> -
> 
> How can I get rid of this?
> 
> I've already tried adding
> usr/share/icons/Adwaita/.../status/image-missing.png
> and
> usr/share/icons/gnome/.../status/image-missing.png
> to the program's directory, but that doesn't fix it.
> 
> =
> 
> Another, unrelated, question.
> 
> Question for those of you porting to Windows: I'm using ShellExecute()
> where I use fork()/execl() on GNU/Linux, and ShellExecute() keeps
> throwing me ERROR_BAD_FORMAT.
> 
> According to
> https://msdn.microsoft.com/en-us/library/windows/desktop/bb762153(v=vs.85).aspx
> this means "The .exe file is invalid (non-Win32 .exe or error in .exe
> image)."
> 
> But I've double-checked and and it's definitely a 32-bit executable:
> -
> PE32 executable (GUI) Intel 80386, for MS Windows, UPX compressed
> -
> 
> I've tried 3 different Wine versions (staging, devel and repo),
> and tried fixing it with WINEARCH=win32. Nothing fixes it.
> you.
> 
> Best regards,
> Norbert
> ___
> 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

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

2017-03-02 Thread Gabriele Greco
>
> 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.

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


Glade crash

2017-03-02 Thread pozzugno
Most probably this isn't the most appropriate mailing list, because I 
think my issue is related to Glade (and not Gtk libraries).


Attached is one of my graphical interface, designed with Glade. 
Unfortunately when Glade opens this file, it seems it is very unstable 
if I try to change something.


For example, let's try to delete the row in the fans_store GtkListStore 
object. Glade 3.20 will crash (at least in Windows).


Do you understand why? I tried many things, even editing manually the 
.glade file with a text-editor. Many times, Glade wil crash during 
opening the edited file.



___
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