Re: Moving from mailing lists to Discourse

2019-02-07 Thread Niels De Graef via gtk-app-devel-list
Hi all,

I'm very much in favor! Being able to still use e-mail while also
having a convenient and pretty-looking interface is something I look
*really* forward to.

My only question is: what happens to the old archives? Do we keep them
online as-is, or is there a plan to also migrate them? The former
means of course less effort, but the latter would keep everything
unified in one UI for example.
I'm fine with whatever you choose :-)

Thanks in any case for taking this up, Emmanuele!

Cheers,
nielsdg

On Wed, Feb 6, 2019 at 3:42 PM Emmanuele Bassi via gtk-devel-list
 wrote:
>
> More information on Discourse:
>
>   - About: https://www.discourse.org/about
>   - Features: https://www.discourse.org/features
>
> Discourse is a forum software that has multiple ways to access it: web, 
> native apps, and email. It's not a mailing list software with a web frontend.
>
> The interesting (to me) parts are:
>
>  - 2FA instead of Mailman's plaintext password
>  - real moderation tools, that can scale with the community and encourage 
> civility and code of conduct compliant behaviour
>  - anti-spam measures
>  - open source software (kind of a pre-requisite)
>  - good UI for reading and replying to topics
>
> The Fedora (Silverblue) and Ubuntu communities already use Discourse, for 
> instance; the SDL community also does.
>
> Ciao,
>  Emmanuele.
>
>
> On Wed, 6 Feb 2019 at 12:46, Emmanuele Bassi  wrote:
>>
>> [Cross-posted to various relevant mailing lists; please, reply to 
>> gtk-devel-list]
>>
>> As part of an attempt at making GTK more friendly to newcomers, I and other 
>> core developers were thinking of moving the mailing lists from the current 
>> mailman installation to Discourse:
>>
>>   https://discourse.org/
>>
>> Possibly still hosted on GNOME infrastructure, depending on the requirements 
>> for our sysadmins.
>>
>> The GTK project would have various sub-topics, mostly around development 
>> with and of GTK. Having a better archive search, a better moderation system, 
>> and a decent web UI are the major selling points for switching to Discourse. 
>> The fact that the project is also open source is neatly aligned with our 
>> values.
>>
>> Are there any objections? Did somebody already try out Discourse and has 
>> opinions about it that they want to share with the community?
>>
>> Ciao,
>>  Emmanuele.
>> --
>> https://www.bassi.io
>> [@] ebassi [@gmail.com]
>
>
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
> ___
> gtk-devel-list mailing list
> gtk-devel-l...@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-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: Moving from mailing lists to Discourse

2019-02-07 Thread Niels De Graef via gtk-list
Hi all,

I'm very much in favor! Being able to still use e-mail while also
having a convenient and pretty-looking interface is something I look
*really* forward to.

My only question is: what happens to the old archives? Do we keep them
online as-is, or is there a plan to also migrate them? The former
means of course less effort, but the latter would keep everything
unified in one UI for example.
I'm fine with whatever you choose :-)

Thanks in any case for taking this up, Emmanuele!

Cheers,
nielsdg

On Wed, Feb 6, 2019 at 3:42 PM Emmanuele Bassi via gtk-devel-list
 wrote:
>
> More information on Discourse:
>
>   - About: https://www.discourse.org/about
>   - Features: https://www.discourse.org/features
>
> Discourse is a forum software that has multiple ways to access it: web, 
> native apps, and email. It's not a mailing list software with a web frontend.
>
> The interesting (to me) parts are:
>
>  - 2FA instead of Mailman's plaintext password
>  - real moderation tools, that can scale with the community and encourage 
> civility and code of conduct compliant behaviour
>  - anti-spam measures
>  - open source software (kind of a pre-requisite)
>  - good UI for reading and replying to topics
>
> The Fedora (Silverblue) and Ubuntu communities already use Discourse, for 
> instance; the SDL community also does.
>
> Ciao,
>  Emmanuele.
>
>
> On Wed, 6 Feb 2019 at 12:46, Emmanuele Bassi  wrote:
>>
>> [Cross-posted to various relevant mailing lists; please, reply to 
>> gtk-devel-list]
>>
>> As part of an attempt at making GTK more friendly to newcomers, I and other 
>> core developers were thinking of moving the mailing lists from the current 
>> mailman installation to Discourse:
>>
>>   https://discourse.org/
>>
>> Possibly still hosted on GNOME infrastructure, depending on the requirements 
>> for our sysadmins.
>>
>> The GTK project would have various sub-topics, mostly around development 
>> with and of GTK. Having a better archive search, a better moderation system, 
>> and a decent web UI are the major selling points for switching to Discourse. 
>> The fact that the project is also open source is neatly aligned with our 
>> values.
>>
>> Are there any objections? Did somebody already try out Discourse and has 
>> opinions about it that they want to share with the community?
>>
>> Ciao,
>>  Emmanuele.
>> --
>> https://www.bassi.io
>> [@] ebassi [@gmail.com]
>
>
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
> ___
> gtk-devel-list mailing list
> gtk-devel-l...@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Moving from mailing lists to Discourse

2019-02-06 Thread Niels De Graef via gtk-devel-list
Hi all,

I'm very much in favor! Being able to still use e-mail while also
having a convenient and pretty-looking interface is something I look
*really* forward to.

My only question is: what happens to the old archives? Do we keep them
online as-is, or is there a plan to also migrate them? The former
means of course less effort, but the latter would keep everything
unified in one UI for example.
I'm fine with whatever you choose :-)

Thanks in any case for taking this up, Emmanuele!

Cheers,
nielsdg

On Wed, Feb 6, 2019 at 3:42 PM Emmanuele Bassi via gtk-devel-list
 wrote:
>
> More information on Discourse:
>
>   - About: https://www.discourse.org/about
>   - Features: https://www.discourse.org/features
>
> Discourse is a forum software that has multiple ways to access it: web, 
> native apps, and email. It's not a mailing list software with a web frontend.
>
> The interesting (to me) parts are:
>
>  - 2FA instead of Mailman's plaintext password
>  - real moderation tools, that can scale with the community and encourage 
> civility and code of conduct compliant behaviour
>  - anti-spam measures
>  - open source software (kind of a pre-requisite)
>  - good UI for reading and replying to topics
>
> The Fedora (Silverblue) and Ubuntu communities already use Discourse, for 
> instance; the SDL community also does.
>
> Ciao,
>  Emmanuele.
>
>
> On Wed, 6 Feb 2019 at 12:46, Emmanuele Bassi  wrote:
>>
>> [Cross-posted to various relevant mailing lists; please, reply to 
>> gtk-devel-list]
>>
>> As part of an attempt at making GTK more friendly to newcomers, I and other 
>> core developers were thinking of moving the mailing lists from the current 
>> mailman installation to Discourse:
>>
>>   https://discourse.org/
>>
>> Possibly still hosted on GNOME infrastructure, depending on the requirements 
>> for our sysadmins.
>>
>> The GTK project would have various sub-topics, mostly around development 
>> with and of GTK. Having a better archive search, a better moderation system, 
>> and a decent web UI are the major selling points for switching to Discourse. 
>> The fact that the project is also open source is neatly aligned with our 
>> values.
>>
>> Are there any objections? Did somebody already try out Discourse and has 
>> opinions about it that they want to share with the community?
>>
>> Ciao,
>>  Emmanuele.
>> --
>> https://www.bassi.io
>> [@] ebassi [@gmail.com]
>
>
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
> ___
> gtk-devel-list mailing list
> gtk-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: migrating gtk

2018-02-10 Thread Salvatore De Paolis
On Thu, 08 Feb 2018 02:00:16 +
Sriram Ramkrishna  wrote:

> Every contributor who takes an actionable step and reports a bug is a
> potential future core contributor.  Please remember that.  A person who
> attempts to fix a bug with a patch is even more valuable.

It's a waste of time, I just received today a bug I reported from 2010. Sadly
I prefer to move to some other project which cares of application developers. 
Maybe one day GTK+ will be fine, maybe not.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: win32 (via Wine): 'image-missing' not present in theme Adwaita

2017-03-04 Thread Norbert de Jonge
Hi Emmanuele,

Thanks for your feedback.

> You need to generate the icon cache on the
> target machine.

Assuming "target machine" in this context is the target operating
system, how do I generate icon cache on Windows (Wine on Linux, in my
case)?

>> Note that I don't want to move the executable (poplaun.exe)
>> into a bin/ directory. I want to keep it in the , in
>> the top level.
> 
> Why? Are you trying to complicate your life?

In my experience, it's fairly standard for Windows packages to have
their executables in the root (top level) directory. Putting mine in a
bin\ directory and then having to instruct users to enter that directory
to start the program would slightly decrease the user-friendliness of
the program.

> [...], or you identify the ones you use and only ship
> those in your installer.

It's good to read that this is possible. If I can figure out all the
required files (including - apparently - an icon cache) and where to
put them, this is indeed what I will do.

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: win32 (via Wine): 'image-missing' not present in theme Adwaita

2017-03-04 Thread Norbert de Jonge
Hi all,

Recently, I wrote:

=
> 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.
=

I've since gotten an insightful reply from Tilo, and someone
also e-mailed me off-list with some pointers.

I would still like to find a way to get rid of these Adwaita-related
warnings.

Here are download links of the GPL3+ program in question:
http://www.popot.org/other_useful_tools.php?tool=poplaun
The page has both the Windows and GNU/Linux packages.

It is a simple application that retrieves and launches Prince of Persia
mods.

I have tried copying my GNU/Linux's /usr/share/icons/Adwaita/* content
to the Windows port's /share/icons/Adwaita/

But then I get:

wine: Unhandled page fault on read access to 0x9666 at address
0x7e99f29c (thread 0009), starting debugger...

Note that I don't want to move the executable (poplaun.exe) into a bin/
directory. I want to keep it in the , in the top level.

Also, even if copying all Adwaita icons somewhere would have worked,
surely there must be a solution that doesn't require including 42MB
into the package, and still have it work out of the box - with the
(application-exit and help-about) icons...

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: 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: Gtk-WARNING **: Could not find signal handler

2017-03-01 Thread Norbert de Jonge
> pi@raspberrypi:~ $ sudo apt-get install gmodule-export-2.0

As Tilo wrote, you may need to compile it yourself.

A quick search seems to indicate that there is gmodule-no-export-2.0
(no export) and gmodule-2.0 (export).

If this is true, you may want to look for gmodule-2.0 instead.

norbert # apt-file search libgmodule
libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0
libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.0
libglib2.0-0: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so.0.4800.1
libglib2.0-dev: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.a
libglib2.0-dev: /usr/lib/x86_64-linux-gnu/libgmodule-2.0.so

Seems to tell me that these are the packages you'd be looking for.

Just a hunch, someone else may know more about it all.

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


win32 (via Wine): 'image-missing' not present in theme Adwaita

2017-02-28 Thread 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


Re: Programatically activate menu like a mouse click

2017-02-23 Thread Norbert de Jonge
> How can I trigger the menu activation (like a mouse click does) ?

I would guess with:
https://developer.gnome.org/gtk3/stable/GtkMenu.html#gtk-menu-popup-at-widget
It's available for GTK+ 3.22 and up, so I cannot test it to verify.

This should tell you your GTK+ version:
$ pkg-config --modversion gtk+-3.0

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: Weather API

2017-02-22 Thread 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?

Installing libgweather-3-dev does not give me a man page for, for
instance, gweather_info_get_wind() either.

This seems to have some docs though:
https://lazka.github.io/pgi-docs/GWeather-3.0/index.html

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: textview widget selection buffer_select_range is cleared when dialog closes (intermittently?)

2017-02-22 Thread Norbert de Jonge
> >   I have a textview widget being used in an editor where an
> > incremental search is performed. [...]

I can't help you, but after seeing some of your functions I'm
wondering... Setting the search direction (backwards, forwards),
setting/toggling case sensitivity (yes, no), and moving the selection
to whatever matches next; these are functionalities programmers want to
provide users, and that GTK+ could probably deliver with readily
available functions.

This reminds me of what I wrote in the last paragraph:
https://mail.gnome.org/archives/gtk-app-devel-list/2017-February/msg00014.html

To get case insensitivity search for a tree view in single
selection mode I recently had to create a custom
gtk_tree_view_set_search_equal_func(). I used g_strrstr() on the
g_utf8_strdown()'ed key and gtk_tree_model_get()-obtained iter. I then
noticed that pressing Enter did not move to the next match. That was
very recent, your "Hope this can help someone else." mail arrived just
after that. :)

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: want to capture a mouse click in an Entry

2017-02-18 Thread Norbert de Jonge
> I have an gtk_entry [...] and i would like to capture clicks
> in the entry [...] depending on what modifier keys are held

You can use g_signal_connect (..., "button_press_event", G_CALLBACK
(Function), NULL); Then in Function, check if (event->button.state ==
GDK_SHIFT_MASK) {} else {}. Also do gtk_widget_grab_focus (widget);
in Function.

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: Removing entries from EntryCompletion

2017-02-12 Thread Norbert de Jonge
> Is seems to me that the easiest way for the user to
> indicate to the GUI that a particular suggestion
> should be removed would be via the delete button
> whilst that suggestion is highlighted.

As soon as you click anywhere outside the area with suggestions
(matching entries), the overview of suggestions disappears. This means
that users can never hover over a suggestion to highlight it and then
press a delete button. Unless I'm misunderstanding what you have in
mind.

Anyway, why not add a button to open a completely new window that allows
users to remove suggestions from a tree view. This should also allow
them to remove multiple entries at once. Another, lazier solution,
could be to add a delete button that will delete the suggestion
matching what's currently in the entry.

Something else that may or may not be possible, is add a
g_signal_connect (entry, "key_press_event", G_CALLBACK (Delete), NULL);
and then check in Delete()
if (strcmp (gdk_keyval_name (event->key.keyval), "Delete") == 0)
and if that's the case, somehow obtain the active suggestion.
The problem here is that a GtkEntryCompletion only contains only
private data. At least, I think.
I tried using
selection = gtk_tree_view_get_selection (GTK_TREE_VIEW
(completion->priv->tree_view_proposals));
to get a selection, but this doesn't seem to work.

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: issue with drawing graph in GTK

2017-02-12 Thread Norbert de Jonge
> I am using below code for drawing two graphs from same data.
> [...]
> please let me know if more information is required.

If the problem persists and you've been unable to find help, I suggest
you create and share with us a short, self contained example program
that demonstrates the graph problem.

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: GtkPrintOperation; request for assistance

2017-02-10 Thread Norbert de Jonge
> For a simple printing example in C this is my try at it. 
> 
> https://github.com/cecashon/OrderedSetVelociRaptor/blob/master/Misc/Csamples/print_buffer1.c

Much appreciated Eric.

A question about this code. When I use, for example, the gedit text
editor, its File->Print... dialog includes a "Page Setup" tab where I
can use a "Paper size" drop-down to modify the paper size.

With your example, but also with the current GTK+ code for Ggradebook,
the "Paper size" drop-down is grayed out (disabled), /even/ after
selecting a valid printer.

The workaround I'm using with Ggradebook is to first run
gtk_print_run_page_setup_dialog(), then pass the resulting GtkPageSetup
values that the user supplied to the final dialog.

Is there a way to fix this.

In my opinion, your example application is close to being usable as a
generalized example. But it still needs to allow the user to specify a
paper format, and then extract margins - perhaps with a forced minimum -
and perform subsequent calculations based on those.

I'd like to end with a more general note about GTK+ and printing. This
is not about my work or your example, but something for the library
developers.

I'm a fan of GTK+ and have always been a fan. The printing
functionalities are extremely versatile. But it's difficult for me to
understand why there is no function that requires only a buffer (of any
size), font type and font size as parameters, then presents the user
with a print dialog. As a programmer, I don't want to think about
margins, pages, cairo, pango, and so on. I also feel sorry for all
other programmers who suddenly need to write begin_print() and
draw_page() functions just to print a buffer. I feel like there's room
for improvement here. :)

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: Identifying monitors

2017-02-09 Thread Norbert de Jonge
> I save preferences per monitor

I think giving us more context might be useful. What kind of things do
you save per monitor, and why? These are not things you could recreate
by scaling and positioning based on detected monitor dimensions?

If we're assuming monitors can be arbitrarily plugged in and out, and
detection is unreliable or users may even have unidentifiable monitors,
no function will ever help you. If this is not a cross-platform
application and you _really_ need to recognize monitors, your program
could make a system call to "xrandr --prop" and compare EDID strings.

