GtkTextBuffer stripping carriage returns?

2012-11-18 Thread kcirtap
I've got a GtkTextBuffer, and I'm pasting some text that contains a
carriage return in it (e.g., \r\n). I know for sure that there's an \r\n
in it because when I copy the text from the buffer into a hex editor, it
shows the \r\n is there.

However when I get the text from the buffer (gtk_text_buffer_get_text),
the \r isn't there... just the \n.

Any idea why this might be?


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


Screenshots using GTK+ on Windows: works fine except if monitors are stacked vertically.

2010-11-15 Thread kcirtap
I use GTK+ to take screenshots in my program on Windows. It works great;
however, someone reported to me that if their monitors are stacked
vertically, the monitors in the top row aren't included in the screenshot
properly (it looks garbled).

I was able to confirm this; I opened up my graphics driver's control
panel, positioned my secondary monitor on top of the main one in the
configuration, took a screenshot using my program, and while the main
monitor (positioned on the bottom) shows up fine in the screenshot, the
secondary monitor (positioned above the main monitor) shows up garbled.

I'm not sure if this is a bug with my program (is there more than one
window besides the root window?) or with GTK/GDK. Any help would be
appreciated.

By the way, I already submitted this as a bug (#634713), and you can view
it, along with an example program demonstrating the issue, here:
https://bugzilla.gnome.org/show_bug.cgi?id=634713


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


Re: Give keyboard focus to GtkMenu

2010-10-25 Thread kcirtap
I discovered that if my application's main window is focused when I pop-up
the GtkMenu anywhere on the screen, the GtkMenu also has keyboard focus
and can be navigated using the keyboard keys.

However, if my application's main window does _not_ have focus, that's
when the menu doesn't receive keyboard focus and can't be navigated using
the keyboard, though this is what I'm trying to accomplish: keyboard focus
to a GtkMenu even if the main window isn't in the foreground and doesn't
have focus.


 I'm popping-up a GtkMenu at random coordinates on the screen (outside of
 my application's main window). I'd like to give keyboard focus to this
 GtkMenu.

 Since I'm using Windows, I tried:

 SetForegroundWindow(GDK_WINDOW_HWND(menu-window));

 But that causes the menu to immediately disappear, as does:

 SetFocus(GDK_WINDOW_HWND(menu-window));

 I also tried:

 GTK_WIDGET_SET_FLAGS(menu, GTK_CAN_FOCUS);
 gtk_widget_grab_focus(menu);

 But that doesn't do anything at all. Any ideas? I'm trying to make it so
 that the user can navigate the menu using their keyboard.


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


Give keyboard focus to GtkMenu

2010-10-14 Thread kcirtap
I'm popping-up a GtkMenu at random coordinates on the screen (outside of
my application's main window). I'd like to give keyboard focus to this
GtkMenu.

Since I'm using Windows, I tried:

SetForegroundWindow(GDK_WINDOW_HWND(menu-window));

But that causes the menu to immediately disappear, as does:

SetFocus(GDK_WINDOW_HWND(menu-window));

I also tried:

GTK_WIDGET_SET_FLAGS(menu, GTK_CAN_FOCUS);
gtk_widget_grab_focus(menu);

But that doesn't do anything at all. Any ideas? I'm trying to make it so
that the user can navigate the menu using their keyboard.


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


A better way of resizing GtkTreeViewColumns... but how do I do it?

2010-09-28 Thread kcirtap
Hi all,

I'm trying to create GtkTreeViewColumn resizing functionality like how it
is in Thunderbird. Key word here is trying. So far I haven't succeeded.

The easiest way to understand how this resizing works is to fire up
Thunderbird and play with resizing the columns yourself, but basically the
way it works in Thunderbird is if you drag, say, column #1 to the right,
this increases the width of column #1, at the same time decreasing the
width of column #2 by the same amount. This happens until column #2
reaches its minimum width (for example, 0 pixels). At this point,
continuing to drag column #1 to the right still increases the width of
column #1, but since column #2 cannot be shrunken any further, then column
#3 is shrunken until it reaches its minimum width. This continues until
all of the columns to the right of column #1 are at their absolute minimum
widths; at this point, column #1 can't have its width increased anymore,
so continuing to drag the column to the right does nothing.

While the mouse button is still held down, if you were to start dragging
column #1 to the left again (to shrink it), what would happen is what
happened above, except in reverse order. As column #1 shrinks, the last
column in the tree view grows until reaching its width at the time the
original drag (when the mouse was first pressed down to start the drag)
first started. At this point, the second to last column grows until
reaching its width at the time of the original drag... and so on.

Then of course, when column #1 reaches its minimum width, column #0
shrinks until it reaches its minimum width. Since column #0 is the first
column, then continuing to drag column #1 to the left won't shrink it
anymore; in fact, nothing will happen.

One of the major benefits to handling dragging like this is: the columns
will never be resized out of bounds and cause the GtkTreeView to grow in
width or, if the GtkTreeView containing the GtkTreeViewColumns is packed
into a scrolled window, cause horizontal scrollbars to appear. Having
these scrollbars appear, or the tree view grow in width (and thus increase
the width of the window) is super annoying for the user and makes things
look a lot less clean. Which is, I assume, why Thunderbird handles it this
way, as do other applications.

So, anyway, my problem is that I just can't figure out how to do this in
GTK+. I'm wondering if it's even possible? If it is, would someone be able
to create a working example for me? I'd be willing to pay for this if
necessary.

As far as I know, the only signal you can connect to to know if a
GtkTreeViewColumn has been resized is the notify::width signal. Problem
is, you can't return TRUE or FALSE from the signal handler function to
tell GTK+ not to allow the resize to go through. It's just a notification
signal. So that prevents me from, for example, detecting that all columns
to the right of the one being dragged have reached their minimum widths
and then telling GTK+ to stop the column from having its width increased
anymore.

Another problem: if you call gtk_tree_view_column_set_fixed_width() --
what I am doing is calling gtk_tree_view_column_set_resizable(column,
TRUE) and then calling gtk_tree_view_column_set_sizing(column,
GTK_TREE_VIEW_COLUMN_FIXED) when creating the columns, by the way --
within the notify::width signal, it creates an infinite loop, which I
don't know how to prevent, either.

Again, any help would be much appreciated. Thanks!


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


Re: GTK+ 2.20.0 is now available for download...

2010-03-25 Thread kcirtap
Out of curiosity, how is Win32 support?

I know that the MS-Windows theme wasn't working with 2.18 (client-side
windows support needed to be added), and that on GTK.org it said that 2.16
was in a way more stable than 2.18 on the Win32 platform. Has this
changed?