If you save a collection of settings per monitor, maybe your application
should a) by default, assume the setup is unchanged, and b) allow users
to specify which collection of settings should be attached to which
monitor (location) if they decide to modify their setup.

If you have a broad range of users, all GTK+ 3.22 and newer functions,
including both gdk_monitor_get_model() and gdk_display_get_monitor(),
may be problematic. My reasoning is that Ubuntu Xenial (and thus Mint
Sarah, Mint Serena, and various others) provides 3.18.9 to users:
http://packages.ubuntu.com/search?keywords=libgtk-3-dev=names=xenial=all
All these users would need to manually compile GTK+ 3.22 or newer,
including all the dependencies it needs.

If we know what is the application's intended behavior that is causing
you explore saving settings per monitor, we may be able to offer
alternative solutions.

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: What does "Pango-CRITICAL **: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed" mean?

2017-02-08 Thread Norbert de Jonge
> It did not solve the Problem, [...]

Before I e-mailed my response I locally created a program that included
the function your posted. Double clicking the bottom field threw the
error you mentioned. After modifying the code as I described in my
previous post, the warning on the console disappeared. No warnings
remained; I solved your problem.

If I did not solve your problem and you're under the impression that I
gave you a "wrong answer", then either your question wasn't clear
enough or you did not include the code that actually caused the issue
you ran into.

I suggest that, next time you ask for help, you include a complete
working example program that reproduces the problematic behavior. This
prevents other people from having to do this work and getting back to
you with a solution that is valid but still insufficient.

> Thanks.

Sure.

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: GtkPrintOperation; request for assistance

2017-02-08 Thread Norbert de Jonge
Hi Emmanuele,

Thank you for your reply.

> [...], instead of generating a massive string and then
> sending it to lpr, [...]

I'm slightly confused, is that a description of what my code is
currently doing? If it is: I was unaware that the code is generating a
massive string.

My intention and understanding was that it sets margins and a font,
then sets the starting location to the top-left with cairo_move_to(),
and then starts making multiple PrintIt() calls.

Each PrintIt() call
- sets and shows text with pango_layout_set_text() and
  pango_cairo_show_layout(), and subsequently
- prepares for the arrival of additional text by updating the output
  location to the next line with cairo_rel_move_to().

I was hoping a cairo_rel_move_to() call to a location below the bottom
margin would automatically trigger the library to increment the page
number.

A more general remark. It's unfortunate that the GtkPrintOperation
documentation lacks (a link to) source code of a, as small as possible
but still complete, stand-alone example program that allows the user to
select a file of any size, and then pick a printer, paper size and
orientation, including preview option, and print. Such an example would
be user-friendly. Users, in this context, being programmers who work
with GTK+ and would like to use GtkPrintOperation.

I lack the energy to study GNOME Dictionary's gdict-print.c file in
hopes of solving the bug. I thought that my current code related to
printing is close to being correct. If I can't use PrintIt() as I'm
currently doing, I don't see myself rewriting what's necessary to make
it work.

How can I be so far away from a solution that I would need to study the
code of another program? I've already invested many hours into creating
its current printing functionality.

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: What does "Pango-CRITICAL **: pango_layout_get_cursor_pos: assertion 'index >= 0 && index <= layout->length' failed" mean?

2017-02-08 Thread Norbert de Jonge
> keybuf = gtk_entry_buffer_new ("Not yet generated", 45);

https://developer.gnome.org/gtk3/stable/GtkEntryBuffer.html#gtk-entry-buffer-new

The second parameter of gtk_entry_buffer_new() specifies the number of
characters in the string.

Either change 45 to 17 or to -1.

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


GtkPrintOperation; request for assistance

2017-02-06 Thread Norbert de Jonge
Hi all,

Yesterday, I finished the migration of a 16+ year old GTK+ 1.2
application to GTK+ 3.18.

The application is Ggradebook, the official GNU gradebook.
--
Websites:
http://www.norbertdejonge.nl/Ggradebook/
https://www.gnu.org/software/ggradebook/

Changelog:
http://www.norbertdejonge.nl/Ggradebook/ChangeLog.txt

Latest release, source code:
http://www.norbertdejonge.nl/software/Ggradebook-0.92.tar.gz
--

The migration process was easy.
Several people of Freenode's #gtk+ were helpful.
(Thanks!)

There's one known bug that was introduced during the migration.
A bug that I do not know how to fix.

In previous releases of the application, printing was done by writing
directly to "lpr". I want code to be C99 compatible, so I replaced the
popen() functions with GtkPrintOperation.

Currently, printing works properly, but both the preview and output end
after page 1. This is, of course, not the intended behavior.

A quick glance at the print.c source file shows the problem. The
relevant code is under "/*** print operation ***/" and in the PrintPage
function.

The solution... I don't know.

I would be grateful if someone is willing to took into this and help me
out. If substantial changes are required, I will gladly update future
releases to include an additional contributor entry in the package's
docs/AUTHORS.txt file.

I've been staring at, and experimenting with, the related code for
hours, and eventually decided to release with this known bug, because I
simply don't know how to fix the problem.

Hope to hear from 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


RE: Font selection panel

2017-01-04 Thread Op de Coul, Manuel
> Any idea how to do this under GTK+2?

I use this function in my code with 2.24. Fortunately my code is not newly 
written so it's ok to use deprecated functions (hint :-)

Manuel

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


Re: How to find replacements for deprecated functions

2016-11-30 Thread Erik de Castro Lopo
Emmanuele Bassi wrote:

> There is no direct replacement for GtkUIManager, in the sense that
> there is no API that you can use to immediately replace GtkUIManager.
> 
> GtkUIManager has been deprecated for a long time — it was deprecated
> in GTK+ 2.x, so it's not really a GTK+ 3.x issue.

Ok, so that sort of answered the specific question with regards to
GtkUIManager, but what about the more general question:

> How is someone like me supposed to figure out what to replace
> function X that has has been deprecated?

Erik
-- 
------
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

How to find replacements for deprecated functions

2016-11-30 Thread Erik de Castro Lopo
HI all,

I am an occassional GTK user, and often I work on resurrecting code
bases for which I am not the original author. As such I often run
into reprecation warnings. When I go to the documentation I find
things like this:


https://developer.gnome.org/gtk3/stable/GtkUIManager.html#gtk-ui-manager-get-widget

"gtk_ui_manager_get_widget has been deprecated since version 
 3.10 and should not be used in newly-written code."

How is someone like me supposed to figure out what to replace that
function with in the code I'm hacking on?

Erik
-- 
------
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Fwd: GTK+-3.18.6 make check issues

2016-05-16 Thread Jamenson Ferreira Espindula de Almeida Melo
symbolic-single-size:
(/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/.libs/lt-icontheme:29792):
Gtk-WARNING **: Could not find the icon 'only32-symbolic'. The 'hicolor'
theme was not found either, perhaps you need to install it. You can get
a copy from:
http://icon-theme.freedesktop.org/releases FAIL GTester: last
random seed: R02S41d7ae2ef64989fb68534ac6b243524f (pid=29807)
  /icontheme/svg-size:
(/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/.libs/lt-icontheme:29807):
Gtk-WARNING **: Could not find the icon 'twosize-fixed'. The 'hicolor'
theme was not found either, perhaps you need to install it. You can get
a copy from:
http://icon-theme.freedesktop.org/releases FAIL GTester: last
random seed: R02Se2402d30473b8500ece9d7cfe5ce2095 (pid=29822)
  /icontheme/size: **
(/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/.libs/lt-icontheme:29822):
ERROR **: Icon for "size-test" with flags 0 at size 20 should be
".../icons/25+/size-test.svg" but is ".../icons/16-22/size-test.png"
FAIL GTester: last random seed: R02S6e15a6acb58d7b81446fd8b25c16f1a9
(pid=29837)
  /icontheme/builtin: OK /icontheme/list: OK /icontheme/async:
(/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/.libs/lt-icontheme:29837):
Gtk-WARNING **: Could not find the icon 'twosize-fixed'. The 'hicolor'
theme was not found either, perhaps you need to install it. You can get
a copy from:
http://icon-theme.freedesktop.org/releases FAIL GTester: last
random seed: R02S8679301b7504cfaf15d690ebd2881945 (pid=29852)
  /icontheme/inherit:
(/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/.libs/lt-icontheme:29852):
Gtk-WARNING **: Could not find the icon 'one-two-three'. The 'hicolor'
theme was not found either, perhaps you need to install it. You can get
a copy from:
http://icon-theme.freedesktop.org/releases FAIL GTester: last
random seed: R02Sf32831930b4c91b65db2f4f474354cc0 (pid=29867)
  /icontheme/nonsquare-symbolic: **
ERROR:icontheme.c:720:test_nonsquare_symbolic: assertion failed (error
== NULL): Couldn't recognize the image file format for file
'/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk/icons/scalable/nonsquare-symbolic.svg'
(gdk-pixbuf-error-quark, 3) FAIL GTester: last random seed:
R02S546945d019c1a58942c995fffa92f9ec (pid=29882) FAIL: icontheme

Makefile:1695: recipe for target 'test-cwd' failed make[4]: ***
[test-cwd] Error 1 make[4]: Leaving directory
'/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk' Makefile:1553:
recipe for target 'check-am' failed make[3]: *** [check-am] Error 2
make[3]: Leaving directory
'/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk' Makefile:1555:
recipe for target 'check' failed make[2]: *** [check] Error 2 make[2]:
Leaving directory '/home/jamenson/Downloads/gtk+-3.18.6/testsuite/gtk'
Makefile:535: recipe for target 'check-recursive' failed make[1]: ***
[check-recursive] Error 1 make[1]: Leaving directory
'/home/jamenson/Downloads/gtk+-3.18.6/testsuite' Makefile:717: recipe
for target 'check-recursive' failed make: *** [check-recursive] Error 1

 End log ---

As the Linux From Scratch book recomends, I installed all of
gtk+-3.18.6 dependencies:

at-spi2-atk-2.18.1
gdk-pixbuf-2.32.3
Pango-1.38.1
hicolor-icon-theme-0.15
libxkbcommon-0.5.0
Wayland-1.10.0
adwaita-icon-theme-3.18.0


What should I do to solve this?

Thank you.


Jamenson Ferreira Espindula de Almeida Melo
GNU/Linux user # 166197
https://linuxcounter.net/cert/166197.png

Key fingerprint:
234D 1914 4224 7C53 BD13  6855 2AE0 25C0 08A8 6180
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Re[2]: argv

2016-04-16 Thread Errol van de l'Isle
> _pascal was used for older 16-bit Windows programs.
> _stdcall is used for newer 32-bit Windows programs.
> _cdecl is the defacto standard for all main() functions *declared* in
> C.
> 
> All three conventions use the same stack parameter order of right-to-
> left.

Pascal uses left to right.

“It’s wingardium leviOsa, not leviosAH.”
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Re[2]: argv

2016-04-16 Thread Errol van de l'Isle
> 1) The initial handling of argc and argv are not done by your
> application but
> by the linker.
Incorrect. The linker has nothing to do with argc and argv.

> 2) In C, argc and argv are on the stack, ready to be used, but not
> necessarily
> in assemblers
Yes and no :) It depends on what the start-up routine if any does
before calling main.

Are you linking in the C run-time start up. Under gcc this is crt0.o
and it is this which sets up the arguments for main() and other book
keeping before calling it.

In fact main() is not the starting point for any application and that
includes C.

There is no need for argc and argv to use gtk_init(). You can just pass
null pointers.

> You obviously know absolutely nothing about system assembly language
> programming, yet you are offering advice to people about it as if you
> were an
> expert? You shouldn't even be in this forum offering advice on things
> you know
> nothing about, so I am not responding to you anymore. You can BS some
> of the
> people some of the time, but you can't BS all the people all the
> time.
Now that is not nice. :( Yes I do know assembly language (several of
them) but it is not my first choice of language for doing any
programming unless it is very low level which the high level language
can not do such as switching privileges or very tight loops that need
to be very fast but even that may have minimal to zero gain over a high
level language. Those parts will only be a tiny part of an application.

Your problem has nothing to do with GTK or any other graphical tool
kit. It is all about how the application is started. Without knowing
how you are linking your application and with what, all we can do is
guess (or try to mind read) what you are doing.

If you can provide information on how you are linking your objects and
in what order then I may be able to spot where the error is. The best
would be the full linker command.

Got grade F in mind reading skills at Hogwarts.

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


Re: Re[2]: Re[2]: argv

2016-04-16 Thread Errol van de l'Isle

> Yes, I have a test program and it is the one I am debugging, and no,
> it won't
Is this test program in C and uses GTK so that you can confirm that you
are not getting any command line sent to the application. This way you
could narrow down where the error is. If the C test program gets the
arguments then it is your code. If it does not then you need to look
else where.

There are other possibilities to look for which are Microsoft specific.
Which can prevent arguments being passed. https://msdn.microsoft.com/en
-us/library/zay8tzh6.aspx could be an issue. There can be different C
run time start up code so make sure that you have one and the right
one.

You can get the command line using the Microsoft API https://msdn.micro
soft.com/en-us/library/windows/desktop/ms683156%28v=vs.85%29.aspx and h
ttps://msdn.microsoft.com/en-
us/library/windows/desktop/bb776391%28v=vs.85%29.aspx which is what the
C runtime will call anyway.

> one of the (hidden) reasons I came here. Is this just a problem with
 Don't hide information

I'm a lumberjack, and I'm okay,
I sleep all night and I work all day.

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

Re: Re[2]: argv

2016-04-16 Thread Errol van de l'Isle
> 1) It uses the 64-bit Linux libraries whereas I am using the 32-bit
> Win
Should not really matter

> 2) GCC assembly language sucks :^)
It uses AT syntax which many think is not nice to read.

> 3) Despite #2 above, I noticed something very peculiar about the
> disassembly
> code. For argv, GCC uses a 32-bit register, whereas for the argc, GCC
> uses a
> 64-bit register. This isn't documented anywhere. Does this apply to
> 32-bit Win
> code as well, i.e. -- argv would use a 32-bit register and argc would
> use a
> 16-bit register? This disassembly example violates the 64-bit code
> convention
> used by the C standard and by the Win and Linux OSes as well.
You might have come across the nightmare of which calling convention to
use. Things vary between OS and compiler! This document might be of
interest http://agner.org/optimize/calling_conventions.pdf  .

> 4) The documentation implies argc and argv are consecutive
This is the C convention.

> 5) It uses the Gtk+2 libraries whereas I am using Gtk+3. It appears
> that the
> Gtk+2 libraries pass parameters in the registers and there is no
> stack
> cleanup, whereas the Gtk+3 libraries pass parameters on the stack and
> stack
> cleanup is required. Again, not documented. This may not matter
> unless I
> wanted to convert my application later on to 64-bit, so this is good
> to know
> beforehand.
See 3. This is again the problem of calling convention.

The majority of people will use GTK from a high level language so
questions on assembly would not be second nature.

When replying to the mailing list only reply to the list and do not
include the personal e-mail address of others in the mailing list. They
will get two copies of your message and will probably (and possible
have) get a little bit fed up to put it nicely.

Your original posting was fairly terse which lead to others assuming
that you did not know much on the subject. To many it looks like you
had only got to the parsing the augments stage and no further :-/ . If
the others on the list are still reading, play nicely now there is no
need to start a flame war. :o)

Back to your original problem :-) You may have done this already. Have
you tried making a test application using the libraries you are using
in C, C++ or D. You will need to make sure that you are using the same
memory model etc. as your assembly. All this needs to do is get the
command line arguments, print them to the terminal (or where ever you
want) and then display a dialog window where you click on a button to
exit. This would make sure that you have GTK compiled in, test that you
can get the arguments and see what code is actually generated for the
GUI application.

Always look on the bright side of life
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: G_UTF8String: Boxed Type Proposal

2016-03-19 Thread Errol van de l'Isle
Just to add my two cents worth as a user of glibmm.

Glib::usting uses g_utf8_pointer_to_offset() to obtain the length of
the string in characters in the method Glib::ustring::length. The
method Glib::ustring::bytes returns the length in bytes;

At no point does it store the number of UTF-8 characters as this would
be inefficient.

For simple string manipulation like inserting a string or character or
concatenating would require extra work to be done. The string needs to
be checked that it is still valid UTF-8 before the length is updated.
The next issue is what to do when the string becomes invalid UTF-8.
Doing this for every string operation will have a performance
implication. Imagine doing this in a loop inserting a byte from a
stream!

Checking at the end of all the operations or handing it over to GTK to
deal with the problems will be more efficient and less of a headache.

On Fri, 2016-03-18 at 10:19 -0400, Randall Sawyer wrote:
> On 03/18/2016 10:10 AM, Florian Müllner wrote:
> > On Fri, Mar 18, 2016 at 2:57 PM Randall Sawyer  > mail.me> wrote:
> > > how about the following modifications?
> > > Change "gstring.h":
> > > ...
> > > struct _GString
> > > {
> > >    gchar  *str;
> > >    gsize len;
> > >    gsize allocated_len;
> > >    gsize utf8_len;
> > > };
> > > ...
> > > 
> >  Changing the size of a public struct is an ABI break, so this is
> > not an option for glib-2.x.
>  
> So, does that answer question 4?
> 
> Also - I just discovered that glibmm has a class Glib::ustring (https
> ://developer.gnome.org/glibmm/stable/classGlib_1_1ustring.html). I am
> going to take a look through its source to see what they have there.
> 
> ___
> gtk-devel-list mailing list
> gtk-devel-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-devel-list
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-17 Thread dE

On 06/16/13 21:35, Chris Vine wrote:

On Sun, 16 Jun 2013 12:28:52 +0530
dE de.tec...@gmail.com wrote:

Apart from that, in the free_ptr? Does memory get freed for anyone
else?

#include stdio.h
#include gtk/gtk.h
#define COLS 200
void free_ptr ( GtkListStore * );

int main (  ) {
  gtk_init( NULL, NULL );
  int i, j;
  char *temp;
  GtkTreeIter current;
  GType *str_type = g_malloc (sizeof (GType) * COLS);
  for (i = 0; i  COLS; i++)
  str_type [i] = G_TYPE_STRING;
  GtkListStore *store = gtk_list_store_newv (COLS, str_type);
  g_free (str_type);
  for (i = 0; i  30 ; i++) {
  gtk_list_store_append ( store, current );
  for ( j = 0 ; j  COLS ; j++ ) {
  gtk_list_store_set ( store , current , j , Hello world
Hello world Hello world!, -1 );
  }
  }
  printf ( freeing after 10 seconds\n );
  sleep (10);
  free_ptr ( store );
  printf (Now freed\n);
  sleep (10);
  return 0;
}

void free_ptr ( GtkListStore *store ) {
  gtk_list_store_clear (store);
  g_object_unref( G_OBJECT (store) );
}

You should compile your code with warnings enabled.  Then you would
find out other things about your code (namely that 'temp' is not used).
Apart from that, technically the code is OK and it does destroy the
list store correctly.

Turning to the main point, the thing about your code is that it is
inadequate for detecting memory leakage, because it does not take
account of caching.  To come up with a meaningful test, you need to
rerun the memory-using code more than once in the program.  If you do
so, you will find that on each run other than the first, memory usage
does not increase.  From this I deduce (I hope) that list stores cache
the memory allocated to individual records for reuse. Presumably that
is thought to be an optimization for most uses.  In the pathological
case of a list store with 30 x 300 cells holding allocated strings
that clearly is not the case, but a list store with so many cells would
be unusably slow anyway when used in conjunction with a tree view.

There are various additional things you can do to check memory usage:
see https://developer.gnome.org/glib/2.36/glib-running.html .

For those kinds of pathological cases, you probably need to write your
own tree model which does things the way you want them.

Chris


I've realized, out of the allocated memory, after freeing it, although 
it's usage doesn't decrease, but if I start other programs which consume 
memory, it's memory usage decreases.

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


Re: GTK free function doesn't appear to have any affect.

2013-06-16 Thread dE

On 06/16/13 00:40, Allin Cottrell wrote:

On Sat, 15 Jun 2013, dE wrote:


On 06/15/13 14:24, dE wrote:
Yes, I realized that over time, but there appears to be something 
wrong with g_object_unref or in general all GTK free functions on my 
system.


In this piece of code --

#include stdio.h
#include gtk/gtk.h
#include stdlib.h
#include string.h
#define COLS 300
void main (  ) {
   gtk_init( NULL, NULL );


int i, j;
   char *temp;
   GtkTreeIter current;
   GType *str_type = g_malloc (sizeof (GType) * COLS);
for (i = 0; i = COLS; i++)
str_type [i] = G_TYPE_STRING;
   GtkListStore *store = gtk_list_store_newv (COLS, str_type);
   g_free (str_type);
   for (i = 0; i  30 ; i++) {
  gtk_list_store_append ( store, current );
   for ( j = 0 ; j  COLS ; j++ ) {
gtk_list_store_set ( store , current , j , Hello world 
Hello world Hello world!, -1 );

  }
   }
   printf ( freeing after 10 seconds\n );
   sleep (10);
   free_ptr ( store );
   printf (Now freed\n);
   sleep (10);
}

free_ptr ( GtkListStore *store ) {
   gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
}

Calling free_ptr ( store ); increases memory usage, even during the 
last 10 second free period. It'll take at most 7GB of memory.


Here there're no GtkWidgets involved. GtkListStore inherits directly 
from GObject.


Is this piece of code itself ok?


Certainly not. void main() is not valid C for a start (main must 
return int), then the first loop runs off the end of the str_type 
array...


Allin Cottrell



Apart from that, in the free_ptr? Does memory get freed for anyone else?

#include stdio.h
#include gtk/gtk.h
#define COLS 200
void free_ptr ( GtkListStore * );

int main (  ) {
gtk_init( NULL, NULL );
int i, j;
char *temp;
GtkTreeIter current;
GType *str_type = g_malloc (sizeof (GType) * COLS);
for (i = 0; i  COLS; i++)
str_type [i] = G_TYPE_STRING;
GtkListStore *store = gtk_list_store_newv (COLS, str_type);
g_free (str_type);
for (i = 0; i  30 ; i++) {
gtk_list_store_append ( store, current );
for ( j = 0 ; j  COLS ; j++ ) {
gtk_list_store_set ( store , current , j , Hello world 
Hello world Hello world!, -1 );

}
}
printf ( freeing after 10 seconds\n );
sleep (10);
free_ptr ( store );
printf (Now freed\n);
sleep (10);
return 0;
}

void free_ptr ( GtkListStore *store ) {
gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
}
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-16 Thread dE

On 06/16/13 21:35, Chris Vine wrote:

On Sun, 16 Jun 2013 12:28:52 +0530
dE de.tec...@gmail.com wrote:

Apart from that, in the free_ptr? Does memory get freed for anyone
else?

#include stdio.h
#include gtk/gtk.h
#define COLS 200
void free_ptr ( GtkListStore * );

int main (  ) {
  gtk_init( NULL, NULL );
  int i, j;
  char *temp;
  GtkTreeIter current;
  GType *str_type = g_malloc (sizeof (GType) * COLS);
  for (i = 0; i  COLS; i++)
  str_type [i] = G_TYPE_STRING;
  GtkListStore *store = gtk_list_store_newv (COLS, str_type);
  g_free (str_type);
  for (i = 0; i  30 ; i++) {
  gtk_list_store_append ( store, current );
  for ( j = 0 ; j  COLS ; j++ ) {
  gtk_list_store_set ( store , current , j , Hello world
Hello world Hello world!, -1 );
  }
  }
  printf ( freeing after 10 seconds\n );
  sleep (10);
  free_ptr ( store );
  printf (Now freed\n);
  sleep (10);
  return 0;
}

void free_ptr ( GtkListStore *store ) {
  gtk_list_store_clear (store);
  g_object_unref( G_OBJECT (store) );
}

You should compile your code with warnings enabled.  Then you would
find out other things about your code (namely that 'temp' is not used).
Apart from that, technically the code is OK and it does destroy the
list store correctly.

Turning to the main point, the thing about your code is that it is
inadequate for detecting memory leakage, because it does not take
account of caching.  To come up with a meaningful test, you need to
rerun the memory-using code more than once in the program.  If you do
so, you will find that on each run other than the first, memory usage
does not increase.  From this I deduce (I hope) that list stores cache
the memory allocated to individual records for reuse. Presumably that
is thought to be an optimization for most uses.  In the pathological
case of a list store with 30 x 300 cells holding allocated strings
that clearly is not the case, but a list store with so many cells would
be unusably slow anyway when used in conjunction with a tree view.

There are various additional things you can do to check memory usage:
see https://developer.gnome.org/glib/2.36/glib-running.html .

For those kinds of pathological cases, you probably need to write your
own tree model which does things the way you want them.

Chris


Yes, I've realized in the main program that once memory is consumed, it 
does not increase after the table is reloaded; however I filled the 
memory till the peak (=physical ram + some of swap), it still doesn't 
free for 10 seconds at least.


I'm running the link you provided. Thank you!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-15 Thread dE

On 06/15/13 03:35, Chris Vine wrote:

On Fri, 14 Jun 2013 23:03:55 +0530
dE de.tec...@gmail.com wrote:

On 06/14/13 22:09, Chris Vine wrote:

On Fri, 14 Jun 2013 21:41:05 +0530
dEde.tec...@gmail.com  wrote:

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dEde.tec...@gmail.com  wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the
memory usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory
to the OS.

No, filled more than 7GB, swap was at ~350 MB, and then I loaded a
small table which would otherwise take less than 10 MB memory, but
the memory usage increased.

Can you post the smallest compilable program which demonstrates your
problem (run with G_SLICE=always-malloc set), and with particulars
of how you are measuring memory usage?  That should identify if you
are doing something wrong with how you are handling the memory in
your program.

Chris


You can have the whole source code:

http://pastebin.com/4a5DiMsQ

I'd been distributing it around to fix issues.

This isn't going to help I am afraid.

On some general observations on your earlier questions however:

A GtkBuilder object is a plain GObject.  It will be freed by calling
g_object_unref() on it.  That will also cause it to release its
references to the objects it has created.  Whether that will destroy
those created objects depends on whether there are any other
references to them which have been acquired, such as by their having
been put in a container.  If so, then you need to release those other
references as well in order to destroy the created objects and free
their memory.  Top level windows need to have gtk_widget_destroy()
called on them.  If you want to remove a widget from a container or top
level window but keep the container or top level window alive, you can
cause the container to release its reference with
gtk_container_remove().  If you want all containers holding a reference
to a particular GtkWidget to release their references so leading to the
widget's destruction, call gtk_widget_destroy() on the widget.

For plain GObjects, namely those which are not created with a floating
reference (and so are not derived from GInitiallyUnowned/GtkWidget),
to free them you need to have called g_object_unref() on them explicitly
as well as destroy (or remove them from) their container (if any):
except that GtkBuilder will already have done that for you if it
supplies a plain GObject already embedded in a container it has
supplied. For objects derived from GInitiallyUnowned/GtkWidget,
destroying (or removing them from) their container by one of the means
mentioned above is enough.

You may be aware of all that.  If so I am afraid you need to break your
code down to see whether you have discovered a referencing bug (not
likely but possible - I have reported referencing bugs before now), or
you have neglected to release something somewhere.

Chris


Yes, I realized that over time, but there appears to be something wrong 
with g_object_unref or in general all GTK free functions on my system.


In this piece of code --

#include stdio.h
#include gtk/gtk.h
#include stdlib.h
#include string.h
#define COLS 300
void main (  ) {
   gtk_init( NULL, NULL );


int i, j;
   char *temp;
   GtkTreeIter current;
   GType *str_type = g_malloc (sizeof (GType) * COLS);
for (i = 0; i = COLS; i++)
str_type [i] = G_TYPE_STRING;
   GtkListStore *store = gtk_list_store_newv (COLS, str_type);
   g_free (str_type);
   for (i = 0; i  30 ; i++) {
  gtk_list_store_append ( store, current );
   for ( j = 0 ; j  COLS ; j++ ) {
gtk_list_store_set ( store , current , j , Hello world Hello 
world Hello world!, -1 );

  }
   }
   printf ( freeing after 10 seconds\n );
   sleep (10);
   free_ptr ( store );
   printf (Now freed\n);
   sleep (10);
}

free_ptr ( GtkListStore *store ) {
   gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
}

Calling free_ptr ( store ); increases memory usage, even during the last 
10 second free period. It'll take at most 7GB of memory.


Here there're no GtkWidgets involved. GtkListStore inherits directly 
from GObject.

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


Re: GTK free function doesn't appear to have any affect.

2013-06-15 Thread dE

On 06/15/13 14:24, dE wrote:

On 06/15/13 03:35, Chris Vine wrote:

On Fri, 14 Jun 2013 23:03:55 +0530
dE de.tec...@gmail.com wrote:

On 06/14/13 22:09, Chris Vine wrote:

On Fri, 14 Jun 2013 21:41:05 +0530
dEde.tec...@gmail.com  wrote:

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dEde.tec...@gmail.com  wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the
memory usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory
to the OS.

No, filled more than 7GB, swap was at ~350 MB, and then I loaded a
small table which would otherwise take less than 10 MB memory, but
the memory usage increased.

Can you post the smallest compilable program which demonstrates your
problem (run with G_SLICE=always-malloc set), and with particulars
of how you are measuring memory usage?  That should identify if you
are doing something wrong with how you are handling the memory in
your program.

Chris


You can have the whole source code:

http://pastebin.com/4a5DiMsQ

I'd been distributing it around to fix issues.

This isn't going to help I am afraid.

On some general observations on your earlier questions however:

A GtkBuilder object is a plain GObject.  It will be freed by calling
g_object_unref() on it.  That will also cause it to release its
references to the objects it has created.  Whether that will destroy
those created objects depends on whether there are any other
references to them which have been acquired, such as by their having
been put in a container.  If so, then you need to release those other
references as well in order to destroy the created objects and free
their memory.  Top level windows need to have gtk_widget_destroy()
called on them.  If you want to remove a widget from a container or top
level window but keep the container or top level window alive, you can
cause the container to release its reference with
gtk_container_remove().  If you want all containers holding a reference
to a particular GtkWidget to release their references so leading to the
widget's destruction, call gtk_widget_destroy() on the widget.

For plain GObjects, namely those which are not created with a floating
reference (and so are not derived from GInitiallyUnowned/GtkWidget),
to free them you need to have called g_object_unref() on them explicitly
as well as destroy (or remove them from) their container (if any):
except that GtkBuilder will already have done that for you if it
supplies a plain GObject already embedded in a container it has
supplied. For objects derived from GInitiallyUnowned/GtkWidget,
destroying (or removing them from) their container by one of the means
mentioned above is enough.

You may be aware of all that.  If so I am afraid you need to break your
code down to see whether you have discovered a referencing bug (not
likely but possible - I have reported referencing bugs before now), or
you have neglected to release something somewhere.

Chris


Yes, I realized that over time, but there appears to be something 
wrong with g_object_unref or in general all GTK free functions on my 
system.


In this piece of code --

#include stdio.h
#include gtk/gtk.h
#include stdlib.h
#include string.h
#define COLS 300
void main (  ) {
   gtk_init( NULL, NULL );


int i, j;
   char *temp;
   GtkTreeIter current;
   GType *str_type = g_malloc (sizeof (GType) * COLS);
for (i = 0; i = COLS; i++)
str_type [i] = G_TYPE_STRING;
   GtkListStore *store = gtk_list_store_newv (COLS, str_type);
   g_free (str_type);
   for (i = 0; i  30 ; i++) {
  gtk_list_store_append ( store, current );
   for ( j = 0 ; j  COLS ; j++ ) {
gtk_list_store_set ( store , current , j , Hello world Hello 
world Hello world!, -1 );

  }
   }
   printf ( freeing after 10 seconds\n );
   sleep (10);
   free_ptr ( store );
   printf (Now freed\n);
   sleep (10);
}

free_ptr ( GtkListStore *store ) {
   gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
}

Calling free_ptr ( store ); increases memory usage, even during the 
last 10 second free period. It'll take at most 7GB of memory.


Here there're no GtkWidgets involved. GtkListStore inherits directly 
from GObject.


Is this piece of code itself ok?
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE
I was monitoring the memory usage before and after execution of 
g_object_unref and gtk_list_store_clear, and it didnt change the memory 
usage by a bit.


Is this normal (am I doing it right?)?

e.g. --
gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
g_object_unref ( G_OBJECT ( col_renderer [j] ));

Same goes with GtkBuilder structures.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 13:24, Andrew Potter wrote:

On Fri, Jun 14, 2013 at 12:27 AM, dE de.tec...@gmail.com wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the memory
usage by a bit.

Is this normal (am I doing it right?)?

e.g. --
gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );
g_object_unref ( G_OBJECT ( col_renderer [j] ));