I see that in the release notes it says XP themes have been disabled
since they don't work but I'm not sure if that has anything to do with
the MS-Windows theme or not.


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


GTK+/pango 32-bit on Windows 64-bit

2010-01-07 Thread kcirtap
Is anyone aware of any issues running GTK+ and/or pango 32-bit on Windows
7 64-bit?

Unfortunately I don't have 64-bit hardware at my disposal to test this on,
but someone who's trying to use my app is reporting that when they run it,
they get:

libpango-1.0-0.dll is either not designed to run on Windows or it
contains an error.

I'm using the gtk+-bundle_2.16.6-20091013_win32.zip bundle, by the way.


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


Re: How to Adjust GtkMenu Popup Under Button Widget.

2009-11-10 Thread kcirtap
Check out gtkcombobox.c in GTK's source; the logic you need should be in
the code that deals with positioning the popup for the GtkComboBox.

--Patrick


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


Prevent sort column's background from turning gray.

2009-10-17 Thread kcirtap
Is there any way to prevent a GtkTreeViewColumn's background from turning
gray when it's selected as the sort column?

-- Patrick


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


Re: Prevent sort column's background from turning gray.

2009-10-17 Thread kcirtap
 Is there any way to prevent a GtkTreeViewColumn's background from turning
 gray when it's selected as the sort column?

 -- Patrick

See bug #308973 (https://bugzilla.gnome.org/show_bug.cgi?id=308973) for
more on this issue.

-- Patrick



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


GTK+ 2.16.6 Win32 dependencies...

2009-10-03 Thread kcirtap
I just upgraded my binaries on Win32 from 2.16.4 to 2.16.6, and noticed
that now my GTK+ app asks for libfontconfig-1.dll, libexpat-1.dll, and
freetype6.dll at startup, whereas before it didn't need those DLLs.

Just wondering why this might be?

Thanks.

-- Patrick


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


Re: State of Gtk+-2.18 On Windows

2009-10-01 Thread kcirtap
 The ms-windows theme engine doesn't work nicely in GTK+ 2.18, so I
 don't include it in the binaries above. This is unfortunate. This is a
 problem in the ms-windows theme engine code, it needs to be modified
 to work with client-side windows.

Dang, that's a shame. Any idea on how difficult it'd be to modify the
ms-windows theme engine code to make it work, and do you happen to know if
anyone is currently working on this?

- Patrick


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


Manipulating a GtkComboBox like a GtkTreeView.

2009-09-30 Thread kcirtap
I've got a GtkListStore as the model for a GtkComboBox. I'd like to be
able to call gtk_tree_view_set_show_lines() and
gtk_tree_view_expand_all(), but obviously a GtkComboBox is not a
GtkTreeView...

Is it possible to do this with a GtkComboBox? If not... is there at least
a way to expand certain rows?


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