Do you have a treeview that is internally holding a reference to the list store?

I don't know about the GtkBuilder structures.

Also, g_new uses g_slice internally sometimes, and that will do things
like try to cache pages I think. Be sure to set the G_SLICE
environment variable to always-malloc when monitoring your memory
usage. See [1]

[1] https://developer.gnome.org/glib/2.36/glib-running.html


Before I unref and clear the ListStore I'm running 
gtk_tree_view_set_model (GtkTreeView *, NULL) on the TreeModel.


However there's a GtkTreeModelSort which holds the ListStore, this 
GtkTreeModelSort is then added to the TreeView.


I didnt find a way to unset the GtkTreeModelSort and the ListStore, but 
before I clear and unref the ListStore, I unref the GtkTreeModelSort.



gtk_tree_view_set_model ( ddisplay , NULL );
//unref to the TreeModelSort
g_object_unref ( G_OBJECT ( inter_sort ) );

gtk_list_store_clear (store);
g_object_unref( G_OBJECT (store) );

Setting export G_SLICE=always-malloc did nothing.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dE de.tec...@gmail.com wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the memory
usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory to
the OS.


So I'll try allocating like 7GB of memory to fill up the ram, after 
finishing, it should free. I'll report back.

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


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dE de.tec...@gmail.com wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the memory
usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory to
the OS.


No, filled more than 7GB, swap was at ~350 MB, and then I loaded a small 
table which would otherwise take less than 10 MB memory, but the memory 
usage increased.

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


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 21:14, Tristan Van Berkom wrote:

On Sat, Jun 15, 2013 at 12:23 AM, dE de.tec...@gmail.com wrote:

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dE de.tec...@gmail.com wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the memory
usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory to
the OS.


So I'll try allocating like 7GB of memory to fill up the ram, after
finishing, it should free. I'll report back.

For more fine grained memory profiling you should use valgrind.

See some hints here for running your Glib program with valgrind:
 https://live.gnome.org/Valgrind

Cheers,
 -Tristan


http://forums.gentoo.org/viewtopic-t-961762.html

Do we have no other options? Like some kind of 'code sanitizer' which 
detects flaws in code related to memory?

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


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 22:09, Chris Vine wrote:

On Fri, 14 Jun 2013 21:41:05 +0530
dEde.tec...@gmail.com  wrote:

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dEde.tec...@gmail.com  wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the
memory usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory
to the OS.

No, filled more than 7GB, swap was at ~350 MB, and then I loaded a
small table which would otherwise take less than 10 MB memory, but
the memory usage increased.

Can you post the smallest compilable program which demonstrates your
problem (run with G_SLICE=always-malloc set), and with particulars of
how you are measuring memory usage?  That should identify if you are
doing something wrong with how you are handling the memory in your
program.

Chris



You can have the whole source code:

http://pastebin.com/4a5DiMsQ

I'd been distributing it around to fix issues.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: GTK free function doesn't appear to have any affect.

2013-06-14 Thread dE

On 06/14/13 23:14, Tristan Van Berkom wrote:

On Sat, Jun 15, 2013 at 2:33 AM, dE de.tec...@gmail.com wrote:

On 06/14/13 22:09, Chris Vine wrote:

On Fri, 14 Jun 2013 21:41:05 +0530
dEde.tec...@gmail.com  wrote:

On 06/14/13 17:02, Matthias Clasen wrote:

On Fri, Jun 14, 2013 at 3:27 AM, dEde.tec...@gmail.com  wrote:

I was monitoring the memory usage before and after execution of
g_object_unref and gtk_list_store_clear, and it didnt change the
memory usage by a bit.

Is this normal (am I doing it right?)?

What are you monitoring, and how ?

It is i normal that freeing memory does not change the resource
consumption of the process. The freed memory will be available for
reuse by malloc, but malloc does not immediately return the memory
to the OS.

No, filled more than 7GB, swap was at ~350 MB, and then I loaded a
small table which would otherwise take less than 10 MB memory, but
the memory usage increased.

Can you post the smallest compilable program which demonstrates your
problem (run with G_SLICE=always-malloc set), and with particulars of
how you are measuring memory usage?  That should identify if you are
doing something wrong with how you are handling the memory in your
program.

Chris


You can have the whole source code:

http://pastebin.com/4a5DiMsQ

I'd been distributing it around to fix issues.

dE,

Surely you can conjure something small which you expect
not to leak memory, but does.

Obviously, there must be a leak in this program, but
sending us this huge file sort of implies that we should
do the debugging and find your memory leak for you.

If you send us something small, as Chris says:
 the smallest compilable program which demonstrates
  your problem,

then we can surely easily spot the problem and guide you
on how to fix it, without spending our time doing your homework.

Cheers,
 -Tristan


So I'll make a large GtkTreeStore, and try to free it.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Prevent sort of GtkListStore.

2013-06-13 Thread dE

On 06/13/13 18:49, Tristan Van Berkom wrote:

On Wed, Jun 12, 2013 at 11:38 PM, dE de.tec...@gmail.com wrote:

With gtk_tree_view_column_set_sort_column_id (), it appears that
GtkListStore also gets sorted.

I don't want that to happen, since the data in it has to be compared.

The sorting of GtkTreeView actually sorts the model, it does so
using the GtkTreeSortable interface.

If you dont want the data model to actually be modified by sorting,
then you can use a GtkTreeModelSort, which is an intermediate
data model for this particular purpose (just set the GtkTreeModelSort
as the model for the GtkTreeView, and set your data model as the
child model of the GtkTreeModelSort).

Cheers,
 -Tristan


How can I do this? Thanks!!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


THAT'S IT!!! YES!! THANK YOU!!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Prevent sort of GtkListStore.

2013-06-12 Thread dE
With gtk_tree_view_column_set_sort_column_id (), it appears that 
GtkListStore also gets sorted.


I don't want that to happen, since the data in it has to be compared.

How can I do this? Thanks!!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Prevent sort of GtkListStore.

2013-06-12 Thread dE

On 06/12/13 21:24, אנטולי קרסנר wrote:

I'm not sure what's the GTK equivalent, but in gtkmm (the C++ binding)
it's possible to give a TreeView separate sorting which doesn't affect
the data, and have multiple Views to sort the same TreeStore using
different columns.

I assume it's possible for ListStore too. The GTK API ref / tutorial
probably mentions that where it explains sorting.

I hope that helps, a bit of digging there will probably get you what
you're looking for...

Anatoly

On ד', 2013-06-12 at 20:08 +0530, dE wrote:

With gtk_tree_view_column_set_sort_column_id (), it appears that
GtkListStore also gets sorted.

I don't want that to happen, since the data in it has to be compared.

How can I do this? Thanks!!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list




There's some mention of gtk_tree_sortable_set_sort_column ( ) in 
GtkTreeViewColumn documentation, but there's no mention of it anywhere 
else. While compiling, this function is not found.

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

GtkBuilder causing memory leaks?

2013-06-11 Thread dE

The following code spawns a window --

if (connect_build_object != NULL) {
g_object_unref (G_OBJECT ( connect_build_object ));
object = NULL;
}
connect_build_object = gtk_builder_new();
gtk_builder_add_from_file ( connect_build_object, 
main_window.glade, NULL );

gtk_builder_connect_signals ( connect_build_object, NULL );
connect_window = GTK_WIDGET ( gtk_builder_get_object ( 
connect_build_object, connec ) );

gtk_widget_show ( connect_window );

Where connect_build_object is a global variable.

Before spawning, it's checked if connect_build_object is initilized, if 
that's the case, its destroyed by g_object_unref.


Closing the window calls the default handler.

Problem: Each time I open and close a window, memory usage increases.

I don't understand the problem. Please help!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Get column no. of edited cell.

2013-06-02 Thread dE

On 06/02/13 00:27, Arnel A. Borja wrote:

On Sunday, 02 June, 2013 01:44 AM, dE wrote:
I've set the editable property of GtkCellRenderer to true, and set 
the call back for the edited signal.


This particular signal tells the node/row in which the edit has 
occurred, but not the column/filed. How can I get that?


Thanks!


Use a different renderer for each column. Then check in the edited 
signal which renderer was edited.


I'm trying this out, but isnt this also possible with 
gtk_tree_view_get_cursor clubbed with 
gtk_tree_view_column_get_sort_column_id.


Cause I'm getting segfault with --

gtk_tree_view_get_cursor ( detect_object ( DataDisplay, build_object 
), tree_path, focus_column );


Where --

GtkTreeViewColumn **focus_column;
GtkTreePath **tree_path;
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Get column no. of edited cell.

2013-06-02 Thread dE

On 06/02/13 12:49, Arnel A. Borja wrote:

On Sunday, 02 June, 2013 02:15 PM, dE wrote:
I'm trying this out, but isnt this also possible with 
gtk_tree_view_get_cursor clubbed with 
gtk_tree_view_column_get_sort_column_id.


Cause I'm getting segfault with --

gtk_tree_view_get_cursor ( detect_object ( DataDisplay, 
build_object ), tree_path, focus_column );


Where --

GtkTreeViewColumn **focus_column;
GtkTreePath **tree_path;


This is what the documentation says about the parameters of 
gtk_tree_view_get_cursor 
(https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-get-cursor):

/|
tree_view|/ : A GtkTreeView
/|path|/ : A pointer to be filled with the current cursor path, 
orNULL.*[**out**]*[transfer full][allow-none]
/|focus_column|/: A pointer to be filled with the current focus 
column, orNULL.*[**out**]*[transfer full][allow-none]


Noticed the [out] in path and focus column? That means you have to 
pass the pointers to a (GtkTreeViewColumn *) variable and a 
(GtkTreePath *) variable, instead of passing a (GtkTreeViewColumn **) 
variable and a (GtkTreePath **) variable.


You may do something like this then:

GtkTreeViewColumn *focus_column;
GtkTreePath *tree_path;

gtk_tree_view_get_cursor ( detect_object ( DataDisplay, build_object 
), tree_path, focus_column );


Now focus_column and tree_path contains the currently focused column 
and path to its row, respectively.


Yes, now it works. Thanks!

However, it appears that this is not something suitable for the task, 
since this particular event edited (GtkCellRender) is triggered after 
the editing has finished. As a result, I get -1 with 
gtk_tree_view_column_get_sort_column_id (focus_column).


So I've tried out your original technique, but I'm having some issues 
there --


I'm comparing the passed over GtkCellRenderer * with all renderers as 
such --


while ( mod_renderer != *(renderer + i) )
i++;

Where mod_renderer is the passed over GtkCellRenderer and renderer is  --

GtkCellRenderer **renderer;

and allocated memory via --

GtkCellRenderer **renderer = g_malloc (sizeof (GtkCellRenderer*) * 2);
renderer[0] = gtk_cell_renderer_text_new ();
renderer[1] = gtk_cell_renderer_text_new ();

I'm getting sefault in the while loop.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: Get column no. of edited cell.

2013-06-02 Thread dE

On 06/02/13 14:30, Arnel A. Borja wrote:

On Sunday, 02 June, 2013 03:35 PM, dE wrote:

On 06/02/13 12:49, Arnel A. Borja wrote:

On Sunday, 02 June, 2013 02:15 PM, dE wrote:
I'm trying this out, but isnt this also possible with 
gtk_tree_view_get_cursor clubbed with 
gtk_tree_view_column_get_sort_column_id.


Cause I'm getting segfault with --

gtk_tree_view_get_cursor ( detect_object ( DataDisplay, 
build_object ), tree_path, focus_column );


Where --

GtkTreeViewColumn **focus_column;
GtkTreePath **tree_path;


This is what the documentation says about the parameters of 
gtk_tree_view_get_cursor 
(https://developer.gnome.org/gtk3/stable/GtkTreeView.html#gtk-tree-view-get-cursor):

/|
tree_view|/ : A GtkTreeView
/|path|/ : A pointer to be filled with the current cursor path, 
orNULL.*[**out**]*[transfer full][allow-none]
/|focus_column|/: A pointer to be filled with the current focus 
column, orNULL.*[**out**]*[transfer full][allow-none]


Noticed the [out] in path and focus column? That means you have to 
pass the pointers to a (GtkTreeViewColumn *) variable and a 
(GtkTreePath *) variable, instead of passing a (GtkTreeViewColumn 
**) variable and a (GtkTreePath **) variable.


You may do something like this then:

GtkTreeViewColumn *focus_column;
GtkTreePath *tree_path;

gtk_tree_view_get_cursor ( detect_object ( DataDisplay, 
build_object ), tree_path, focus_column );


Now focus_column and tree_path contains the currently focused column 
and path to its row, respectively.


Yes, now it works. Thanks!

However, it appears that this is not something suitable for the task, 
since this particular event edited (GtkCellRender) is triggered 
after the editing has finished. As a result, I get -1 with 
gtk_tree_view_column_get_sort_column_id (focus_column).


So I've tried out your original technique, but I'm having some issues 
there --


I'm comparing the passed over GtkCellRenderer * with all renderers as 
such --


while ( mod_renderer != *(renderer + i) )
i++;

Where mod_renderer is the passed over GtkCellRenderer and renderer 
is  --


GtkCellRenderer **renderer;

and allocated memory via --

GtkCellRenderer **renderer = g_malloc (sizeof (GtkCellRenderer*) * 2);
renderer[0] = gtk_cell_renderer_text_new ();
renderer[1] = gtk_cell_renderer_text_new ();

I'm getting sefault in the while loop.
Your comparing a GtkCellRenderer and a GtkCellRendererText here. Try 
casting like this:


while (GTK_CELL_RENDERER (mod_renderer) != GTK_CELL_RENDERER 
(renderer[i]))

i++;

Or just store them as GtkCellRendererText:

GtkCellRendererText **renderer = g_malloc (sizeof 
(GtkCellRendererText*) * 2);

renderer[0] = gtk_cell_renderer_text_new ();
renderer[1] = gtk_cell_renderer_text_new ();

But still, this is quite dangerous, since mod_renderer may really not 
in renderer. You may use if/else blocks:


/* mod_renderer and renderer[i] should be GtkCellRendererText */
if (mod_renderer == renderer[0])
{
/* renderer[0] edited */
}
else if (mod_renderer == renderer[1])
{
/* renderer[1] edited */
}

Though usually when I want to do something like this, I would connect 
to each cell renderer, with each one have their own callback.


Something like this:

renderer1 = gtk_cell_renderer_text_new ();
g_signal_connect (renderer1, edited, on_renderer1_edited, my_data);

renderer2 = gtk_cell_renderer_text_new ();
g_signal_connect (renderer2, edited, on_renderer2_edited, my_data);

Then I'll just do what I need to do inside the two callbacks.

You may also want to read this tutorial about GtkTreeView's: 
http://scentric.net/tutorial/



YES GOT IT!!

It was g_object_get/set_data. Although I did view that tutorial, but not 
in that much detail.


Thank you so much!!
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


gtk_list_store_set issues.

2013-06-01 Thread dE

Hello everyone!

This is my first time serious programming in C, and I'm using GTK for this.

In a ListStore, I'm trying to add data to it via --

gtk_list_store_set ( list, current, 0, test00, 1, test01, -1 );

However, in both the columns I get test00 instead.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list


Re: gtk_list_store_set issues.

2013-06-01 Thread dE

On 06/01/13 20:38, Arnel A. Borja wrote:

On Saturday, 01 June, 2013 10:49 PM, dE wrote:
Hi,


Hello everyone!

This is my first time serious programming in C, and I'm using GTK for 
this.


In a ListStore, I'm trying to add data to it via --

gtk_list_store_set ( list, current, 0, test00, 1, test01, -1 );

However, in both the columns I get test00 instead.
Do you mean GtkTreeViewColumn when you said columns? Make sure that 
you set attributes properly (one way of doing that is using 
gtk_tree_view_insert_column_with_attributes). Maybe you could post 
your code here (especially the part where the tree view is created).


Yes, I meant GtkTreeViewColumn.

GtkCellRenderer *renderer = gtk_cell_renderer_text_new ();
GtkTreeViewColumn **test_col = g_malloc (sizeof (GtkTreeViewColumn 
*) * 2);


test_col [0] = gtk_tree_view_column_new_with_attributes ( test0, 
renderer, text, 0, NULL );
test_col [1] = gtk_tree_view_column_new_with_attributes ( test1, 
renderer, text, 0, NULL );

gtk_tree_view_append_column ( target, test_col[0] );
gtk_tree_view_append_column ( target, test_col[1] );

GType string_type = G_TYPE_STRING;
GtkTreeIter current;
GType *types = g_malloc (sizeof (GType) * 2);
types [0] = G_TYPE_STRING;
types [1] = G_TYPE_STRING;
GtkListStore *list = gtk_list_store_newv (2, types);
gtk_list_store_append ( list, current );
gtk_list_store_set ( list, current, 0, test00, -1 );
gtk_list_store_set ( list, current, 1, test01, -1 );
gtk_list_store_append ( list, current );
gtk_list_store_set ( list, current, 0, test10, -1 );
gtk_list_store_set ( list, current, 1, test11, -1 );

gtk_tree_view_set_model ( GTK_TREE_VIEW ( target ) , GTK_TREE_MODEL 
( list )) ;


I made the GUI in Glade.

gtk_list_store_set ( list, current, 0, test00, -1 ); was previously 
gtk_list_store_set ( list, current, 0, test00, 1, test01, -1 ); and 
gtk_list_store_set ( list, current, 1, test01, -1 ); didn't exist.

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


Get column no. of edited cell.

2013-06-01 Thread dE
I've set the editable property of GtkCellRenderer to true, and set the 
call back for the edited signal.


This particular signal tells the node/row in which the edit has 
occurred, but not the column/filed. How can I get that?


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


No Pascal in the Gtk bindings list?

2011-08-10 Thread Felipe Monteiro de Carvalho
Hello,

Please add Pascal in the Gtk bindings page:
http://www.gtk.org/language-bindings.php

FPC supports all versions listed there except version 3.0 (which is under work)

You can add a link to this page:
http://wiki.lazarus.freepascal.org/GTK2_Interface

thanks,
-- 
Felipe Monteiro de Carvalho
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Cairo: how do I use $cr-append_path to draw a path?

2011-07-15 Thread Mart van de Wege
Hi,

I'm playing with Cairo to generate hexmaps for role-playing games, and
using the $cr-move_to and $cr-line_to methods, this works fine.

However, according to the documentation, I should also be able to build
a Cairo::Path object and use $cr-append_path to do the same thing. Yet,
when I try, it doesn't work. See the below code for an example:

#!/usr/bin/perl

use strict;
use warnings;
use Cairo;
use Data::Dump qw/dump/;

my $surface = Cairo::PdfSurface-create('out.pdf',200,200);
my $cr = Cairo::Context-create($surface);
$cr-set_source_rgb(0,0,0);

# The following does not work:
my $path = [
{ type = move-to, points = [[10,10]] },
{ type = line-to, points = [[10,190]] },
{ type = line-to, points = [[190,190]] },
{ type = line-to, points = [[190,10]] },
{ type = close-path, points = [] } ,
   ];
$cr-append_path($path);

# This however does:
#$cr-move_to(10,10);
#$cr-line_to(10,190);
#$cr-line_to(190,190);
#$cr-line_to(190,10);
#$cr-close_path;
#my $path = $cr-copy_path;
#dump $path;
$cr-stroke;
$cr-show_page;
$surface-flush;
$surface-finish;

Am I doing something wrong, or am I reading the documentations
incorrectly?

Regards,

Mart

___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Re: Cairo: how do I use $cr-append_path to draw a path?

2011-07-15 Thread Mart van de Wege
(Grmbl. Torsten, can you disregard the reply address on the private
reply, as I used the wrong account to send it from? You *can* use the
above address).

On Fri, 2011-07-15 at 14:02 +, Torsten Schoenfeld wrote:
 On 15.07.2011 06:47, Mart van de Wege wrote:
  However, according to the documentation, I should also be able to build
  a Cairo::Path object and use $cr-append_path to do the same thing. Yet,
  when I try, it doesn't work.
 
 Judging from the code, this conversion direction is not implemented yet, 
 and the documentation neglects to mention it.  (Irregardless of the path 
 you input, a NULL is passed to libcairo.) 

Aha.

That explains why the output of dump($path) in the alternate codepath
shows a data structure with more members than the array given in the
documenation.

Not often that the documentation outstrips the code. Usually it's the
other way around.

  I think I have code for this 
 in a local branch at home.  I'll try to polish it and post here soon.

Thanks.

Don't hurry it up though. I can refactor my code easily enough, so
anytime is fine.

Regards,

Mart



___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


Blocking GUI

2011-06-26 Thread Salvatore De Paolis
Hi,
I'm testing something with Perl and GTK+ and I'd like an advice about how
to achieve this kind of task:

Let's take this code as example:

$button-set_image($waiting);
sleep 10;
$button-set_image(undef);

This way the button is stuck till the sleep function is completed.

regards,
Sal
___
gtk-perl-list mailing list
gtk-perl-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-perl-list


gtkLabel resize itself and resize the whole window

2011-05-31 Thread Maxime de Roucy
Hello

I have a Window containing
(gtk_container_add(window, box);) a GtkBox (which is a GtkVBox in
reality) ; this GtkBox containing a GtkHBox which contain a GtkLabel.

With Gtk2 : the text get cut off by the edge of the widget if it
exceeds the widget size.

But with Gtk3 the window extend itself when the text is too long.

How can I avoid this behaviour ?

I tried the set the window, the VBox and the HBox hexpand-set and
vexpand-set properties to FALSE.
But it doesn't change anything.

I tried to set the Label gtk_label_set_max_width_chars  but it increase
the heigh of the Label ...

I am not used at Gtk+ programming so I search in the doc ... but until
now I didn't found anything useful.

Could you help me please.

Thanks in advance.
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: gtkLabel resize itself and resize the whole window

2011-05-31 Thread Maxime de Roucy
Thanks for your answer.

What I want exactly is :
When the text in the GtkLabel is too long (it exceeds the widget size),
I want the text to get cut off by the edge of the widget. Instead of
increasing automatically the size of the Widget (and so the whole
window).

Le Tue, 31 May 2011 14:46:20 +0200,
Emmanuel Thomas-Maurin manutm...@gmail.com a écrit :

 On 05/31/2011 12:32 PM, Maxime de Roucy wrote:
  Hello
  
  I have a Window containing
  (gtk_container_add(window, box);) a GtkBox (which is a GtkVBox in
  reality) ; this GtkBox containing a GtkHBox which contain a
  GtkLabel.
  
  With Gtk2 : the text get cut off by the edge of the widget if it
  exceeds the widget size.
  
  But with Gtk3 the window extend itself when the text is too long.
  
  How can I avoid this behaviour ?
  
  I tried the set the window, the VBox and the HBox hexpand-set and
  vexpand-set properties to FALSE.
  But it doesn't change anything.
  
  I tried to set the Label gtk_label_set_max_width_chars  but it
  increase the heigh of the Label ...
 
 You may check out gtk_widget_set_size_request(). BTW, it's not clear
 what you want to do exactly.
 

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

Re: gtkLabel resize itself and resize the whole window

2011-05-31 Thread Maxime de Roucy
Problem solved

Solution : use gtk_label_set_ellipsize

Thanks a lot :-D

I didn't know that I have to set the ellipsize mode to tell the Label
to cut the text when there is not enough space.

I thought that :
gtk_label_set_line_wrap(myLabel, FALSE);
would have been sufficient since the doc say :

gtk_label_set_line_wrap :
Toggles line wrapping within the GtkLabel widget. TRUE makes it break
lines if text exceeds the widget's size. FALSE lets the text get cut
off by the edge of the widget if it exceeds the widget size.

Thanks again

Le Tue, 31 May 2011 15:32:12 +0200,
Vivien Malerba vmale...@gmail.com a écrit :

 gtk_label_set_ellipsize()?
 
 Vivien
 
 2011/5/31 Maxime de Roucy maxime.dero...@gmail.com:
  Thanks for your answer.
 
  What I want exactly is :
  When the text in the GtkLabel is too long (it exceeds the widget
  size), I want the text to get cut off by the edge of the widget.
  Instead of increasing automatically the size of the Widget (and so
  the whole window).
 
  Le Tue, 31 May 2011 14:46:20 +0200,
  Emmanuel Thomas-Maurin manutm...@gmail.com a écrit :
 
  On 05/31/2011 12:32 PM, Maxime de Roucy wrote:
   Hello
  
   I have a Window containing
   (gtk_container_add(window, box);) a GtkBox (which is a GtkVBox in
   reality) ; this GtkBox containing a GtkHBox which contain a
   GtkLabel.
  
   With Gtk2 : the text get cut off by the edge of the widget if it
   exceeds the widget size.
  
   But with Gtk3 the window extend itself when the text is too long.
  
   How can I avoid this behaviour ?
  
   I tried the set the window, the VBox and the HBox hexpand-set and
   vexpand-set properties to FALSE.
   But it doesn't change anything.
  
   I tried to set the Label gtk_label_set_max_width_chars  but it
   increase the heigh of the Label ...
 
  You may check out gtk_widget_set_size_request(). BTW, it's not
  clear what you want to do exactly.
 
 
 
  ___
  gtk-app-devel-list mailing list
  gtk-app-devel-list@gnome.org
  http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
 

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

Please don't drop support for Curve

2011-05-04 Thread Charlie De
Hello all,


I've joined up with this list for one single reason: to ask the developers to 
re-consider and reverse their decision to deprecate and eventually remove the 
Curve widget from GTK+.

Recently, I learnt to create Python scripts, and with the help of Glade, 
created 
a GUI to ImageMagick routines, for my own proprietary photo editor. The Curve 
widget was absolutely central to this endeavour. The only downside is that it 
is 
basic and not very well developed.

To me, the reasons given for this widget being deprecated, that it isn't very 
useful and only appeals to a minority of users, sounds disingenuous and hurtful 
to the easy usefulness of GTK+. What do you expect users to do in its absence? 
Do you really expect users to go breaking their knuckles to try and create a 
curve dialog with a drawing area? How could you see such progress as anything 
but a step backwards?

So please, hear a busy user who has taken the trouble of registering here to 
offer feedback: do not drop this essensial component of GTK+, and instead of 
deprecating it, continue its development. You can drop Gamma Curve if you like, 
which is too idiosyncratic to be of much use. What is needed instead is the 
Curve offering point data - the points on the curve that the user creates - 
being able to be read and manipulated by other widgets, such as the numerical 
scroll boxes. (Rather like the Curves dialog in Photoshop.) And I'm sure there 
are other improvements that could be made.

If on the other hand you insist on dropping the Curve, then when the time comes 
I guess I'll have to switch to another widget toolset, whichever will still be 
offering a Curve interface element. I can't even begin to image how long it 
would take me to create the widget manually - it frankly strikes me as an 
insane 
and pointless effort.

Thank you for your attention and best wishes with your continuing good work. 
What you have created in GTK+ (and pyGTK) is greatly appreciated and 
wonderfully 
useful.

All the best,

Charlie
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Cannot build latest gnome-shell from git (using jhbuld)

2011-03-03 Thread Michele De Pascalis

I actually get this build error:

make[5]: Entering directory 
`/home/glaedr/gnome-shell/source/gnome-control-center/panels/user-accounts'

CC um-account-type.lo
CC um-user.lo
CC um-user-manager.lo
CC um-account-dialog.lo
CC um-language-dialog.lo
CC um-password-dialog.lo
CC um-photo-dialog.lo
um-photo-dialog.c:33:35: error: cheese-avatar-chooser.h: No such file or 
directory
um-photo-dialog.c:34:42: error: cheese-camera-device-monitor.h: No such 
file or directory
um-photo-dialog.c:50: error: expected specifier-qualifier-list before 
‘CheeseCameraDeviceMonitor’

um-photo-dialog.c: In function ‘crop_dialog_response’:
um-photo-dialog.c:76: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c: In function ‘um_photo_dialog_select_file’:
um-photo-dialog.c:230: error: ‘UmPhotoDialog’ has no member named 
‘thumb_factory’

um-photo-dialog.c: In function ‘none_icon_selected’:
um-photo-dialog.c:248: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c: In function ‘webcam_response_cb’:
um-photo-dialog.c:277: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c: In function ‘webcam_icon_selected’:
um-photo-dialog.c:293: warning: implicit declaration of function 
‘cheese_avatar_chooser_new’
um-photo-dialog.c:293: warning: nested extern declaration of 
‘cheese_avatar_chooser_new’
um-photo-dialog.c:293: warning: assignment makes pointer from integer 
without a cast

um-photo-dialog.c: In function ‘update_photo_menu_status’:
um-photo-dialog.c:305: error: ‘UmPhotoDialog’ has no member named 
‘num_cameras’
um-photo-dialog.c:306: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’
um-photo-dialog.c:308: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’

um-photo-dialog.c: At top level:
um-photo-dialog.c:312: error: expected ‘)’ before ‘*’ token
um-photo-dialog.c:324: error: expected ‘)’ before ‘*’ token
um-photo-dialog.c: In function ‘stock_icon_selected’:
um-photo-dialog.c:341: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c: In function ‘setup_photo_popup’:
um-photo-dialog.c:447: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’
um-photo-dialog.c:448: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’
um-photo-dialog.c:450: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’
um-photo-dialog.c:452: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’
um-photo-dialog.c:453: error: ‘UmPhotoDialog’ has no member named 
‘take_photo_menuitem’

um-photo-dialog.c:455: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c:455: warning: implicit declaration of function 
‘cheese_camera_device_monitor_new’
um-photo-dialog.c:455: warning: nested extern declaration of 
‘cheese_camera_device_monitor_new’

um-photo-dialog.c:456: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c:456: error: ‘device_added’ undeclared (first use in 
this function)
um-photo-dialog.c:456: error: (Each undeclared identifier is reported 
only once

um-photo-dialog.c:456: error: for each function it appears in.)
um-photo-dialog.c:458: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c:458: error: ‘device_removed’ undeclared (first use in 
this function)
um-photo-dialog.c:460: warning: implicit declaration of function 
‘cheese_camera_device_monitor_coldplug’
um-photo-dialog.c:460: warning: nested extern declaration of 
‘cheese_camera_device_monitor_coldplug’

um-photo-dialog.c:460: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c: In function ‘um_photo_dialog_new’:
um-photo-dialog.c:547: error: ‘UmPhotoDialog’ has no member named 
‘thumb_factory’

um-photo-dialog.c: In function ‘um_photo_dialog_free’:
um-photo-dialog.c:572: error: ‘UmPhotoDialog’ has no member named 
‘thumb_factory’
um-photo-dialog.c:573: error: ‘UmPhotoDialog’ has no member named 
‘thumb_factory’

um-photo-dialog.c:575: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c:576: error: ‘UmPhotoDialog’ has no member named ‘monitor’
um-photo-dialog.c:578: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:579: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c: In function ‘um_photo_dialog_set_user’:
um-photo-dialog.c:652: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:653: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:654: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:656: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:658: error: ‘UmPhotoDialog’ has no member named ‘user’
um-photo-dialog.c:659: error: ‘UmPhotoDialog’ has no member named ‘user’
make[5]: *** [um-photo-dialog.lo] Error 1
make[5]: Leaving directory 
`/home/glaedr/gnome-shell/source/gnome-control-center/panels/user-accounts'

make[4]: *** [all-recursive] Error 1
make[4]: Leaving directory 
`/home/glaedr/gnome-shell/source/gnome-control-center/panels/user-accounts'


Gtk 3.0 themes path

2011-02-24 Thread Michele De Pascalis
Where are the gtk3 themes (css files) located in the filesystem? And how 
do I set one of them to be used?

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Getting started writing a Gtk2 theme engine

2011-02-14 Thread Michele De Pascalis

On 14/02/2011 15:46, Emmanuele Bassi wrote:

On Mon, 2011-02-14 at 15:26 +0100, Michele De Pascalis wrote:

On 13/02/2011 20:09, Emmanuele Bassi wrote:

On Sun, 2011-02-13 at 15:39 +0100, Michele De Pascalis wrote:

Is there a guide/tutorial/reference that explains how to write a Gtk
theme engine?

considering that the theme engine API changed pretty much drastically in
gtk3, are you really sure that you want to learn how to write a theme
engine for gtk2?

in any case, you should probably look at the Clearlooks theme engine,
and modify it instead of starting from scratch.

I'd rather to build it from scratch, because of the way I work.

again, I'd suggest smaller steps to understand an API that is not fully
documented.


  I guess
that Clearlooks is written in C, and I'd like to use an OOP language,
like C++, to build the engine, even if the API is procedural.

you cannot really write a theme engine in c++: a theme engine is a gtk+
module, and has to provide a fairly specific implementation of a C API
through GObject virtual functions and types.


However, how has the API changed whith gtk3?

quite radically. now you get passed a style context with meta-data about
the location and semantics of the UI element to draw, plus the Cairo
context to draw on.


  And when will gtk3 be released (for testing)?

gtk+ 3.0 has been released on February 10.

ciao,
  Emmanuele.


Right, going to check Clearlooks and gtk 3.0. Thanks
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Getting started writing a Gtk2 theme engine

2011-02-13 Thread Michele De Pascalis
Is there a guide/tutorial/reference that explains how to write a Gtk 
theme engine?

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Problem with multiple selection in TreeView

2010-08-22 Thread Salvatore De Paolis
Hi,

I'm using GTK+ 2.20.1 and I notice a wrong behavior on the multiple selection.
I've connected a callback to the signal cursor-changed and within of if I
get the selection in this way:

sel = gtk_tree_view_get_selection(list_view);
model = gtk_tree_view_get_model(list_view);
rows = gtk_tree_selection_get_selected_rows(sel, model);

list_view is a GtkListStore data structure.
So when I selected with keyboard I can see here a multiple selection but
when using the mouse and holding shift it never happens and just give
a one-row selection.

I also noticed that when I click two times it works as expected, 
like click to select the first row, press shift, click to select the fourth 
row, click again on the fourth row.

It has the shape of the bug to me but I hope I'm missing something :)

Regards,

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

Re: Why is GCompletion deprecated

2010-06-28 Thread Salvatore De Paolis
On Mon, 28 Jun 2010 14:49:48 +0100
Emmanuele Bassi eba...@gmail.com wrote:

 the fact that nobody implemented them using GCompletion should give a
 hint that: a) this is not a shared opinion and b) it probably wasn't
 possible with GCompletion.

That's not quite true, several applications use GCompletion, just to 
mention some, Bluefish, Anjuta, Claws Mail.
The issue isn't really about deprecating some code but instead not
providing the alternative (look at QT for an idea, they always provided
a compat library when it was necessary)
This will be again the same picture as it has been with GTKCTree stuff:
force application developers to waste time on changing something that
actually just works and give room for new bugs while implementing the
same functionality in a different way.

I think it's a good practice to always provide compatibility and i'd like
if GTK+ would do that too.

regards,

-- 
Salvatore
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Widget for drawing plot

2010-03-17 Thread Salvatore De Paolis
Hi,
I was searching a good way to draw plots in Gtk+.
Surfing a little bit a found Gtkdatabox and GtkPlot.

Which is worth to use or there's anything else?

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


Weird behaviour of gdk_device_get_history

2010-03-11 Thread Rafael Cunha de Almeida
I'm using gdk_device_get_history and I have been hitting some weird
behavior.  Sometimes get_history returns coords at 0, 0, but the mouse
(the device I'm using) never goes there. I notice that if I add 1 to the
start time and subtract 1 from the end value, things seem to work. I'm a
bit puzzled. When is this behavior supposed to happen? devhelp doesn't
seem to say anything about it.

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


Re: Testing for memory leaks in GTK

2010-01-07 Thread Erik de Castro Lopo
Simon McVittie wrote:

 Debian's GLib packages compile GLib twice; the normal copy with
 the recommended hidden-visibility settings ends up in /usr/lib in the normal
 libglib2.0-0 binary package (which other packages depend on), but the package
 also builds extra copy that is refdbg'able, and installs it in
 /usr/lib/refdbg, in an additional libglib2.0-0-refdbg binary package

Yep, found and installed it. I now have:

$ ls -l /usr/lib/refdbg/
total 2412
drwxr-xr-x   2 root root   4096 Jan  6 09:28 .
drwxr-xr-x 331 root root 139264 Jan  6 20:33 ..
-rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so
-rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so.0
-rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so.0.2200.3

but I'm still not able to configure refdbg. I'm doing this:

export LD_LIBRARY_PATH=/usr/lib/refdbg:$LD_LIBRARY_PATH
./configure --prefix=$HOME/Local

and I still get his:

***
* WARNING: glib = 2.6 found.  refdbg will not work   *
* WARNING: unless you use it with glib compiled with  *
* WARNING: '--disable-visibility' or a version = 2.4.x.  *
* WARNING: See README for details.*
***

What am I doing wrong?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Testing for memory leaks in GTK

2010-01-07 Thread Erik de Castro Lopo
Paul Davis wrote:

 On Thu, Jan 7, 2010 at 4:10 PM, Erik de Castro Lopo
 mle+...@mega-nerd.com wrote:
  Simon McVittie wrote:
 
  Debian's GLib packages compile GLib twice; the normal copy with
  the recommended hidden-visibility settings ends up in /usr/lib in the 
  normal
  libglib2.0-0 binary package (which other packages depend on), but the 
  package
  also builds extra copy that is refdbg'able, and installs it in
  /usr/lib/refdbg, in an additional libglib2.0-0-refdbg binary package
 
  Yep, found and installed it. I now have:
 
     $ ls -l /usr/lib/refdbg/
     -rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so
     -rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so.0
     -rw-r--r--   1 root root 767414 Dec  4 00:54 libgobject-2.0.so.0.2200.3
 
  but I'm still not able to configure refdbg. I'm doing this:
 
     export LD_LIBRARY_PATH=/usr/lib/refdbg:$LD_LIBRARY_PATH
     ./configure --prefix=$HOME/Local
 
 you may well need to set PKG_CONFIG_PATH too. the autocrap files will
 be looking for glib-2.0.pc or something like that, and there's a good
 chance that they are finding the wrong one.

Is thats righ? I'm not sure. The library:

 /usr/lib/refdbg/libgobject-2.0.so.0.2200.3

should be a drop in replacement for /usr/lib/libgobject-2.0.so.0.2200.3
and pkg-config should be finding the pkg-config file for that ok while
the LD_LIBRARY_PATH setting should be replacing the /usr/lib/ version
with the /usr/lib/refdbg version.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Testing for memory leaks in GTK

2010-01-06 Thread Erik de Castro Lopo
Tomeu Vizoso wrote:

 RefDbg is useful in these cases.

I've had a look at RefDbg. On configure I get:

  ***
  * WARNING: glib = 2.6 found.  refdbg will not work   *
  * WARNING: unless you use it with glib compiled with  *
  * WARNING: '--disable-visibility' or a version = 2.4.x.  *
  * WARNING: See README for details.*
  ***

Does that mean I have to recompile glib in order to use this tool?

If so, this is not something people who develop *with* GTK are 
going to able to use.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Testing for memory leaks in GTK

2010-01-06 Thread Erik de Castro Lopo
Tomeu Vizoso wrote:

 While I agree that would be good to have something with a lower
 barrier,

Indeed.

Currently, to debug memory leaks in code that uses GTK+ we have the
widely known and used tool Valgrind which throws up many thousands of
false positives or a GTK+ specific tool like RefDbg, which needs to be 
compiled from source and which also requires you to build the whole
of the GTK+ stack from source.

Sorry, but this situation is somewhat sub-optimal.

 I think that building gtk+ and its dependencies in a
 dedicated prefix dir is a learning experience that will be of use to
 all users of gtk+.

What is it you expect people to learn from this experience? I've been
using Linux since 1995 and back then I compiled just about everything
from source, from binutils and gcc up. I really don't feel any nostalgia
for those days.

I currently do most of my development work on an older laptop which
is both CPU and memory constrained. Building everything on that 
system would be a royal PITA in terms of build speed and would also
require me to reclaim disk space currently used by other stuff.
Fortunately, that system is about to be replaced with something pretty
close to cutting edge where this won't be an issue.

 Jhbuild may help there.

Yes, Jhbuild looks useful.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Testing for memory leaks in GTK

2010-01-05 Thread Erik de Castro Lopo
Hi all,

I have written a small test program that can create independent toplevel
windows based on a command line parameter. Currently these top level
windows contain nothing more than a GtkLabel widget and destroy
themselves using a g_timeout after 30 seconds. When all the toplevel
windows have been destroyed the program calls gtk_main_quit() and then
terminates.

When this program is run under valgrind with an increasing number of top
level windows I notice that number of blocks 'still reachable' when
the program terminates increases with the number of top level windows
created:

 Created  Still reachable
 --
 1397,039 bytes in 7,739 blocks
 2401,271 bytes in 7,786 blocks
 3405,111 bytes in 7,826 blocks
 4408,271 bytes in 7,847 blocks
 5412,399 bytes in 7,899 blocks

Assuming that the bug isn't in my program, doesn't this look like a
genuine leak that should be fixed?

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Testing for memory leaks in GTK

2010-01-05 Thread Erik de Castro Lopo
Sven Herzberg wrote:

 Can you please post this program, so people can proofread/reproduce what
 you post?

I now have two separate small programs which display this behaviour.

The code can be retrieved use the Bzr revision control tool using:

 bzr get http://www.mega-nerd.com/Bzr/gtk-leak-tests

The code is not visiable at that URL if you go there with a browser,
you need to retrieve it using bzr.

The two programs are:

00_multiple_toplevel/multiple_toplevel.c
01_multi_toplevel_w_button/multi_toplevel_w_button.c

There is a single topleve Makefile that builds both programs.

The programs can be run using:

 $program_name count

where count is the number of top level windows to create.

There is also a script in the top directory called leak-check.sh which
can run a target test program from one to N times and generated a 
separate (slightly cleaned up) valgrind report log for each N. This
script can be run like eg:

   ./leak-check.sh 0  00_multiple_toplevel/multiple_toplevel

and produce file files vg1-multiple_toplevel.txt, vg2-multiple_toplevel.txt
and so on.

I'd appreciate it if someone could have a look at what I have so far.

Cheers,
Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Testing for memory leaks in GTK

2010-01-05 Thread Erik de Castro Lopo
Tomeu Vizoso wrote:

 RefDbg is useful in these cases.

Where can I get some more info on that?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Valgrind and GTK libraries

2010-01-04 Thread Erik de Castro Lopo
Bill C wrote:

 Valgrind is an excellent product, and is designed for programmer use only.
 
 It shows where unreleased memory was allocated, so one can trace each 
 chunk of memory to see if it should have been released, and take 
 appropriate action it your code allocated it.

That is easy when when it obviously in client code. My particular issue
is that I am absolutely sure the code I am working on (I didn't write it
btw) is leaking GTK resources. Given this code leaks 2 blocks and the 
GTK helloworld (far, far simpler) leaks 8000, how do I know which of
the 2 leaks I can fix.

From this:

http://www.mega-nerd.com/erikd/Blog/files/sweep-valgrind.txt.gz

lets look at one specific leak record:

  ==12528== 27,300 bytes in 175 blocks are still reachable in loss record 
11,194 of 11,196
  ==12528==at 0x4024C1C: malloc (vg_replace_malloc.c:195)
  ==12528==by 0x4B342E3: g_malloc (gmem.c:131)
  ==12528==by 0x4B4A418: g_slice_alloc (gslice.c:824)
  ==12528==by 0x4B4A714: g_slice_alloc0 (gslice.c:833)
  ==12528==by 0x474F8F6: g_type_create_instance (gtype.c:1654)
  ==12528==by 0x4734747: g_object_constructor (gobject.c:1383)
  ==12528==by 0x4735707: g_object_newv (gobject.c:1171)
  ==12528==by 0x4736589: g_object_new_valist (gobject.c:1323)
  ==12528==by 0x473670D: g_object_new (gobject.c:1086)
  ==12528==by 0x4195924: ??? (in /usr/lib/libgtk-x11-2.0.so.0.1800.3)
  ==12528==by 0x4197833: ??? (in /usr/lib/libgtk-x11-2.0.so.0.1800.3)
  ==12528==by 0x4196787: gtk_menu_item_set_label (in 
/usr/lib/libgtk-x11-2.0.so.0.1800.3)
  ==12528==by 0x4735CE3: g_object_newv (gobject.c:968)
  ==12528==by 0x47365F0: g_object_new_valist (gobject.c:1364)
  ==12528==by 0x473670D: g_object_new (gobject.c:1086)
  ==12528==by 0x4197347: gtk_menu_item_new_with_label (in 
/usr/lib/libgtk-x11-2.0.so.0.1800.3)
  ==12528==by 0x808E8AA: create_proc_menu (view.c:175)
  ==12528==by 0x8096E2B: view_new (view.c:1167)
  ==12528==by 0x8097638: view_new_all (view.c:2562)
  ==12528==by 0x806713F: _sndfile_sample_load (file_sndfile1.c:712)
  ==12528==by 0x8064BAF: try_sample_load (file_dialogs.c:225)
  ==12528==by 0x8057FD2: initial_sample_load (main.c:73)
  ==12528==by 0x4B2A100: g_idle_dispatch (gmain.c:4065)
  ==12528==by 0x4B2BE87: g_main_context_dispatch (gmain.c:1960)
  ==12528==by 0x4B2F72F: g_main_context_iterate (gmain.c:2591)
  ==12528==by 0x4B2FB9E: g_main_loop_run (gmain.c:2799)
  ==12528==by 0x4185418: gtk_main (in /usr/lib/libgtk-x11-2.0.so.0.1800.3)
  ==12528==by 0x8057CAE: main (main.c:214)

The code uses gtk_menu_item_new_with_label() to create a submenu which gets
added to a menu which get attached to a top level window (one top level
window per open file). I would expect that the submenu gets cleaned up when
the top level window gets destroyed. Is that not the case?

 Humans can make mistakes,

Yep, humans are completely hopeless :-).

 but GTK is well tested.

I agree. The fact that GTK shows *zero* of the use-of/condition-jump on
uninitialied memory errors shows that the GTK devs have spent a lot of
time tracking down and killing all instances of that class of bugs.

 In my case, suspected errors in linux library code have always been 
 errors in my own code which surface as Gnu libraries are improved.

I am a library author myself and my goal in library design has always
been to make the library difficult to mis-use. Above all I did this
to reduce the amount of work I would have to do supporting my libraries.

Admittedly my libraries are far smaller than GTK and have far simpler
goals. However, I think all library designers should have Rusty Russel's
guide on API design titled How Do I Make This Hard to Misuse? :

http://ozlabs.org/ ̃rusty/index.cgi/tech/2008-03-30.html

on hand whenever they are doing any API design work.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Valgrind and GTK libraries

2010-01-04 Thread Erik de Castro Lopo
Dan Kegel wrote:

 Erik de Castro Lopo mle+...@mega-nerd.com wrote:
   ==12528== 27,300 bytes in 175 blocks are still reachable in loss record 
  11,194 of 11,196
   ==12528==    at 0x4024C1C: malloc (vg_replace_malloc.c:195)
   ==12528==    by 0x4B342E3: g_malloc (gmem.c:131)
   ==12528==    by 0x4B4A418: g_slice_alloc (gslice.c:824)
   ==12528==    by 0x4B4A714: g_slice_alloc0 (gslice.c:833)
   ==12528==    by 0x474F8F6: g_type_create_instance (gtype.c:1654)
   ==12528==    by 0x4734747: g_object_constructor (gobject.c:1383)
   ==12528==    by 0x4735707: g_object_newv (gobject.c:1171)
   ==12528==    by 0x4736589: g_object_new_valist (gobject.c:1323)
   ==12528==    by 0x473670D: g_object_new (gobject.c:1086)
 
 Say no more!  We see that tons in chromium's valgrind runs, too.

Well I consider this a *real* leak that needs to be fixed.

The code I'm working on has multiple top level windows and the code
path in the stack trace gets called for each window; thats 27300
bytes in 175 blocks for every window.

In the normal usage of this app, its usual to have more than one
window open at any time and to open and close more windows on-the-fly.

Under these conditions, my app leaks memory due GTK+ and it seems
there is nothing I can do in my code to prevent it.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Re: Valgrind and GTK

2010-01-03 Thread Erik de Castro Lopo
Tor Lillqvist wrote:

 I think much of this boils down to the definition of leak. My
 impression is that GTK+ and GLib developers don't consider as leaks
 once-only allocations that either indeed truly are unreachable almost
 right away after being used (as long as they are small) (but of
 course, if possible one should avoid these, too), or only unreachable
 when the program is exiting. I tend to agree.

That argument has merit, but its one that I cannot fully agree with.

Regardless of the merits of that argument, my main problem is that it
is so difficult to find real leaks amongst the thousands of false
positives.

I also have my doubts about the usage of valgrind suppression files.
I have a suspicion (as yet unproven) that it would be possible to write
a program which really does leak memory but which is reported as leak
free by valgrind with the standard gtk suppressions file.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Valgrind and GTK

2010-01-03 Thread Erik de Castro Lopo
Sven Neumann wrote:

 I agree that it would help a lot if we could in one way or another get
 rid of false positives. But my experience shows that you get pretty much
 the same valgrind warnings no matter how large your GTK+ application is.
 Your 100 line demo program will produce the same set of warnings as your
 3 lines application (provided that your code doesn't have leaks).

For a program that isn't leaking that would probably be correct.

However, for helloworld I get:

  ==22566== LEAK SUMMARY:
  ==22566==definitely lost: 1,449 bytes in 8 blocks
  ==22566==indirectly lost: 3,716 bytes in 189 blocks
  ==22566==  possibly lost: 4,428 bytes in 107 blocks
  ==22566==still reachable: 380,505 bytes in 7,898 blocks
  ==22566== suppressed: 35,873 bytes in 182 blocks

and for my  program (which I'm pretty sure does leak):

  ==12528== LEAK SUMMARY:
  ==12528==definitely lost: 12,997 bytes in 366 blocks
  ==12528==indirectly lost: 12,539 bytes in 470 blocks
  ==12528==  possibly lost: 157,240 bytes in 5,219 blocks
  ==12528==still reachable: 920,186 bytes in 18,753 blocks
  ==12528== suppressed: 40,629 bytes in 284 blocks

Looking at the valgrind log:

   http://www.mega-nerd.com/erikd/Blog/files/sweep-valgrind.txt.gz

for me at least, its impossible to tell which ones I should be looking
at or how to fix them.

 But still it would make everyone's life easier if one wouldn't have to
 differentiate between false and real positives manually. Perhaps
 valgrind suppression files maintained and shipped with the libraries
 would indeed be a good idea.

Is there an up to date suppressions file I should try?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Valgrind and GTK

2010-01-02 Thread Erik de Castro Lopo
jcup...@gmail.com wrote:

 Then run with:
 
 $ export G_SLICE=always-malloc
 $ export G_DEBUG=gc-friendly
 $ valgrind --leak-check=yes nip2  valgrind.log 21
 
 And I get no reported leaks (well, one report from selinux and one
 from a getpwd call somewhere)

With your suppressions file on the helloworld program from the GTK
tutorial and valgrind on Ubuntu 9.10 run as:

  $ export G_SLICE=always-malloc
  $ export G_DEBUG=gc-friendly
  $ valgrind --tool=memcheck --leak-check=full --leak-resolution=high \
--num-callers=50 --show-reachable=yes \
--suppressions=gtk.suppression2 \
helloworld  helloworld-vg.txt 21

I get:

  ==29293== LEAK SUMMARY:
  ==29293==definitely lost: 1,449 bytes in 8 blocks
  ==29293==indirectly lost: 3,716 bytes in 189 blocks
  ==29293==  possibly lost: 2,134 bytes in 41 blocks
  ==29293==still reachable: 333,811 bytes in 6,837 blocks
  ==29293== suppressed: 86,317 bytes in 1,323 blocks

Full output here:

http://www.mega-nerd.com/tmp/helloworld-vg.txt.gz

  for my 300,000 line GTK application.

Is that public? In revision control somewhere?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Valgrind and GTK

2010-01-02 Thread Erik de Castro Lopo
jcup...@gmail.com wrote:

 Sorry, I posted hastily, I do get an annoying number of leaks if I let
 it run a little longer, I see what you mean. I'm sure it wasn't as bad
 back in 9.04.

I've just tried the helloworld program on Ubuntu 9.04 and the results:

  ==23067== LEAK SUMMARY:
  ==23067==definitely lost: 1,551 bytes in 14 blocks.
  ==23067==indirectly lost: 3,716 bytes in 189 blocks.
  ==23067==  possibly lost: 0 bytes in 0 blocks.
  ==23067==still reachable: 932,950 bytes in 5,960 blocks.
  ==23067== suppressed: 94,594 bytes in 1,897 blocks.

are not too different from the results from 9.10:

  ==22566== LEAK SUMMARY:
  ==22566==definitely lost: 1,449 bytes in 8 blocks
  ==22566==indirectly lost: 3,716 bytes in 189 blocks
  ==22566==  possibly lost: 4,428 bytes in 107 blocks
  ==22566==still reachable: 380,505 bytes in 7,898 blocks
  ==22566== suppressed: 35,873 bytes in 182 blocks

 I'll try to make a better suppression file tomorrow.

Don't you think that maybe a suppression file is not the right approach
to this problem?

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Re: Valgrind and GTK

2010-01-02 Thread Erik de Castro Lopo
Erik de Castro Lopo wrote:

 Don't you think that maybe a suppression file is not the right approach
 to this problem?

Specifically, I am concerned about the possibility of a suppressions file
that hides a real memory leak where a program bug continually allocates
resources that are not released *and* are suppressed by the supressions
file.

Erik

PS: I am the author of two well known libraries that have zero valgrind
warnings and errors (not even memory leaks) without the use of a
suppressions file.
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Valgrind and GTK

2010-01-01 Thread Erik de Castro Lopo
Hi all,

I'm having trouble differentiating between memory leaks in my code and
apparent leaks in GTK when using valgrind.

Even the minimal hello world program from the GTK tutorial:

   http://library.gnome.org/devel/gtk-tutorial/stable/c39.html#SEC-HELLOWORLD

when run as follows (suppression file from http://live.gnome.org/Valgrind):

  export G_SLICE=always-malloc
  export G_DEBUG=gc-friendly
  valgrind --tool=memcheck --leak-check=full --leak-resolution=high \
--num-callers=50 --show-reachable=yes --suppressions=gtk.suppression \
helloworld  helloworld-vg.txt 21

on Ubuntu 9.10 reports this:

  ==22566== LEAK SUMMARY:
  ==22566==definitely lost: 1,449 bytes in 8 blocks
  ==22566==indirectly lost: 3,716 bytes in 189 blocks
  ==22566==  possibly lost: 4,428 bytes in 107 blocks
  ==22566==still reachable: 380,505 bytes in 7,898 blocks
  ==22566== suppressed: 35,873 bytes in 182 blocks

If the leak summary of a 100 line demo program shows over 8000 definitely
lost, indirectly lost, possibly lost and and still reachable blocks, how
am I supposed to find the blocks of memory leaking from my code which is
3 lines?

I would also like to note that this is a problem faced by other libraries
like GNU libc which solved the problem by adding a function __libc_freeres
to free all its program lifetime allocated memory.

I am aware of this bug:

https://bugzilla.gnome.org/show_bug.cgi?id=64096

and some of the discussion around it:

http://mail.gnome.org/archives/gtk-devel-list/2001-November/msg00279.html
http://mail.gnome.org/archives/gtk-devel-list/2001-November/msg00541.html

but I'm wondering if attitudes might have changed in the almost 10 years
since that bug and thread.

Erik
-- 
--
Erik de Castro Lopo
http://www.mega-nerd.com/
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


Problem Compiling Gtk+-2.18.1

2009-12-13 Thread Carlos Alberto de Oliveira Alves
Hi guys,

I'm trying to compiling gtk+-2.28.1 so I'll can to compile firefox-3.5.5
from sources (wich depands on gtk+-2.0 = 2.10.0).
But although I downloaded the latest package from www.gtk.org:
gtk+-2.18.4.tar.bz2
glib-2.18.0.tar.bz2
pango-1.26.1.tar.bz2

and followed instructions and steps from
http://library.gnome.org/devel/gtk/unstable/gtk-building.html; specially
Dependencies and Building and testing GTK topics; I'm getting follown error
message when compiling gtk+:
...
/home/calves/mydownloads/gtk+-2.18.4/gdk/.libs/libgdk-x11-2.0.so: undefined
reference to `pango_cairo_context_get_shape_renderer'
collect2: ld returned 1 exit status
make[4]: *** [gtk-query-immodules-2.0] Error 1
make[4]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4'
make: *** [all] Error 2

Anybody could help me fixing it?

In addition, I also did in success the spteps
./configure
make
make install

for glib-2.22.tar.bz2,pango-1.26.1.tar.bz and atk-1.28.0.tar.bz2
packages.
I also did success for cairo-1.8.8.gz, pixman-0.17.2.tar.gz  and
glitz-0.5.6.tar.gz before pango.

But 'make check' of cairo return many error messages and a resume like
...
=
103 of 205 tests did not behave as expected (1 unexpected pass)
Please report to http://bugs.freedesktop.org/enter_bug.cgi?product=cairo

Failures per surface - xlib: 15, xlib-fallback: 12, ps2: 35, ps3: 41, pdf:
36, svg: 1, svg11: 8, image: 7.

and when compiling pango, the step
./configure
says
.
checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support
.

I don't know if there's conection between this error messages and ask and
thanks very much any help someone could give me to compile gtk+
susccesfully.

Thanks in advance

p.s.: I'm using Debian Gnu/Linux 4.0 -(2.6.18-6-amd64)
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Problem Compiling Gtk+-2.18.1

2009-12-12 Thread Carlos Alberto de Oliveira Alves
Thanks Tadej,

I just got sucess compiling gtk+ as you adviced me.
I just updated fontconfig to the last 2.8.0 version, which included the last
fontconfig.h also;
and followed the preferred sequence of installing whole GTK+ stack:

cairo, glib, atk, pango, gtk.

as said by http://gtkforums.com/viewtopic.php?t=3760highlight=fontconfig
and it worked for me!

But for the last;
I just got errors when making the  optional make check step for cairo and
gtk+ as bellow:

So I do ask: Does these errors mean I'm exposed to any kind of attack by
securities holes when using
this libraries?!

...gtk+ make check error
message.
Gtk+Tests:ERROR: Failed to start Xvfb environment for X11 target tests.
make[5]: *** [test] Error 1
make[5]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk/tests'
make[4]: *** [test] Error 2
make[4]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[2]: *** [check-recursive] Error 1
make[2]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[1]: *** [check] Error 2
make[1]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make: *** [check-recursive] Error 1
---
.cairo make check error
message...
make[4]: Entering directory `/home/calves/mydownloads/cairo-1.8.8/src'
/bin/sh: line 8: cairo.def: Permission denied
make[5]: *** [cairo.def] Error 1
Checking that .libs/libcairo.so has the same symbol list as cairo.def
19d18
..
FAIL: check-def.sh
..

1 of 6 tests failed
Please report to http://bugs.freedesktop.org/enter_bug.cgi?product=cairo

make[4]: *** [check-TESTS] Error 1
make[4]: Leaving directory `/home/calves/mydownloads/cairo-1.8.8/src'
make[3]: *** [check-am] Error 2
make[3]: Leaving directory `/home/calves/mydownloads/cairo-1.8.8/src'
make[2]: *** [check] Error 2
make[2]: Leaving directory `/home/calves/mydownloads/cairo-1.8.8/src'
make[1]: *** [check-recursive] Error 1
make[1]: Leaving directory `/home/calves/mydownloads/cairo-1.8.8'
make: *** [check] Error 2
--

Carlos Alberto



2009/12/12 Tadej Borovšak tadeb...@gmail.com

 Hello.

 I'm reposting this back to mailing list for other to help.

  No, I already have fontconfig 2.4.2 installed! that's enough, isn't it?
  Anybody else could point me out another hints?

 If I'm not mistaken, you'll need fontconfig development package. I
 searched the gtkforums.com for a thread that deals with this error and
 this is what I found:
 http://gtkforums.com/viewtopic.php?t=3760highlight=fontconfig

 Tadej

 --
 Tadej Borovšak
 tadeboro.blogspot.com
 tadeb...@gmail.com
 tadej.borov...@gmail.com

___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Fwd: Problem Compiling Gtk+-2.18.1

2009-12-11 Thread Carlos Alberto de Oliveira Alves
Hi guys,

I'm trying to compiling gtk+-2.28.1 so I'll can to compile firefox-3.5.5
from sources (wich depands on gtk+-2.0 = 2.10.0).
But although I downloaded the latest package from www.gtk.org:
gtk+-2.18.4.tar.bz2
glib-2.18.0.tar.bz2
pango-1.26.1.tar.bz2

and followed instructions and steps from
http://library.gnome.org/devel/gtk/unstable/gtk-building.html; specially
Dependencies and Building and testing GTK topics; I'm getting follown error
message when compiling gtk+:
...
/home/calves/mydownloads/gtk+-2.18.4/gdk/.libs/libgdk-x11-2.0.so: undefined
reference to `pango_cairo_context_get_shape_renderer'
collect2: ld returned 1 exit status
make[4]: *** [gtk-query-immodules-2.0] Error 1
make[4]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[2]: *** [all] Error 2
make[2]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4/gtk'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/calves/mydownloads/gtk+-2.18.4'
make: *** [all] Error 2

Anybody could help me fixing it?

In addition, I also did in success the spteps
./configure
make
make install

for glib-2.22.tar.bz2,pango-1.26.1.tar.bz and atk-1.28.0.tar.bz2
packages.
I also did success for cairo-1.8.8.gz, pixman-0.17.2.tar.gz  and
glitz-0.5.6.tar.gz before pango.

But 'make check' of cairo return many error messages and a resume like
...
=
103 of 205 tests did not behave as expected (1 unexpected pass)
Please report to http://bugs.freedesktop.org/enter_bug.cgi?product=cairo

Failures per surface - xlib: 15, xlib-fallback: 12, ps2: 35, ps3: 41, pdf:
36, svg: 1, svg11: 8, image: 7.

and when compiling pango, the step
./configure
says
.
checking for CAIRO... yes
checking which cairo font backends could be used... none
configure: Disabling cairo support
.

I don't know if there's conection between this error messages and ask and
thanks very much any help someone could give me to compile gtk+
susccesfully.

Thanks in advance

p.s.: I'm using Debian Gnu/Linux 4.0 -(2.6.18-6-amd64)
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


gtk-directfb crash

2009-11-08 Thread Moutusi De

Hi All,
I have built gtk with target directfb.
I have installed following pacakages:
1.gtk+-2.12.9
2.atk-1.13.2
3.cairo-1.6.4
4.glib-2.22.2
5.pango-1.20.2
6.pixman-0.12.0
7.DirectFB-1.2.0

I have built webkit-1.1.1 based on this gtk-directfb.Then I have bulit 
one browser called Midori  that is based on webkit.

When I am running midori , it is crashing in some of gtk call.

Could any one please let  me know how to solve this issue?

Below is back trace for this crash

(gdb) bt
#0  0x00110416 in __kernel_vsyscall ()
#1  0x076c2660 in raise () from /lib/libc.so.6
#2  0x076c4028 in abort () from /lib/libc.so.6
#3  0x0060c093 in signal_handler () from 
/usr/gtkdirectfb//lib/libdirect-1.2.so.0

#4  signal handler called
#5  0x00379f33 in IA__gdk_screen_get_system_colormap (screen=0x9416010) 
at gdkcolor-directfb.c:240
#6  0x0037c48b in IA__gdk_display_open (display_name=0x0) at 
gdkdisplay-directfb.c:193

#7  0x0035a4f5 in IA__gdk_display_open_default_libgtk_only () at gdk.c:288
#8  0x00769788 in post_parse_hook (context=0x93fc228, group=0x93fc040, 
data=0x0, error=0xbfe5e44c) at gtkmain.c:725
#9  0x002659c3 in IA__g_option_context_parse (context=0x93fc228, 
argc=0xbfe5e490, argv=0xbfe5e494, error=0xbfe5e44c)

   at goption.c:1947
#10 0x00769599 in IA__gtk_init_with_args (argc=0xbfe5e490, 
argv=0xbfe5e494, parameter_string=0x80a9f6f [Addresses],
   entries=0xbfe5e388, translation_domain=0x80a9f44 midori, 
error=0xbfe5e44c) at gtkmain.c:830

#11 0x0805d97b in main (argc=1, argv=0xbfe5e514) at ../midori/main.c:1662



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


gtk-directfb-crash

2009-10-29 Thread Moutusi De

Hi All,
I have built gtk with target directfb.
I have installed following pacakages:
1.gtk+-2.18.0
2.atk-1.28.0
3.cairo-1.8.0
4.glib-2.22.2
5.pango-1.26.0
6.pixman-0.12.0
7.DirectFB-1.2.7
8.FreeType 2-9.16.3

Now I am trying to run examples programs thats comes with gtk.While 
running the program one window comes with one mouse pointer and it 
freeze.I ran same
program with gtk- x11 where I get a Hello world message  with proper 
window.I am expecting same thing with gtk-direcfb.
Just for debugging I tried putting one exit(0) before gtk_widget_show 
(window) function call.Then I got the following error:


/*/
(helloworld:2654): Gdk-CRITICAL **: gdk_drawable_get_colormap: assertion
`GDK_IS_DRAWABLE (drawable)' failed

/*

Could anyone please let me know how to resolve this ?

Below is the code for reference.
int main( int   argc,
 char *argv[] )
{
   /* GtkWidget is the storage type for widgets */
   GtkWidget *window;
   GtkWidget *button;

   /* This is called in all GTK applications. Arguments are parsed
* from the command line and are returned to the application. */
   gtk_init (argc, argv);


   /* create a new window */
   window = gtk_window_new (GTK_WINDOW_TOPLEVEL);

   /* When the window is given the delete-event signal (this is given
* by the window manager, usually by the close option, or on the
* titlebar), we ask it to call the delete_event () function
* as defined above. The data passed to the callback
* function is NULL and is ignored in the callback function. */
   g_signal_connect (window, delete-event,
 G_CALLBACK (delete_event), NULL);

   /* Here we connect the destroy event to a signal handler.
* This event occurs when we call gtk_widget_destroy() on the window,
* or if we return FALSE in the delete_event callback. */
   g_signal_connect (window, destroy,
 G_CALLBACK (destroy), NULL);

   /* Sets the border width of the window. */
   gtk_container_set_border_width (GTK_CONTAINER (window), 10);

   /* Creates a new button with the label Hello World. */
   button = gtk_button_new_with_label (Hello World);

   /* When the button receives the clicked signal, it will call the
* function hello() passing it NULL as its argument.  The hello()
* function is defined above. */
   g_signal_connect (button, clicked,
 G_CALLBACK (hello), NULL);
/* This will cause the window to be destroyed by calling
* gtk_widget_destroy(window) when clicked.  Again, the destroy
* signal could come from here, or the window manager. */
   g_signal_connect_swapped (button, clicked,
 G_CALLBACK (gtk_widget_destroy),
 window);

   /* This packs the button into the window (a gtk container). */
   gtk_container_add (GTK_CONTAINER (window), button);

   /* The final step is to display this newly created widget. */
   gtk_widget_show (button);

   exit(0);
   /* and the window */
   gtk_widget_show (window);
   /* All GTK applications must have a gtk_main(). Control ends here
* and waits for an event to occur (like a key press or
* mouse event). */
   gtk_main ();

   return 0;
}
Thanks,
Moutusi





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


Re: cairo surface from GdkPixmap

2009-06-20 Thread Michiel de Hoon

Dear Andrew, Dov,

Thank you for your replies. Maybe my original question was not so clear; I've 
tried to clear things up below.

[Andrew wrote]
 As is compulsory on this list :) I note in passing that it turns out
 that this [poorly-named] list is the one for discussion about _hacking_
 on GTK. Questions about _developing_ with the library are best directed
 to gtk-list.

Yeah I know, I wrote to this mailing list because as far as I can tell, the 
functionality I am looking for is available in GTK but only as a private 
function, and I was trying to show that software building on GTK (such as 
pygtk) may want access to this functionality. So the issue is more about the 
design of the GTK api.

[Michiel wrote]
  I am looking for a way to obtain a Cairo surface from a GdkPixmap.

[Andrew wrote]
 You're probably looking for gdk_cairo_create() ...

Unfortunately this won't work for me. gdk_cairo_create() creates a Cairo 
surface, then it creates a Cairo context from this surface, and then it 
destroys the Cairo surface.  What I am looking for is a function that creates a 
Cairo surface and returns it directly. Then I can use pycairo to create a Cairo 
context from the Cairo surface, which allows me to subclass the Cairo context. 
The gtk function _gdk_drawable_ref_cairo_surface does exactly what I want, 
however this is a private function.

[Andrew wrote]
 or gdk_cairo_set_source_pixmap(), depending on what exactly you're up to.

Sorry for that, I should have been more clear in my original post. I am looking 
at a third-party piece of software that uses pygtk and pycairo. As drawing can 
be expensive in this application, to avoid unnecessary redrawing all drawing is 
done to a pixmap, and on an expose event the pixmap is drawn to the window. In 
my understanding, gdk_cairo_create is appropriate in this case (rather than 
gdk_cairo_set_source_pixmap), except that in the current design of gtk I won't 
be able to subclass the Cairo context.

[Dov wrote]
...
 Basically all you need to do is:
 
  cairo_surface_t *surface
   = cairo_image_surface_create_for_data(gdk_pixbuf_get_pixels(pixbuf),
  CAIRO_FORMAT_RGB24,
  img_width,
  img_height,
   gdk_pixbuf_get_rowstride(pixbuf));

This is very close to what I need, except that this is for a pixbuf rather than 
for a pixmap. Can the same functionality be made available for pixmap? In other 
words, can _gdk_drawable_ref_cairo_surface become public?

Thanks again for your replies,

--Michiel




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


Re: GtkActionEntry callback

2009-06-16 Thread Salvatore De Paolis
On Tue, 16 Jun 2009 14:17:24 +0200
Christian Dywan christ...@lanedo.com wrote:

 Am Mon, 15 Jun 2009 19:54:01 +0200
 schrieb Salvatore De Paolis iw...@claws-mail.org:
 
  Hi all,
  
  I'm in a context where the shortcuts should work and I have the
  ability to switch into another where they should be disabled because
  may interfere with the typical use of the new context.
  GtkActionEntry allows to associate a callback to an action and
  execute it on the activate signal. I wonder if there's a way to
  temporary block this signal maybe from the pre-activate one.
  Any hints?
 
 Hey Salvatore,
 
 try gtk_window_remove_accel_group.
 
 ciao,
 Christian

Hey Christian,

I think it's what I was searching...
I'll test it, thanks for the hint:)

See ya
S.


signature.asc
Description: PGP signature
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


GtkActionEntry callback

2009-06-15 Thread Salvatore De Paolis
Hi all,

I'm in a context where the shortcuts should work and I have the
ability to switch into another where they should be disabled because may
interfere with the typical use of the new context.
GtkActionEntry allows to associate a callback to an action and execute it on
the activate signal. I wonder if there's a way to temporary block this signal
maybe from the pre-activate one.
Any hints?

Regards
S.


signature.asc
Description: PGP signature
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


cairo surface from GdkPixmap

2009-06-13 Thread Michiel de Hoon

Hi everybody,

I am looking for a way to obtain a Cairo surface from a GdkPixmap.
Just for reference, a few years ago one user was looking for the same 
functionality:

http://mail.gnome.org/archives/gtk-devel-list/2005-September/msg00138.html

The function _gdk_drawable_ref_cairo_surface does exactly what I want, however 
this is a private function. So right now I am using

surface = GDK_DRAWABLE_GET_CLASS (pixmap)-ref_cairo_surface (pixmap);

instead, but I doubt that this is recommended practice.

Basically what I am trying to accomplish is to create a class derived from 
cairo.Context from a pixmap in pygtk. To do so, I need to go through the 
cairo.Context constructor directly rather than using pixmap.cairo_create. But 
the cairo.Context constructor takes a Cairo surface rather than a pixmap, so I 
need to obtain a Cairo surface from the pixmap first. While this can be done 
with _gdk_drawable_ref_cairo_surface, this function is not available through 
PyGTK since it's a private function in gtk.

Or is there an alternative way to accomplish this?

Many thanks in advance,

--Michiel



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


Re: Gtk+ Integration with Webkit

2008-09-30 Thread Salvatore De Paolis
On Tue, 30 Sep 2008 23:23:41 +0300
Mackram Raydan [EMAIL PROTECTED] wrote:

Hi,
 Hey All,
 
 I am working on a small app that needs some integration with an HTML layout
 engine. I have read across the net that there is work to integrate webkit
 with Gtk+ but cant seem to find some good explanation of the integration or
 some quick tutorials. I want to do the project in a fast time frame but
 would prefer to stick with Gtk rather than going with something like Qt
 which supports webkit directly (or so I hear).
Ports exists for Qt and GTK+ as well...
As far I know, there aren't tutorial about it, but you can take a look at
sources of GtkLauncher (included in webkit sources) or the web browser midori
if you want to build you app in C.
 PS I am thinking of writing the application in C or Lisp but if webkit
 integration is already done for python then I might take that route, so do
 let me know
If you would like to go with python instead, you would check here
http://code.google.com/p/pywebkitgtk/

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

Re: g_signal_emit and parameters

2008-08-30 Thread Salvatore De Paolis
On Sat, 30 Aug 2008 18:19:04 +0200
Mike Massonnet [EMAIL PROTECTED] wrote:

Hi Mike!
 Completely random guess, gtk_widget_show (item) maybe.
Yeah, it helped, thanks!

Sal

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

Re: Poppler vs. LGPL

2008-07-29 Thread Salvatore De Paolis
On Tue, 29 Jul 2008 22:52:49 -0400
Mike [EMAIL PROTECTED] wrote:

 Ask the author[s] to release it also in LGPL?

Actually poppler lib is a fork of xpdf which is strictly GPL-2. (strictly mean
also the author is deaf)

 John Boncek wrote:
  The Poppler library has been recommended in this list for in-application
  display of PDF files.  However, Poppler is issued under the Gnu General
  Public License (GPL), unlike Gtk+, which is under the LGPL.  This makes it
  unusable in a project using only LGPL and similarly-licensed works.  Is
  there any LGPL solution?

A choice could be here http://www.glyphandcog.com/buy.html
___
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Caret position of a GtkTextView

2008-04-24 Thread Felipe Monteiro de Carvalho
Hello,

I have a GtkTextView. How can I set and get the caret position in the
GtkTextView? And for a GtkEntry?

The caret is the blinking cursor that appears when writing text.

thanks,
-- 
Felipe Monteiro de Carvalho
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: Avoid automatic navigation between GtkEntry widgets with arrows

2008-04-17 Thread Felipe Monteiro de Carvalho
On Wed, Apr 16, 2008 at 7:20 AM, sanny chawla [EMAIL PROTECTED] wrote:
 Listen to key press events of GtkEntry and for Up/Down events shift the
 focus to implemented widget.
  Don't propagate Up/Down key press events to GtkEntry.

Should I implement both, or either one or the other?

-- 
Felipe Monteiro de Carvalho
___
gtk-list mailing list
gtk-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-list


Re: [directfb-dev] GtkComboBox drop down list covered by GtkDialogs

2008-02-28 Thread Jesus Ruiz de Infante
Hello list!

With respect to the pop up window not being in the  DWSC_UPPER class the 
problem seems to
be that gdk_window_set_type_hint() is not fully implemented. I have added the 
handling for
GDK_WINDOW_TYPE_HINT_POPUP_MENU:

--- gdk/directfb/gdkwindow-directfb_orig.c  2008-02-28 16:02:53.0 
+0100
+++ gdk/directfb/gdkwindow-directfb.c   2008-02-28 16:26:04.0 +0100
@@ -2255,6 +2255,8 @@
  gdk_window_set_type_hint (GdkWindow*window,
GdkWindowTypeHint hint)
  {
+  GdkWindowImplDirectFB *impl;
+
g_return_if_fail (GDK_IS_WINDOW (window));

if (GDK_WINDOW_DESTROYED (window))
@@ -2263,7 +2265,19 @@
GDK_NOTE (MISC, g_print (gdk_window_set_type_hint: 0x%x: %d\n,
 GDK_WINDOW_DFB_ID (window), hint));

-  ((GdkWindowImplDirectFB *)((GdkWindowObject *)window)-impl)-type_hint = 
hint;
+  impl = GDK_WINDOW_IMPL_DIRECTFB (GDK_WINDOW_OBJECT (window)-impl);
+
+  impl-type_hint = hint;
+
+  switch (hint)
+  {
+   case GDK_WINDOW_TYPE_HINT_POPUP_MENU:
+   impl-window-SetStackingClass (impl-window, DWSC_UPPER);
+   impl-window-RaiseToTop (impl-window);
+   break;
+   default:
+   ;
+  };


/* N/A */

With this patch the dfbdump output seems ok:

---[ Windows of Layer 0 
]-
Reference   FID  . Refs X Y   Width Height Opacity   ID 
Capabilities   State  Options
--
0x0018 [  1] :   6  2,2 71 x   810x00 4  ^  
alphachannel   FOCUSED
0x0014 [  1] :   3  0,0 75 x   450xff 2  ^  alphachannel
0x0017 [  1] :   1   -100, -100 10 x   100x00 3  -  input only
0x0012 [  1] :   2  0,0640 x  4800x00 1  -  alphachannel


I have the following open questions:
- What is an input only window?
- Who's creating this extra GdkWindow just for input and why?
- Why are DirectFB windows not collected (freed) after they are closed?
   For example, after closing a dialog, it continues appearing in the dfbdump 
output.

Other problems
- The dropdown list loses focus after being clicked. You must move the mouse 
slightly for it to gain focus again.
- Why does the combo box not use GDK_WINDOW_TYPE_HINT_COMBO, rather than 
GDK_WINDOW_TYPE_HINT_POPUP_MENU?
   (Ok, this is probably a gtk+ question)

-- 
Mit freundlichen Grüßen

Jesus Ruiz de Infante
(Entwicklung)
HALE electronic GmbH
Eugen-Müller-Straße 18, 5020 Salzburg, Austria
Tel:  +43 (662) 439011 0
Fax:  +43 (662) 439011 9
[EMAIL PROTECTED]
Firmenbuchnummer: FN 66801m HG Salzburg



--
Scanned by MailScanner.

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


Re: Gtk on Embedded Device Query

2007-11-29 Thread Philippe De Swert
Hi,

 
 Thanks for the reply.
 Anyhow I have to use this system for my application. I agree that this
 system is having slow processor speed. But lower than this configuration,
 processors running on mobile devices performing well in terms of GUI. So, I
 thought gtk+ (gtk-directfb) will help me in this.

Depending on your framebuffer implementation and screen size this might not be
the case as gtk-directfb is not as mature as gtk+ on X11.
 
 Now it seems that gtk+ is not suited for embedded devices. Or is there any
 way to make it work fast.
 I am running gtk+ application on an embedded board (PXA255 processor
  with
   400MHz speed) running Linux.

Gtk+ works fine on embedded systems. Especially a PXA255 at 400Mhz should be
able to deal with it easily. Lots of systems based on this cpu work fine with
GPE (http://gpe.linuxtogo.org) which is coded using GTK+. Also the Nokia
internet tablets are all using GTK+ and some of them have less CPU power
available than a PXA255. The PXA255 bus can be overloaded sometimes with
peripherals etc, but that should mainly slow down application loading, not
execution.

 The Main problem here is while drawing gtk widgets on screen my CPU usage
 goes upto 92%. Any button press in window also make CPU usage more.

This is very weird, I would believe this is caused by directfb that seems to
have a hard time to communicate with your framebuffer. Maybe you should try
X11 also. 

Also Openembedded (build system) and Maemo (Nokia's Linux for their internet
tablets) have some patches to GTK+ that should make GTK+ require less CPU.

Regards,

Philippe
---
Scarlet One, ADSL 6 Mbps + Telephone, from EUR 29,95...
http://www.scarlet.be/

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


Re: Logo (was Re: GTK+ Website Review)

2007-10-07 Thread Salvatore De Paolis
On Sun, 7 Oct 2007 12:51:23 +0200
[EMAIL PROTECTED] wrote:

 The box *looks* awesome, it just needs some gradient or texture in it to
 give it the fashion trend you are looking for.

I agree with the box too. 
It just needs to be updated to the 2.12.
Imho, a complete change of the logo needs something much more impressive. 
Keep it as a joke, but this logo looks like a suppository:)

S.
___
gtk-devel-list mailing list
gtk-devel-list@gnome.org
http://mail.gnome.org/mailman/listinfo/gtk-devel-list


  1   2   3   >