Re: The Future?

2019-03-13 Thread Igor Korot via gtk-list
Hi,

On Wed, Mar 13, 2019 at 11:08 AM Emmanuele Bassi  wrote:
>
> On Wed, 13 Mar 2019 at 15:53, Igor Korot  wrote:
>>
>> Hi, Emmanuel et al,
>>
>> On Sun, Mar 10, 2019 at 4:38 AM Emmanuele Bassi via gtk-list
>>  wrote:
>> >
>> > Meta: having this discussion on gtk-list is probably the best example as 
>> > to why we need to move to Discourse. Nobody involved with the development 
>> > of GTK even reads this list, except me, so you're never going to get more 
>> > than my opinion about it.
>>
>> What is "Discourse"?
>
>
> Announcement of the Discourse instance, sent to this list: 
> https://mail.gnome.org/archives/gtk-list/2019-March/msg0.html
>
> Discourse: https://discourse.gnome.org

Thank you for the link. I will look at them.

>
>>
>> How about porting recent GTK version to OpenVMS?
>
>
> If you want to add a new platform to GTK, you will need to:

Here is the problem - it is not a new port.
The last version of GTK+ on OpenVMS is GTK+1.x.

There was an effort to upgrade GTK+ for OpenVMS, but unfortunately it failed.

Now out of curiosity - do you have access to OpenVMS?

Thank you.

>
>  - ensure that GTK master and gtk-3-24 build on it
>  - open merge requests for every needed fix, if any
>  - add a GitLab CI runner, so that we can test every commit and merge request 
> on that platform, and ensure we don't regress
>
> If you want to support OpenVMS, you'll have to work on it, or pay somebody to 
> work on it.
>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: The Future?

2019-03-13 Thread Igor Korot via gtk-list
Hi, Emmanuel et al,

On Sun, Mar 10, 2019 at 4:38 AM Emmanuele Bassi via gtk-list
 wrote:
>
> Meta: having this discussion on gtk-list is probably the best example as to 
> why we need to move to Discourse. Nobody involved with the development of GTK 
> even reads this list, except me, so you're never going to get more than my 
> opinion about it.

What is "Discourse"?
In the past there was a forum about GTK+ where people could come and
ask questions - it is now dead.
And this list is the only place that known to people.

>
> Meta × 2: while I am employed by the GNOME Foundation to work in GTK, this 
> *my* opinion, and should not be construed as anything but my opinion.
>
> On Sun, 10 Mar 2019 at 06:37, Miroslav Rajcic  wrote:
>>
>> I think the question is a valid one and there is a plenty of evidence of 
>> people moving to Qt due to some issues of GTK.
>>
>> Some notable examples:
>>
>> - VLC 
>> (https://ubuntuforums.org/showthread.php?t=316155&s=54b259f2cb2d1a30ca8dc269d0561537)
>>
>> - Wireshark  (https://blog.wireshark.org/2013/10/switching-to-qt/)
>>
>> - Subsurface by Linus 
>> (https://liveblue.wordpress.com/2013/11/28/subsurface-switches-to-qt/)
>>
>> - GCompris educational software 
>> (https://mail.kde.org/pipermail/kde-edu/2014-February/007950.html)
>
>
> VLC, Wireshark, Subsurface, and GCompris switched to Qt mostly because of its 
> support for Android and mobile platforms, something that GTK doesn't support. 
> Well, Subsurface moved to Qt because the original developers thought that 
> asking on Google Plus was the proper way to ask for help with writing GTK 
> applications, and had no objections when somebody else showed up and rewrote 
> their application using Qt.
>
> It's entirely justified to go through the ringer of a full rewrite if you're 
> thinking of expanding somewhere the GUI toolkit you use is not going to be, 
> and it's highly unlikely that an Android backend for GTK will ever 
> materialise—let alone an iOS one—so if you're thinking of targeting Android 
> and iOS, Qt is a perfectly valid choice. I personally would recommend using 
> Xamarin.Forms, and stop writing code in C/C++.
>
> The LXDE case is a bit different: writing desktop environments is kind of 
> what GTK is known for. It seems that LXDE didn't have many contributors, and 
> the few that were there decided to join forces with a Qt-based project in 
> order to increase the contributors base. It's also telling that the Qt port 
> of LXDE is still very much in progress, and the GTK2 code base is still being 
> maintained. If porting to a new major version of a toolkit is a lot of work, 
> porting to a whole new infrastructure is even more work.
>>
>> All these people have valid complaints, so someone should think about it.
>
> Everyone involved in GTK thought about them. We incorporated the feedback we 
> gleaned from the various ranting into a better stability and versioning 
> guarantees; better tooling, like the Inspector; a better build system, to 
> ensure ease of build on Windows and macOS. If the complaint is "it's not 
> written in C++" or "there is no paid support" then there isn't much we can do.
>
>> 1. GTK is not so cross-platform anymore: on Windows and macOS, you are 
>> supposed to build your own library binaries (gvsbuild for Windows and 
>> jhbuild for macOS exist, but are not foolproof).
>
>
> There is a fundamental misconception at work, here. GTK was never a 
> cross-platform in the same sense as Qt is a cross-platform toolkit. GTK began 
> supporting Windows in the 2.0 release (2002) because GIMP first, and then 
> Evolution, needed to build and run on Windows. GTK is a *portable* toolkit, 
> but its goal has always been writing Linux (and GNOME-adjacent) applications.
>
> Of course it doesn't mean we shouldn't support people writing non-Linux apps 
> with GTK, but they are a smaller target audience.
>
> Plus, you seem to imply that "binary builds for Windows" somehow means 
> "better cross-platform support", which is nonsensical at best. Windows 
> support in GTK has *never* been this good. There are multiple volunteers 
> working on building, testing, and developing GTK on Windows. It would be 
> great to have as many people working on macOS, even though things are moving 
> once again, there.

How about porting recent GTK version to OpenVMS?

Thank you.

>>
>>   "Golden age" in this regards was when Tor Lillqvist was still doing the 
>> Windows builds regularly on each GTK release. GTK was easy to be used on 
>> Windows at that time.
>
> Yes, things are always "easy" when somebody else is paid to do them for you. 
> Doesn't mean they are easy at all.
>
> Given that Tor stopped working on these years ago, and that Windows hasn't 
> stayed still in the meantime, the only reasonable course of action for GTK 
> developers was to offload the build of GTK on Windows to the MSYS2 package 
> management system—mostly like we do on macOS, with brew and macports. Of 
> course, we would have loved it

Toolbar setup dialog

2019-03-07 Thread Igor Korot via gtk-list
Hi, list,
On both Windows and OSX it is possible to have a standard
platform-dependent toolbar
setup dialog with the appropriate API. The dialog will allo to
add/remove the tool button
and re-arrange them.

Is there such a dialog for GtkToolbar? Or I will have to create one myself?
Is there a plan to make one and put it in the library?

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


Re:

2019-02-20 Thread Igor Korot via gtk-list
Paul,

On Wed, Feb 20, 2019 at 12:30 PM Paul Davis  wrote:
>
>
>
> On Wed, Feb 20, 2019 at 11:10 AM Igor Korot  wrote:
>>
>> Hi, Paul,
>>
>> On Wed, Feb 20, 2019 at 12:03 PM Paul Davis  
>> wrote:
>> >
>> >
>> >
>> > On Wed, Feb 20, 2019 at 10:49 AM Igor Korot via gtk-list 
>> >  wrote:
>> >>
>> >>
>> >> Why do we even talking about button number, when the doc explicitly said
>> >> "right-click", which implies "right mouse button".
>> >
>> >
>> > X Window (at the very least) allows buttons to be remapped. Button #1 is 
>> > typically the left mouse button, but a user may remap them (eg. 
>> > left-handed people with a strong preference for using the mouse in their 
>> > left hand). "left" and "right" buttons normally have a semantic meaning 
>> > (e.g. "the button normally used for clicking on things" vs "the button 
>> > used for context menus etc.") and you cannot hard code these on X Window.  
>> > More precisely, if you do hard code them, you disenfranchise a set of 
>> > users who remap their mouse buttons.
>>
>> Are you saying that if I map the left mouse button to be the right one
>> and click on it, I will not get that signal?
>>
>> As far as the user code is concerned, the button I press to get the
>> context menu shouldn't matter, because this a low-level signal.
>> All the user code should be aware is - did I click the action button
>> or context menu one. Why do I need to care which is which?
>>
>> Could you give me a scenario?
>
>
> hold the mouse in your right hand. put your index finger on the most 
> naturally positioned button. press it.
>
> by default, X Window will generate a mouse button event using button number 
> one.
>
> now put the mouse in your left hand, put that index finger on the most 
> naturally positioned button, press it.
>
> by default, X Window will generate a mouse button event using button number 
> three.
>
> programmers don't want to deal with this in their code, so they generally 
> assume that button #1 is "left button" and button #3 is "right button".
>
> but what they really mean is "button used for most button clicks" and "button 
> used for context clicks"
>
> a dedicated left-handed user may remap this so that their left index finger 
> correctly generates button 1 - the button used for most clicks.
>
> your code can assume that 1 => most clicks; 3 => context click
>
> it cannot assume that 1 => left ; 3 => right

This is all correct and I'm not arguing about that.

What I do argue is why the context-menu event should care what mouse
button click it comes from?

Let's say I'm using GTK and writing a software.
Why should I care which button click generated my CSM?
As long as I get the event/message/signal I should be happy and will
write a handler where I will
construct the menu and display it.
The user can click the AUX1 button for all I care. But if this button
is not mapped correctly by the system
to generate "right-button click", this event/signal will never arrive/fire.

Am I missing something?
What is the scenario where user code needs to know if the button
pressed was 1, 3 or it was
a keyboard altogether (-1)?

Thank you.

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


Re:

2019-02-20 Thread Igor Korot via gtk-list
On Wed, Feb 20, 2019 at 12:10 PM Igor Korot  wrote:
>
> Hi, Paul,
>
> On Wed, Feb 20, 2019 at 12:03 PM Paul Davis  
> wrote:
> >
> >
> >
> > On Wed, Feb 20, 2019 at 10:49 AM Igor Korot via gtk-list 
> >  wrote:
> >>
> >>
> >> Why do we even talking about button number, when the doc explicitly said
> >> "right-click", which implies "right mouse button".
> >
> >
> > X Window (at the very least) allows buttons to be remapped. Button #1 is 
> > typically the left mouse button, but a user may remap them (eg. left-handed 
> > people with a strong preference for using the mouse in their left hand). 
> > "left" and "right" buttons normally have a semantic meaning (e.g. "the 
> > button normally used for clicking on things" vs "the button used for 
> > context menus etc.") and you cannot hard code these on X Window.  More 
> > precisely, if you do hard code them, you disenfranchise a set of users who 
> > remap their mouse buttons.
>
> Are you saying that if I map the left mouse button to be the right one
> and click on it, I will not get that signal?
>
> As far as the user code is concerned, the button I press to get the
> context menu shouldn't matter, because this a low-level signal.
> All the user code should be aware is - did I click the action button
> or context menu one. Why do I need to care which is which?

Moreover - why user should care where the signal comes from - mouse or
keyboard?
I just need a proper place to display the context menu and make sure
I can either dismiss it or get the proper action.

Am I missing something?

Thank you.

>
> Could you give me a scenario?
>
> Thank you.
>
> >
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re:

2019-02-20 Thread Igor Korot via gtk-list
Hi, Paul,

On Wed, Feb 20, 2019 at 12:03 PM Paul Davis  wrote:
>
>
>
> On Wed, Feb 20, 2019 at 10:49 AM Igor Korot via gtk-list  
> wrote:
>>
>>
>> Why do we even talking about button number, when the doc explicitly said
>> "right-click", which implies "right mouse button".
>
>
> X Window (at the very least) allows buttons to be remapped. Button #1 is 
> typically the left mouse button, but a user may remap them (eg. left-handed 
> people with a strong preference for using the mouse in their left hand). 
> "left" and "right" buttons normally have a semantic meaning (e.g. "the button 
> normally used for clicking on things" vs "the button used for context menus 
> etc.") and you cannot hard code these on X Window.  More precisely, if you do 
> hard code them, you disenfranchise a set of users who remap their mouse 
> buttons.

Are you saying that if I map the left mouse button to be the right one
and click on it, I will not get that signal?

As far as the user code is concerned, the button I press to get the
context menu shouldn't matter, because this a low-level signal.
All the user code should be aware is - did I click the action button
or context menu one. Why do I need to care which is which?

Could you give me a scenario?

Thank you.

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


Re:

2019-02-20 Thread Igor Korot via gtk-list
Hi, Stefan et al,

On Wed, Feb 20, 2019 at 11:33 AM Stefan Salewski  wrote:
>
> On Wed, 2019-02-20 at 11:07 -0600, Igor Korot via gtk-list wrote:
> > Hi, ALL,
> > This link https://developer.gnome.org/gtk3/stable/GtkToolbar.html#Gtk
> > Toolbar-popup-context-menu
> > states that the parameter "button" can be "-1".
> >
> > What is the scenario when this occurs, i.e. it should be the button
> > number that was clicked IIUC?
> >
> > Thank you for clarification.
> >
>
> Please use a more meaningful Subject next time.
>
> And you may consider reading the API docs you linked to more carefully:
>
> https://developer.gnome.org/gtk3/stable/GtkToolbar.html#GtkToolbar-popup-context-menu
>
> "Emitted when the user right-clicks the toolbar or uses the
> keybinding to display a popup menu."

I know I am kind of switching the topic here, but...

Why do we even talking about button number, when the doc explicitly said
"right-click", which implies "right mouse button".

Or I am misunderstanding something?

Thank you.

>
> So it seems to be obviously that button = -1 is the case when a
> keybinding is used to display a popup menu. (Because for this case
> there is no button involved.)
>
> When you continue reading the API docs, it is even more clear:
>
> "The mouse button number is given by the button parameter. If the menu
> was popped up using the keybaord, button is -1."
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re:

2019-02-20 Thread Igor Korot via gtk-list
Nevermind.
Didn't read the whole description.

Sorry for the noise.

Thank you.

On Wed, Feb 20, 2019 at 11:07 AM Igor Korot  wrote:
>
> Hi, ALL,
> This link 
> https://developer.gnome.org/gtk3/stable/GtkToolbar.html#GtkToolbar-popup-context-menu
> states that the parameter "button" can be "-1".
>
> What is the scenario when this occurs, i.e. it should be the button
> number that was clicked IIUC?
>
> Thank you for clarification.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


[no subject]

2019-02-20 Thread Igor Korot via gtk-list
Hi, ALL,
This link 
https://developer.gnome.org/gtk3/stable/GtkToolbar.html#GtkToolbar-popup-context-menu
states that the parameter "button" can be "-1".

What is the scenario when this occurs, i.e. it should be the button
number that was clicked IIUC?

Thank you for clarification.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkSelectionMode

2019-02-14 Thread Igor Korot via gtk-list
Hi, Greg,

On Thu, Feb 14, 2019 at 4:07 PM Greg Ewing  wrote:
>
> Igor Korot via gtk-list wrote:
> > I interpret this as following:
> > Using 1, I can select multiple string with just a mouse click if the
> > string is not being selected. If the string is already selected, it
> > becomes deselected without selection clearing on any other previously
> > selected string.
> >
> > And this is exactly the behavior I see on Windows.
>
> Can you provide an example of a Windows app that behaves like this
> (i.e. multiple selection with unmodified mouse clicks)? I can't
> remember ever seeing one.

What do you mean - "unmodified mouse clicks"?
Also, as far as I understand most native Windows applications have
extended selection style on and not just multiple selection
just to simplify the bulk selection operation, i.e. pressing
Shift to selecting continuous string in the list box.

I think that extending selection was made just for this purpose -
to allow the user to extend the selection for the bulk strings
either by using Shift or Ctrl.

I can try to create one such application with just a native Windows calls.
and a window with the listbox in it or some MFC application.
Can do it over this weekend.

Does this list allows attachments? Something like zip/tar/7z file?

Thank you.

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


Re: GtkSelectionMode

2019-02-14 Thread Igor Korot via gtk-list
Hi, Paul,

On Thu, Feb 14, 2019 at 10:41 AM Paul Davis  wrote:
>
>
>
> On Wed, Feb 13, 2019 at 10:49 PM Igor Korot  wrote:
>>
>> Hi, Paul,
>>
>> On Wed, Feb 13, 2019 at 10:03 PM Paul Davis  
>> wrote:
>> >
>> >
>> >
>> > On Wed, Feb 13, 2019 at 2:30 PM Igor Korot via gtk-list 
>> >  wrote:
>> >>
>> >>
>> >> Unfortunately thats not how it looks here.
>> >> When I create a control with GTK_SELECTION_MULTIPLE and just click on
>> >> the item - it works just like single selection.
>> >> In order to select multiple strings I have to press Ctrl key.
>> >
>> >
>> > what platform or desktop toolkit does *not* work this way?
>>
>> I'm running Gentoo Linux with GNOME 3 and GTK+ 3.22.30 from Gentoo repository
>>
>
> I'm afraid you missed my point. The behaviour you described sounds like the 
> behaviour I have always seen on every version of Linux and every version of 
> macOS that I've ever used. I have never come across an 
> application/platform/desktop toolkit that uses a mouse and works differently 
> to what you've described. To select multiple strings, you have to 
> differentiate between "forget the current selection, i'm starting a new one" 
> and "i want to add this to the selection", and the convention has been to use 
> a modifier key (typically Ctrl) to do that.

This is weird.
I know for sure that (at least on Windows) there are exist 2 different
styles - LBS_MULTIPLESEL and LBS_EXTENDEDSEL.
According to the MSDN (ref.
https://docs.microsoft.com/en-us/windows/desktop/controls/list-box-styles):

LBS_MULTIPLESEL - Turns string selection on or off each time the user
clicks or double-clicks a string in the list box. The user can select
any number of strings.
LBS_EXTENDEDSEL - Allows multiple items to be selected by using the
SHIFT key and the mouse or special key combinations.

I interpret this as following:
Using 1, I can select multiple string with just a mouse click if the
string is not being selected. If the string is already selected, it
becomes deselected without selection clearing on any other previously
selected string.
Using 2, I can extend the selection, i.e. pressing Shift, I can select
continuous string, i.e. select 1,2,3 and 4 strings with just 2 clicks.
Or using Ctrl, I can select multiple strings.

And this is exactly the behavior I see on Windows. And it is NOT how
it behaves on *nix/GTK.

Maybe all your Windows programs were using LBS_EXTENDEDSEL?

Also, I think I will need to test my Cocoa apps as its possible I
forgot what it did. Sorry about that. I will do that tonight.

Thank you.

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


Re: GtkSelectionMode

2019-02-13 Thread Igor Korot via gtk-list
Hi, Paul,

On Wed, Feb 13, 2019 at 10:03 PM Paul Davis  wrote:
>
>
>
> On Wed, Feb 13, 2019 at 2:30 PM Igor Korot via gtk-list  
> wrote:
>>
>>
>> Unfortunately thats not how it looks here.
>> When I create a control with GTK_SELECTION_MULTIPLE and just click on
>> the item - it works just like single selection.
>> In order to select multiple strings I have to press Ctrl key.
>
>
> what platform or desktop toolkit does *not* work this way?

I'm running Gentoo Linux with GNOME 3 and GTK+ 3.22.30 from Gentoo repository

[code]
IgorReinCloud / # emerge --info
Portage 2.3.49 (python 3.6.5-final-0, targets/desktop/gnome/3.24,
gcc-7.3.0, glibc-2.26-r7, 4.14.65-gentoo x86_64)
=
System uname: Linux-4.14.65-gentoo-x86_64-AMD_E-350_Processor-with-gentoo-2.4.1
KiB Mem: 7879424 total,   1176796 free
KiB Swap:1048572 total,   1048572 free
Timestamp of repository gentoo: Fri, 05 Oct 2018 03:00:01 +
Head commit of repository gentoo: 2fae3c1a66e8b36c3c3b9681908c9285a99d0d61
sh bash 4.4_p12
ld GNU ld (Gentoo 2.30 p5) 2.30.0
app-shells/bash:  4.4_p12::gentoo
dev-java/java-config: 2.2.0-r4::gentoo
dev-lang/perl:5.24.3-r1::gentoo
dev-lang/python:  2.7.15::gentoo, 3.6.5::gentoo
dev-util/cmake:   3.9.6::gentoo
dev-util/pkgconfig:   0.29.2::gentoo
sys-apps/baselayout:  2.4.1-r2::gentoo
sys-apps/openrc:  0.29::dantrell-gnome
sys-apps/sandbox: 2.13::gentoo
sys-devel/autoconf:   2.13::gentoo, 2.69-r4::gentoo
sys-devel/automake:   1.11.6-r3::gentoo, 1.15.1-r2::gentoo
sys-devel/binutils:   2.30-r4::gentoo
sys-devel/gcc:7.3.0-r3::gentoo
sys-devel/gcc-config: 1.8-r1::gentoo
sys-devel/libtool:2.4.6-r3::gentoo
sys-devel/make:   4.2.1-r4::gentoo
sys-kernel/linux-headers: 4.13::gentoo (virtual/os-headers)
sys-libs/glibc:   2.26-r7::gentoo
Repositories:

gentoo
location: /usr/portage
sync-type: rsync
sync-uri: rsync://rsync.gentoo.org/gentoo-portage
priority: -1000
sync-rsync-verify-metamanifest: yes
sync-rsync-verify-jobs: 1
sync-rsync-verify-max-age: 24
sync-rsync-extra-opts:

dantrell-gnome-3-24
location: /var/lib/layman/dantrell-gnome-3-24
masters: gentoo
priority: 100

dantrell-gnome
location: /var/lib/layman/dantrell-gnome
masters: gentoo
priority: 150

ACCEPT_KEYWORDS="amd64"
ACCEPT_LICENSE="* -@EULA Oracle-BCLA-JavaSE"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-O2 -pipe -march=barcelona"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/share/gnupg/qualified.txt"
CONFIG_PROTECT_MASK="/etc/ca-certificates.conf /etc/dconf /etc/env.d
/etc/fonts/fonts.conf /etc/gconf /etc/gentoo-release
/etc/revdep-rebuild /etc/sandbox.d /etc/terminfo"
CXXFLAGS="-O2 -pipe -march=barcelona"
DISTDIR="/usr/portage/distfiles"
ENV_UNSET="DBUS_SESSION_BUS_ADDRESS DISPLAY PERL5LIB PERL5OPT
PERLPREFIX PERL_CORE PERL_MB_OPT PERL_MM_OPT XAUTHORITY XDG_CACHE_HOME
XDG_CONFIG_HOME XDG_DATA_HOME XDG_RUNTIME_DIR"
FCFLAGS="-O2 -pipe"
FEATURES="assume-digests binpkg-logs ccache config-protect-if-modified
distlocks ebuild-locks fixlafiles merge-sync multilib-strict news
parallel-fetch preserve-libs protect-owned sandbox sfperms splitdebug
strict unknown-features-warn unmerge-logs unmerge-orphans userfetch
userpriv usersandbox usersync xattr"
FFLAGS="-O2 -pipe"
GENTOO_MIRRORS="http://gentoo.osuosl.org/";
LANG="en_US.utf8"
LDFLAGS="-Wl,-O1 -Wl,--as-needed"
MAKEOPTS="-j3"
PKGDIR="/usr/portage/packages"
PORTAGE_CONFIGROOT="/"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times
--omit-dir-times --compress --force --whole-file --delete --stats
--human-readable --timeout=180 --exclude=/distfiles --exclude=/local
--exclude=/packages --exclude=/.git"
PORTAGE_TMPDIR="/var/tmp"
USE="acl acpi alsa amd64 berkdb bzip2 cli colord crypt cxx dbus dri
dvd elogind firefox gdbm gnome gnome-keyring gnome-online-accounts gtk
gtk3 gtkstyle iconv introspection ipv6 libnotify libtirpc modules
multilib nautilus ncurses nls nptl openmp pam pcre policykit
pulseaudio readline seccomp ssl tcpd tracker unicode wxwidgets xattr
zlib" ABI_X86="64" ALSA_CARDS="ali5451 als4000 atiixp atiixp-modem
bt87x ca0106 cmipci emu10k1x ens1370 ens1371 es1938 es1968 fm801
hda-intel intel8x0 intel8x0m maestro3 trident usb-audio via82xx
via82xx-modem ymfpci" APACHE2_MODULES="authn_core authz_core
socache_shmcb unixd actions alias auth_basic authn_alias authn_anon
authn_dbm authn_default authn_file authz_dbm authz_default
authz_groupfile authz_host authz_owner authz_user autoindex cache cgi
cgid dav dav_fs dav_lock deflate dir disk_cache env expires ext_f

Re: GtkSelectionMode

2019-02-13 Thread Igor Korot via gtk-list
Hi, guys,

On Wed, Feb 13, 2019 at 3:21 PM richard boaz  wrote:
>
> sorry, typing too fast and missed the word *not*, should have read:
>
> so no functionality was *not* lost between 2 and 3

Unfortunately thats not how it looks here.
When I create a control with GTK_SELECTION_MULTIPLE and just click on
the item - it works just like single selection.
In order to select multiple strings I have to press Ctrl key.

Does it work for you?
Maybe some other code here prevents it to work like this?

Thank you.

>
> On Wed, Feb 13, 2019 at 4:20 PM richard boaz  wrote:
>>
>> i think you're getting confused:
>>
>> from the GTK-3 manual explaining how this option:
>>
>> GTK_SELECTION_MULTIPLE
>> Any number of elements may be selected. The Ctrl key may be used to enlarge 
>> the selection, and Shift key to select between the focus and the child 
>> pointed to. Some widgets may also allow Click-drag to select a range of 
>> elements.
>>
>> in other words, what you want (different ways to select multiple records) 
>> all happens with the single enum specifier GTK_SELECTION_MULTIPLE.  i can 
>> also confirm this is also how it works in GTK-2.
>>
>> so no functionality was lost between 2 and 3, and gtk also agrees with all 
>> those other platforms you cite (assuming you're referring to available 
>> functionality, as opposed to exactly how the enums are named... ;)
>>
>> the example you coded didn't work like this?
>>
>> richard
>>
>> On Wed, Feb 13, 2019 at 4:04 PM Igor Korot via gtk-list  
>> wrote:
>>>
>>> Hi,
>>>
>>> On Wed, Feb 13, 2019 at 1:00 PM LRN via gtk-list  wrote:
>>> >
>>> > On 13.02.2019 20:41, Igor Korot via gtk-list wrote:
>>> > > Hi, list,
>>> > > This link: 
>>> > > https://developer.gnome.org/gtk3/stable/gtk3-Standard-Enumerations.html#GtkSelectionMode
>>> > > has 4 modes for selection,
>>> > > while this link:
>>> > > https://developer.gnome.org/gtk2/stable/gtk2-Standard-Enumerations.html#GtkSelectionMode
>>> > > has 5.
>>> > >
>>> >
>>> > The code actually says:
>>> >
>>> > > /* list selection modes */
>>> > > typedef enum
>>> > > {
>>> > >   GTK_SELECTION_NONE, /* Nothing can be 
>>> > > selected */
>>> > >   GTK_SELECTION_SINGLE,
>>> > >   GTK_SELECTION_BROWSE,
>>> > >   GTK_SELECTION_MULTIPLE,
>>> > >   GTK_SELECTION_EXTENDED = GTK_SELECTION_MULTIPLE /* Deprecated */
>>> > > } GtkSelectionMode;
>>>
>>> I didn't look at the code. I just followed the documentation.
>>>
>>> >
>>> > So unless you dig up an old version of GTK2 (before that deprecation went 
>>> > into
>>> > effect), you can't know what EXTENDED selection actually meant. I looked 
>>> > at
>>> > gtk+-2.2 (!!!), and it also had that value deprecated. So this must be a
>>> > holdout from the GTK+-1.x era.
>>>
>>> OK.
>>>
>>> >
>>> > That doesn't mean that there isn't a case for extending (no pun intended)
>>> > current selection (no pun intended) of selection modes, but you'd have to
>>> > explain your idea a bit more thoroughly.
>>>
>>> Well, there are multiple scenarios.
>>> 1. Just clicking on the item.
>>> 2. Clicking on the item with the Ctrl key pressed
>>> 3. Clicking on the item with the Shift key pressed.
>>>
>>> I think that 1 should be defined as multi-select, while 2 and 3 should
>>> be defined as extended one.
>>>
>>> And from what I understand, MSW, OSX and Qt all agree with me. ;-)
>>>
>>> Thank you.
>>>
>>> >
>>> > ___
>>> > gtk-list mailing list
>>> > gtk-list@gnome.org
>>> > https://mail.gnome.org/mailman/listinfo/gtk-list
>>> ___
>>> gtk-list mailing list
>>> gtk-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkSelectionMode

2019-02-13 Thread Igor Korot via gtk-list
Hi,

On Wed, Feb 13, 2019 at 1:00 PM LRN via gtk-list  wrote:
>
> On 13.02.2019 20:41, Igor Korot via gtk-list wrote:
> > Hi, list,
> > This link: 
> > https://developer.gnome.org/gtk3/stable/gtk3-Standard-Enumerations.html#GtkSelectionMode
> > has 4 modes for selection,
> > while this link:
> > https://developer.gnome.org/gtk2/stable/gtk2-Standard-Enumerations.html#GtkSelectionMode
> > has 5.
> >
>
> The code actually says:
>
> > /* list selection modes */
> > typedef enum
> > {
> >   GTK_SELECTION_NONE, /* Nothing can be 
> > selected */
> >   GTK_SELECTION_SINGLE,
> >   GTK_SELECTION_BROWSE,
> >   GTK_SELECTION_MULTIPLE,
> >   GTK_SELECTION_EXTENDED = GTK_SELECTION_MULTIPLE /* Deprecated */
> > } GtkSelectionMode;

I didn't look at the code. I just followed the documentation.

>
> So unless you dig up an old version of GTK2 (before that deprecation went into
> effect), you can't know what EXTENDED selection actually meant. I looked at
> gtk+-2.2 (!!!), and it also had that value deprecated. So this must be a
> holdout from the GTK+-1.x era.

OK.

>
> That doesn't mean that there isn't a case for extending (no pun intended)
> current selection (no pun intended) of selection modes, but you'd have to
> explain your idea a bit more thoroughly.

Well, there are multiple scenarios.
1. Just clicking on the item.
2. Clicking on the item with the Ctrl key pressed
3. Clicking on the item with the Shift key pressed.

I think that 1 should be defined as multi-select, while 2 and 3 should
be defined as extended one.

And from what I understand, MSW, OSX and Qt all agree with me. ;-)

Thank you.

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


GtkSelectionMode

2019-02-13 Thread Igor Korot via gtk-list
Hi, list,
This link: 
https://developer.gnome.org/gtk3/stable/gtk3-Standard-Enumerations.html#GtkSelectionMode
has 4 modes for selection,
while this link:
https://developer.gnome.org/gtk2/stable/gtk2-Standard-Enumerations.html#GtkSelectionMode
has 5.

I understand that on GTK "selection multiple" and "selection extended"
are basically the same thing, hence removal of the "extended" style.
But maybe you are looking at it wrong - why not use the multiple selection
and use keyboard in addition?

Windows and OSX are doing it this way, which means it makes it hard to write
portable code with GTK{+}.

Is there a reason behind it?

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


GtkTextView and undo/redo

2018-11-28 Thread Igor Korot via gtk-list
Hi, ALL,
I'm surprised that there is no Undo/Redo functionality inside GtkTextView.
Or maybe I'm looking at the wrong class and Undo/Redo is in a different one?

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


Re: Fwd: How do I get the number

2018-10-09 Thread Igor Korot via gtk-list
Thank you.

On Tue, Oct 9, 2018 at 8:46 AM Miroslav Rajcic  wrote:
>
> Hi Igor,
>
> you actually need to fetch existing columns from the tree view one by one, 
> until you find a match, something like the code below.
>
> Regards,
>
>   Miroslav
>
> int current = 0;
>
> GtkTreeViewColumn *cur_column = gtk_tree_view_get_column (tree_view, current);
>
> while (cur_column != NULL) {
>
>if (clicked_column == cur_column) {
>
>break; //found it
>
>}
>
>current ++;
>
>  cur_column = gtk_tree_view_get_column (tree_view, current);
>
> }
>
> if (cur_column != NULL) {
>
>    // found the matching column, index stored in "current"
>
> }
>
> On 10/9/2018 3:00 AM, Igor Korot via gtk-list wrote:
>
> Hi, list,
>
> Does anybody know how do I get the information?
>
> Thank you.
>
>
> -- Forwarded message -
> From: Chris Moller 
> Date: Mon, Oct 8, 2018 at 8:02 PM
> Subject: Re: How do I get the number
> To: Igor Korot 
>
>
> To be honest, I'm not sure how GTK would do it.  Maybe the thing to do
> is write a bit of code and see what happens--I've never needed to to
> know the column number.
>
> On 08/10/2018 08:38, Igor Korot wrote:
>
> Hi, Chris,
> On Mon, Oct 8, 2018 at 7:28 PM Chris Moller  wrote:
>
> /
> |
> |-> disk1
> |
> |
> |---X---> folder1
> |> folder2
> |-> disk2
> |
> |> folder3
> |> folder4
> |> subdir
>   |
>   |> folder5
>   |> folder6
>
>
>
>
> From that, folder1 would have an indices value of [0, 0], folder2
> would be inidices[0, 1], folder3 [1,0], folder4 [1,1]
>
> So folder1 will have row 0, column 0?
>
> But that's wrong, because folder1 is at row 2 column 2.
>
> By extension, folder5 would be indices[1,2,0] and folder6 [1, 2, 1]
>
> And folder5 should be at row 8 column 3.
>
> And what is the coordinate be for disk1?
> It should be row 1, column 1, right?
>
> So as you can see I'm trying to get a value of the column number.
> On top of that I will need to get a column 1 if I click where the "X" is
> on the diagram...
>
> Thank you.
>
> On 08/10/2018 18:25, Igor Korot wrote:
>
> Ok.
> Now let's get back.
>
> Do you know how I can get the column from the screenshot I sent?
>
> On Mon, Oct 8, 2018, 5:04 PM Chris Moller  wrote:
>
> Sorry, I misunderstood you.
>
> Actually, my daughter speaks pretty good Russian--she was a
> competitive figure skater for a lot of years and both her principal
> coaches were Russian.   The preferred Russian over English so my
> daughter learned Russian.  Anyway, she translated the songs years ago
> just to practise.
>
> On 08/10/2018 17:15, Igor Korot wrote:
>
> On Mon, Oct 8, 2018 at 4:09 PM Chris Moller  wrote:
>
> The ones by the Soviet Army?  No.  They're from a recording made in
> London in about 1959.  Once upon a time, back in the 60s, I had an LP
> version that had some translations printed on the liner, but that LP
> vanished decades ago.  Other than Tipperary, Annie Laurie, and Oh no,
> John!, they're in Russian.
>
> I understand.
> And that's why I offer to translate them to English if you are interested.
>
> Thank you.
>
> On 08/10/2018 16:13, Igor Korot wrote:
>
> Chris,
>
> On Mon, Oct 8, 2018 at 3:08 PM Chris Moller  wrote:
>
> Here's a more complex tree, some of  of the files in my music
> collection.  (It's not exactly how GTK would show it, but close
> enough.)
>
> Do you want a translation for some those songs?
>
> ── misc
> │   ├── PiSymphony
> │   │   ├── Pi-and-e.ogg
> │   │   └── The-Circle.ogg
> │   └── SovietArmy
> │   ├── 01 - Song of Youth.mp3
> │   ├── 02 - A birch tree in a field did stand.mp3
> │   ├── 03 - Far Away.mp3
> │   ├── 04 - Song of the Volga Boatmen.mp3
> │   ├── 05 - You are always beautiful.mp3
> │   ├── 06 - Along Peter's Street.mp3
> │   ├── 07 - Tipperary (sung in English).mp3
> │   ├── 08 - Ah! Lovely Night.mp3
> │   ├── 09 - Kamarinskaya [instrumental].mp3
> │   ├── 10 - Annie Laurie (sung in English).mp3
> │   ├── 11 - Song of the Plains (Meadowland).mp3
> │   ├── 12 - Kalinka.mp3
> │   ├── 13 - Bandura (sung in Ukrainian).mp3
> │   ├── 14 - Oh no, John! (sung in English).mp3
> │   

Fwd: How do I get the number

2018-10-09 Thread Igor Korot via gtk-list
Hi, list,

Does anybody know how do I get the information?

Thank you.


-- Forwarded message -
From: Chris Moller 
Date: Mon, Oct 8, 2018 at 8:02 PM
Subject: Re: How do I get the number
To: Igor Korot 


To be honest, I'm not sure how GTK would do it.  Maybe the thing to do
is write a bit of code and see what happens--I've never needed to to
know the column number.

On 08/10/2018 08:38, Igor Korot wrote:

Hi, Chris,
On Mon, Oct 8, 2018 at 7:28 PM Chris Moller  wrote:

/
|
|-> disk1
|
|
|---X---> folder1
|> folder2
|-> disk2
|
|> folder3
|> folder4
|> subdir
  |
  |> folder5
  |> folder6




From that, folder1 would have an indices value of [0, 0], folder2
would be inidices[0, 1], folder3 [1,0], folder4 [1,1]

So folder1 will have row 0, column 0?

But that's wrong, because folder1 is at row 2 column 2.

By extension, folder5 would be indices[1,2,0] and folder6 [1, 2, 1]

And folder5 should be at row 8 column 3.

And what is the coordinate be for disk1?
It should be row 1, column 1, right?

So as you can see I'm trying to get a value of the column number.
On top of that I will need to get a column 1 if I click where the "X" is
on the diagram...

Thank you.

On 08/10/2018 18:25, Igor Korot wrote:

Ok.
Now let's get back.

Do you know how I can get the column from the screenshot I sent?

On Mon, Oct 8, 2018, 5:04 PM Chris Moller  wrote:

Sorry, I misunderstood you.

Actually, my daughter speaks pretty good Russian--she was a
competitive figure skater for a lot of years and both her principal
coaches were Russian.   The preferred Russian over English so my
daughter learned Russian.  Anyway, she translated the songs years ago
just to practise.

On 08/10/2018 17:15, Igor Korot wrote:

On Mon, Oct 8, 2018 at 4:09 PM Chris Moller  wrote:

The ones by the Soviet Army?  No.  They're from a recording made in
London in about 1959.  Once upon a time, back in the 60s, I had an LP
version that had some translations printed on the liner, but that LP
vanished decades ago.  Other than Tipperary, Annie Laurie, and Oh no,
John!, they're in Russian.

I understand.
And that's why I offer to translate them to English if you are interested.

Thank you.

On 08/10/2018 16:13, Igor Korot wrote:

Chris,

On Mon, Oct 8, 2018 at 3:08 PM Chris Moller  wrote:

Here's a more complex tree, some of  of the files in my music
collection.  (It's not exactly how GTK would show it, but close
enough.)

Do you want a translation for some those songs?

── misc
│   ├── PiSymphony
│   │   ├── Pi-and-e.ogg
│   │   └── The-Circle.ogg
│   └── SovietArmy
│   ├── 01 - Song of Youth.mp3
│   ├── 02 - A birch tree in a field did stand.mp3
│   ├── 03 - Far Away.mp3
│   ├── 04 - Song of the Volga Boatmen.mp3
│   ├── 05 - You are always beautiful.mp3
│   ├── 06 - Along Peter's Street.mp3
│   ├── 07 - Tipperary (sung in English).mp3
│   ├── 08 - Ah! Lovely Night.mp3
│   ├── 09 - Kamarinskaya [instrumental].mp3
│   ├── 10 - Annie Laurie (sung in English).mp3
│   ├── 11 - Song of the Plains (Meadowland).mp3
│   ├── 12 - Kalinka.mp3
│   ├── 13 - Bandura (sung in Ukrainian).mp3
│   ├── 14 - Oh no, John! (sung in English).mp3
│   ├── 15 - Snowflakes.mp3
│   ├── 16 - Ukrainian Poem.mp3
│   └── 17 - Soldiers' Chorus (from The Decembrists).mp3
└── synthesiser
├── Carlos
│   ├── Aurora_Borealis.ogg
│   ├── Midnight_Sun.ogg
│   └── SonicSeasonings.ogg
├── Hyman
│   ├── Evening_Thoughts.ogg
│   ├── Four_Duets_in_Odd_Meter.ogg
│   ├── Give_It_Up_or_Turn_It_Loose.ogg
│   ├── Improvisation_in_Fourths.ogg
│   ├── Kolumbo.ogg
│   ├── Tap_Dance_in_the_Memory_Banks.ogg
│   ├── The_Legend_of_Johnny_Pot.ogg
│   ├── The_Minotaur.ogg
│   ├── The_Moog_and_Me.ogg
│   ├── Time_Is_Tight.ogg
│   ├── Topless_Dancers_of_Corfu.ogg
│   └── Total_Bells_and_Tony.ogg
├── Kitaro
│   ├── Silk_Road_II.ogg
    │   └── Silk_Road_I.ogg
├── Tomita
│   ├── Compilation


On 08/10/2018 14:48, Igor Korot wrote:

On Mon, Oct 8, 2018 at 12:11 PM Chris Moller  wrote:

Hi, Igor,

The row-activated handler calls:

void
user_function (GtkTreeView   *tree_view,
   GtkTreePath   *path,
   GtkTreeViewColumn *column,
   gpointer   user_data)
{

}

so what you need is :

gint *indices =  gtk_tree_path_get_indices (path);

which will return an integer vector ow the row, column, sub-column,
subsub-column... depending on the topgraphy of your tree.  (You can
get the depth of the tree--thus the number of entries in the
vector--with:

gint len = gtk_tree_pa

Re: How do I get the number

2018-10-08 Thread Igor Korot via gtk-list
Hi, Chris,
On Mon, Oct 8, 2018 at 7:28 PM Chris Moller  wrote:
>
> /
> |
> |-> disk1
> |
> |
> |---X---> folder1
> |> folder2
> |-> disk2
> |
> |> folder3
> |> folder4
> |> subdir
>   |
>   |> folder5
>   |> folder6
>
>
>
>
> From that, folder1 would have an indices value of [0, 0], folder2 would be 
> inidices[0, 1], folder3 [1,0], folder4 [1,1]

So folder1 will have row 0, column 0?

But that's wrong, because folder1 is at row 2 column 2.

>
> By extension, folder5 would be indices[1,2,0] and folder6 [1, 2, 1]

And folder5 should be at row 8 column 3.

And what is the coordinate be for disk1?
It should be row 1, column 1, right?

So as you can see I'm trying to get a value of the column number.
On top of that I will need to get a column 1 if I click where the "X" is
on the diagram...

Thank you.

>
> On 08/10/2018 18:25, Igor Korot wrote:
>
> Ok.
> Now let's get back.
>
> Do you know how I can get the column from the screenshot I sent?
>
> On Mon, Oct 8, 2018, 5:04 PM Chris Moller  wrote:
>>
>> Sorry, I misunderstood you.
>>
>> Actually, my daughter speaks pretty good Russian--she was a competitive 
>> figure skater for a lot of years and both her principal coaches were 
>> Russian.   The preferred Russian over English so my daughter learned 
>> Russian.  Anyway, she translated the songs years ago just to practise.
>>
>> On 08/10/2018 17:15, Igor Korot wrote:
>>
>> On Mon, Oct 8, 2018 at 4:09 PM Chris Moller  wrote:
>>
>> The ones by the Soviet Army?  No.  They're from a recording made in London 
>> in about 1959.  Once upon a time, back in the 60s, I had an LP version that 
>> had some translations printed on the liner, but that LP vanished decades 
>> ago.  Other than Tipperary, Annie Laurie, and Oh no, John!, they're in 
>> Russian.
>>
>> I understand.
>> And that's why I offer to translate them to English if you are interested.
>>
>> Thank you.
>>
>> On 08/10/2018 16:13, Igor Korot wrote:
>>
>> Chris,
>>
>> On Mon, Oct 8, 2018 at 3:08 PM Chris Moller  wrote:
>>
>> Here's a more complex tree, some of  of the files in my music collection.  
>> (It's not exactly how GTK would show it, but close enough.)
>>
>> Do you want a translation for some those songs?
>>
>> ── misc
>> │   ├── PiSymphony
>> │   │   ├── Pi-and-e.ogg
>> │   │   └── The-Circle.ogg
>> │   └── SovietArmy
>> │   ├── 01 - Song of Youth.mp3
>> │   ├── 02 - A birch tree in a field did stand.mp3
>> │   ├── 03 - Far Away.mp3
>> │   ├── 04 - Song of the Volga Boatmen.mp3
>> │   ├── 05 - You are always beautiful.mp3
>> │   ├── 06 - Along Peter's Street.mp3
>> │   ├── 07 - Tipperary (sung in English).mp3
>> │   ├── 08 - Ah! Lovely Night.mp3
>> │   ├── 09 - Kamarinskaya [instrumental].mp3
>> │   ├── 10 - Annie Laurie (sung in English).mp3
>> │   ├── 11 - Song of the Plains (Meadowland).mp3
>> │   ├── 12 - Kalinka.mp3
>> │   ├── 13 - Bandura (sung in Ukrainian).mp3
>> │   ├── 14 - Oh no, John! (sung in English).mp3
>> │   ├── 15 - Snowflakes.mp3
>> │   ├── 16 - Ukrainian Poem.mp3
>> │   └── 17 - Soldiers' Chorus (from The Decembrists).mp3
>> └── synthesiser
>> ├── Carlos
>> │   ├── Aurora_Borealis.ogg
>> │   ├── Midnight_Sun.ogg
>> │   └── SonicSeasonings.ogg
>> ├── Hyman
>> │   ├── Evening_Thoughts.ogg
>> │   ├── Four_Duets_in_Odd_Meter.ogg
>> │   ├── Give_It_Up_or_Turn_It_Loose.ogg
>> │   ├── Improvisation_in_Fourths.ogg
>> │   ├── Kolumbo.ogg
>> │   ├── Tap_Dance_in_the_Memory_Banks.ogg
>> │   ├── The_Legend_of_Johnny_Pot.ogg
>> │   ├── The_Minotaur.ogg
>> │   ├── The_Moog_and_Me.ogg
>> │   ├── Time_Is_Tight.ogg
>> │   ├── Topless_Dancers_of_Corfu.ogg
>> │   └── Total_Bells_and_Tony.ogg
>> ├── Kitaro
>> │   ├── Silk_Road_II.ogg
>> │   └── Silk_Road_I.ogg
>> ├── Tomita
>> │   ├── Compilation
>>
>>
>> On 08/10/2018 14:48, Igor Korot wrote:
>>
>> On Mon, Oct 8, 2018 at 12:11 PM Chris Moller  wrote:
>>
>> Hi, Igor,
>>
>> The row-activated hand

Re: How do I get the number

2018-10-08 Thread Igor Korot via gtk-list
On Mon, Oct 8, 2018 at 12:11 PM Chris Moller  wrote:
>
> Hi, Igor,
>
> The row-activated handler calls:
>
> void
> user_function (GtkTreeView   *tree_view,
>GtkTreePath   *path,
>GtkTreeViewColumn *column,
>gpointer   user_data)
> {
>
> }
>
> so what you need is :
>
> gint *indices =  gtk_tree_path_get_indices (path);
>
> which will return an integer vector ow the row, column, sub-column, 
> subsub-column... depending on the topgraphy of your tree.  (You can get the 
> depth of the tree--thus the number of entries in the vector--with:
>
> gint len = gtk_tree_path_get_depth (path);
>
> )
>
> If it's a simple two-dimensional tree, the column number will be indices[1], 
> but you  might want to make sure that the tree depth is at least two before 
> doing that or you might be pointing past the end of the indices array.

BTW, what do you mean by saying: "simple 2-dimensional tree"?
Is there going to be n-dimensional tree? How it will be represented on
the screen? Do you have a screenshot?

Thank you.

>
> By the way, don't try to free the indices array--it points to a GTK internal 
> structure.
>
> HTH,
> Chris
>
>
>
> On 08/10/2018 12:52, Igor Korot wrote:
>
> Hi, Chris,
>
> On Sun, Oct 7, 2018 at 3:34 PM Chris Moller  wrote:
>
> Take a look at
>
> gint * gtk_tree_path_get_indices (GtkTreePath *path);
>
> with the  "GtkTreePath  *path"  parameter you get from the row-activated 
> callback.
>
> https://developer.gnome.org/gtk3/stable/GtkTreeModel.html#gtk-tree-path-get-indices
>
> I tried to do:
>
> int column = gtk_tree_path_get_indices( column );
>
> but got an error:
>
> Can't convert GtkTreeViewColumjn to GtkTreePath
>
> The "row-activated" callback is defined as:
>
> void user_function(GtkTreeView *tree_view, GtkTreePath *path,
> GtkTreeViewColumn *column, gpointer user_data);
>
> And so the types are unrelated.
>
> What am I doling wrong?
>
> Thank you.
>
>
>
>
> On 07/10/2018 20:04, Igor Korot via gtk-list wrote:
>
> Hi, ALL,
> For the GtkTreeView there is a "row-activated" signal:
> https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView-row-activated.
>
> That function receives as a parameter
>
> column the GtkTreeViewColumn in which the activation occurred.
>
> The problem is (at least as I see it) is that it is not a simple integer
> for the column number.
>
> Is there a simple way to get a column number on which I activated
> the row from this signal?
>
> Thank you.
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: How do I get the number

2018-10-07 Thread Igor Korot via gtk-list
Hi, Goran,
On Sun, Oct 7, 2018 at 4:02 PM Göran Hasse  wrote:
>
> Can this be any clue?

I looked at the code of DisplayTree.c, but there is no "row-activated"
signal anywhere.
And so unfortunately it is not helpful.

Sorry.

Thank you.

>
> /gh
>
> On 2018-10-08 02:04, Igor Korot via gtk-list wrote:
> > Hi, ALL,
> > For the GtkTreeView there is a "row-activated" signal:
> > https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView-row-activated.
> >
> > That function receives as a parameter
> >
> > column the GtkTreeViewColumn in which the activation occurred.
> >
> > The problem is (at least as I see it) is that it is not a simple integer
> > for the column number.
> >
> > Is there a simple way to get a column number on which I activated
> > the row from this signal?
> >
> > Thank you.
> > ___
> > gtk-list mailing list
> > gtk-list@gnome.org
> > https://mail.gnome.org/mailman/listinfo/gtk-list
> >
>
> --
> Göran Hasse
> email: gor...@raditex.nu
> Mobil: 070-5530148
> www: www.raditex.nu
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


How do I get the number

2018-10-07 Thread Igor Korot via gtk-list
Hi, ALL,
For the GtkTreeView there is a "row-activated" signal:
https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView-row-activated.

That function receives as a parameter

column the GtkTreeViewColumn in which the activation occurred.

The problem is (at least as I see it) is that it is not a simple integer
for the column number.

Is there a simple way to get a column number on which I activated
the row from this signal?

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


Re: Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread Igor Korot
James,

On Mon, May 7, 2018 at 4:46 PM, James Cameron  wrote:
> On Mon, May 07, 2018 at 04:27:57PM -0500, Igor Korot wrote:
>> Paul et al,
>> Any idea how to configure FVWM to not to give focus to xterm if one
>> specific window is displayed?
>
> You might ask on an fvwm mailing list, but fvwm does have a
> NeverFocus method that can be applied to an application such as xterm.

Yes, just subscribed to their forum and will ask that question.
>
> http://www.fvwm.org/documentation/manpages/fvwm.html
>
> But that would just fix your problem for xterm; to enforce focus for a
> lock screen, there's more to do.  Have a look at the code for other
> lock screens to find out what that is.

We do not provide any external application where the user can interact
with the keyboard/focus handling
in order to try and guess the information that should be secured.
Only the xterm is a concern.

>
> Briefly, make a global mouse and keyboard grab, subscribe to window
> visibility events, and when they occur raise the window above whatever
> was stacked on top of it.
>
> You could also adjust xterm sources to ask for focus skip; bit 0 of
> _WIN_HINTS property.

Before going those routes I will see what FVWM people have to say...

Thank you for the suggestions though.

>
>>
>> I tried:
>>
>> [code]
>> Key  Tab A M WindowList("!xterm")
>> [/code]
>>
>> but it doesn't work.
>>
>> Thank you.
>>
>>
>> On Mon, May 7, 2018 at 12:44 PM, Paul Davis  
>> wrote:
>> > the window manager can intervene to catch more or less any key combinations
>> > the user has told it to be interested in. if the user told it use Alt-Tab
>> > for focus switching, it will catch that. you can't stop it.
>> >
>> > On Mon, May 7, 2018 at 12:52 PM, Igor Korot  wrote:
>> >>
>> >> Hi, Paul,
>> >>
>> >> On Mon, May 7, 2018 at 11:42 AM, Paul Davis 
>> >> wrote:
>> >> > If there is a window manager (and there just about always is), you can't
>> >> > stop it from doing what it is configured to do. You're just an
>> >> > application,
>> >> > and it takes higher priority managing window events than you.
>> >>
>> >> Yes, we are using FVWM as WM.
>> >> I got a suggestion to write a function for this WM to stop the
>> >> Terminal to appear
>> >> when our Lock Screen is active, but here no one is familiar enough with
>> >> this WM
>> >> to write such a function.
>> >>
>> >> And I guess a different route is just not possible.
>> >>
>> >> And I would also guess that even if I put the "stay on top" flag,
>> >> pressing the ALT+TAB will
>> >> definitely switch the focus. Am I correct?
>> >>
>> >> Thank you.
>> >>
>> >> >
>> >> > On Mon, May 7, 2018 at 12:01 PM, Igor Korot  wrote:
>> >> >>
>> >> >>  Hi, ALL,
>> >> >> Is it possible to catch the ALT+TAB when one particular window is
>> >> >> displayed and do nothing, i.e. not switch to a different window?
>> >> >>
>> >> >> We have a program which displays a full sized window without the
>> >> >> title. Its role is to Lock screen" - user should not be able to do
>> >> >> anything until (s)he supplies password and hit the "Authenticate"
>> >> >> button.
>> >> >> problem is that t is possible to hit "ALT+TAB" and switch the focus to
>> >> >> the window below it (such as Terminal) and type something.
>> >> >>
>> >> >> We also can't use the lock screen window because of some other issues.
>> >> >>
>> >> >> So is it possible to catch ALT+TAB and do nothing for one specific
>> >> >> window?
>> >> >>
>> >> >> On the side note - is there a better list (with more traffic) where I
>> >> >> can post  question like this? Or this list is still good and
>> >> >> operational?
>> >> >>
>> >> >> Thank you.
>> >> >> ___
>> >> >> gtk-list mailing list
>> >> >> gtk-list@gnome.org
>> >> >> https://mail.gnome.org/mailman/listinfo/gtk-list
>> >> >
>> >> >
>> >
>> >
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
> --
> James Cameron
> http://quozl.netrek.org/
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread Igor Korot
Paul et al,
Any idea how to configure FVWM to not to give focus to xterm if one
specific window is displayed?

I tried:

[code]
Key  Tab A M WindowList("!xterm")
[/code]

but it doesn't work.

Thank you.


On Mon, May 7, 2018 at 12:44 PM, Paul Davis  wrote:
> the window manager can intervene to catch more or less any key combinations
> the user has told it to be interested in. if the user told it use Alt-Tab
> for focus switching, it will catch that. you can't stop it.
>
> On Mon, May 7, 2018 at 12:52 PM, Igor Korot  wrote:
>>
>> Hi, Paul,
>>
>> On Mon, May 7, 2018 at 11:42 AM, Paul Davis 
>> wrote:
>> > If there is a window manager (and there just about always is), you can't
>> > stop it from doing what it is configured to do. You're just an
>> > application,
>> > and it takes higher priority managing window events than you.
>>
>> Yes, we are using FVWM as WM.
>> I got a suggestion to write a function for this WM to stop the
>> Terminal to appear
>> when our Lock Screen is active, but here no one is familiar enough with
>> this WM
>> to write such a function.
>>
>> And I guess a different route is just not possible.
>>
>> And I would also guess that even if I put the "stay on top" flag,
>> pressing the ALT+TAB will
>> definitely switch the focus. Am I correct?
>>
>> Thank you.
>>
>> >
>> > On Mon, May 7, 2018 at 12:01 PM, Igor Korot  wrote:
>> >>
>> >>  Hi, ALL,
>> >> Is it possible to catch the ALT+TAB when one particular window is
>> >> displayed and do nothing, i.e. not switch to a different window?
>> >>
>> >> We have a program which displays a full sized window without the
>> >> title. Its role is to Lock screen" - user should not be able to do
>> >> anything until (s)he supplies password and hit the "Authenticate"
>> >> button.
>> >> problem is that t is possible to hit "ALT+TAB" and switch the focus to
>> >> the window below it (such as Terminal) and type something.
>> >>
>> >> We also can't use the lock screen window because of some other issues.
>> >>
>> >> So is it possible to catch ALT+TAB and do nothing for one specific
>> >> window?
>> >>
>> >> On the side note - is there a better list (with more traffic) where I
>> >> can post  question like this? Or this list is still good and
>> >> operational?
>> >>
>> >> Thank you.
>> >> ___
>> >> gtk-list mailing list
>> >> gtk-list@gnome.org
>> >> https://mail.gnome.org/mailman/listinfo/gtk-list
>> >
>> >
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread Igor Korot
Hi, Paul,

On Mon, May 7, 2018 at 11:42 AM, Paul Davis  wrote:
> If there is a window manager (and there just about always is), you can't
> stop it from doing what it is configured to do. You're just an application,
> and it takes higher priority managing window events than you.

Yes, we are using FVWM as WM.
I got a suggestion to write a function for this WM to stop the
Terminal to appear
when our Lock Screen is active, but here no one is familiar enough with this WM
to write such a function.

And I guess a different route is just not possible.

And I would also guess that even if I put the "stay on top" flag,
pressing the ALT+TAB will
definitely switch the focus. Am I correct?

Thank you.

>
> On Mon, May 7, 2018 at 12:01 PM, Igor Korot  wrote:
>>
>>  Hi, ALL,
>> Is it possible to catch the ALT+TAB when one particular window is
>> displayed and do nothing, i.e. not switch to a different window?
>>
>> We have a program which displays a full sized window without the
>> title. Its role is to Lock screen" - user should not be able to do
>> anything until (s)he supplies password and hit the "Authenticate"
>> button.
>> problem is that t is possible to hit "ALT+TAB" and switch the focus to
>> the window below it (such as Terminal) and type something.
>>
>> We also can't use the lock screen window because of some other issues.
>>
>> So is it possible to catch ALT+TAB and do nothing for one specific window?
>>
>> On the side note - is there a better list (with more traffic) where I
>> can post  question like this? Or this list is still good and
>> operational?
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Is it possible to catch ALT+TAB and do nothing

2018-05-07 Thread Igor Korot
 Hi, ALL,
Is it possible to catch the ALT+TAB when one particular window is
displayed and do nothing, i.e. not switch to a different window?

We have a program which displays a full sized window without the
title. Its role is to Lock screen" - user should not be able to do
anything until (s)he supplies password and hit the "Authenticate"
button.
problem is that t is possible to hit "ALT+TAB" and switch the focus to
the window below it (such as Terminal) and type something.

We also can't use the lock screen window because of some other issues.

So is it possible to catch ALT+TAB and do nothing for one specific window?

On the side note - is there a better list (with more traffic) where I
can post  question like this? Or this list is still good and
operational?

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


Re: Set number of visible items for

2018-03-12 Thread Igor Korot
Hi,

On Mon, Mar 12, 2018 at 11:06 AM  wrote:

> On 12.03.2018 15:39, Igor Korot wrote:
> > Hi,
> >
> > On Mon, Mar 12, 2018 at 7:20 AM, infirit . wrote:
> >>  G
> >
> > Does this suppose to mean something?
>
> Most likely a verbatim CC to the gtk list about setting the minimal number
> of
> items to be visible in a combobox dropdown list.
>

Is there a simple way to do that?

But in any case I think my question is a little different - I'm looking for
a way to
set the size of the dropdown, not a number of visible items.

Thank you.


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


Re: Set number of visible items for

2018-03-12 Thread Igor Korot
Hi,

On Mon, Mar 12, 2018 at 7:20 AM, infirit .  wrote:
> G

Does this suppose to mean something?

Thank you.

>
> Op 5 mrt. 2018 11:43 p.m. schreef "Igor Korot" :
>>
>>  Hi, ALL,
>> In Windows it is achievable thru
>>
>> https://msdn.microsoft.com/en-us/library/windows/desktop/bb775915(v=vs.85).aspx.
>>
>> In OSX/Cocoa - thru
>>
>> https://developer.apple.com/documentation/appkit/nscombobox/1436741-numberofvisibleitems.
>>
>> Is there a way to do that for GTK+ 2 and 3?
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Set number of visible items for GtkComboBox

2018-03-05 Thread Igor Korot
 Hi, ALL,
In Windows it is achievable thru
https://msdn.microsoft.com/en-us/library/windows/desktop/bb775915(v=vs.85).aspx.

In OSX/Cocoa - thru
https://developer.apple.com/documentation/appkit/nscombobox/1436741-numberofvisibleitems.

Is there a way to do that for GTK+ 2 and 3?

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


Documentation update request

2018-02-06 Thread Igor Korot
Hi, ALL,
Is there a reason why https://developer.gnome.org/gtk3/stable/GtkTreeView.html
 #GtkTreeView-select-cursor-row does not have an explanation
of what this signal does?

It is also missed from the GTK+2 documentation, so one can only guess.

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


Default behavior

2018-01-29 Thread Igor Korot
 Hi, ALL,
In GTK+ there is a function gtk_text_view_set_accepts_tab ().

However there is no indication as with many others - what is the
default behavior is
in the documentation. (ref.
https://developer.gnome.org/gtk3/stable/GtkTextView.html#gtk-text-view-set-accepts-tab).

So, if I don't call this function - what is the default?

Thank you.

P.S.: It would be nice if the documentation explicitly mention default behavior
of every GTK+ call, but I guess it is too much to ask. ;-)
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK4 documentation

2017-12-12 Thread Igor Korot
Emmanuele,

On Tue, Dec 12, 2017 at 4:46 PM, Emmanuele Bassi  wrote:
> On 12 December 2017 at 20:19, Igor Korot  wrote:
>> Hi, Emmanuelle,
>>
>> On Tue, Dec 12, 2017 at 1:29 PM, Emmanuele Bassi  wrote:
>>> On 12 December 2017 at 18:19, Igor Korot  wrote:
>>>>  Hi, ALL,
>>>> On the page https://developer.gnome.org/gtk4/stable/gtk4-General.html
>>>> in the "Description"
>>>> part in the sample code it is referencing the "gtk_init( &argc, &argv );".
>>>> However, if you look at the actual function -
>>>> https://developer.gnome.org/gtk4/stable/gtk4-General.html#gtk-init -
>>>> it is documented as "void gtk_init(void);", i.e. it does not take any
>>>> arguments.
>>>>
>>>> I am not sure which one is correct - just wanted to report this to you 
>>>> guys.
>>>
>>> The reference hasn't been updated, as we're still releasing developers
>>> snapshots and we're churning on the API. By the time 4.0 is released,
>>> the API reference will be updated.
>>
>> This probably means that you are aware of that, right?
>> However you decision is not that good - for people who will want to port 
>> early
>> at least.
>> I don't know if I'm the only one or not, but...
>
> Porting this early without actually talking to the GTK team, looking
> at the headers, compiler warnings, and at the toolkit code, is not
> entirely a good plan. We are heavily refactoring rendering, event
> handling, and soon layout. We're also documenting as we go along, but
> not everything is kept up to date, given the churn rate.

So when do you think you will have something usable?
And approximately, going from GTK3 to GTK4 will be a huge task?

Like I said - it looks like all those deprecated functions will be
removed in the GTK+4,
and therefore we will need to find a replacements or re-write that code.

>
>>>
>>>> Moreover, if the function is documented correctly, then there is no
>>>> way to pass command-line
>>>> arguments to the program. Or is there?
>>>
>>> First of all, the arguments vector you passed to gtk_init() were for
>>> GDK and GTK *only*, not for your application; gtk_init() has always
>>> removed the arguments it interpreted, and then gave the arguments
>>> vector back to you, to do with it as you pleased. Historically, you
>>> typically should have gotten the GOptionGroup from GDK and GTK, added
>>> it to your GOptionContext, and then parsed the arguments vector using
>>> g_option_context_parse().
>>
>> Does this mean this will be changed?
>> And I will have to rewrite this piece of code completely?
>
> I don't know what you'll have to change, because I don't know what you're 
> doing.
>
> You should *already* be using the GTK and GDK option groups with GTK+
> 2.x and 3.x, if you're using GOptionContext; it's definitely easier
> than calling gtk_init() to parse the arguments vector, and then
> calling g_option_context_parse() to parse the arguments vector again.
>
>>> In GTK+ 4.x, we removed the command line arguments for GDK and GTK, in
>>> favour of settings and environment variables — the same ones we
>>> already used, like DISPLAY, or G_DEBUG. This simplifies the
>>> initialisation process, and it ensures that your application is in
>>> charge of parsing the command line, not the library (or libraries) you
>>> happen to use.
>>>
>>
>> So there will be no more GOptionGroup/Context?
>
> That's a radical interpretation of what I wrote — in other words:
> that's not what I said.
>
> In GTK+ 4.0, the toolkit won't add any command line argument on top of
> the ones you have; the way you parse your own command line arguments
> is entirely your own.

Ok, yes, this simplifies things.
So command line arguments will not be changed - whatever I pass in
I will need to parse and that is all.

Thank you.

>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GTK4 documentation

2017-12-12 Thread Igor Korot
Hi, Emmanuelle,

On Tue, Dec 12, 2017 at 1:29 PM, Emmanuele Bassi  wrote:
> On 12 December 2017 at 18:19, Igor Korot  wrote:
>>  Hi, ALL,
>> On the page https://developer.gnome.org/gtk4/stable/gtk4-General.html
>> in the "Description"
>> part in the sample code it is referencing the "gtk_init( &argc, &argv );".
>> However, if you look at the actual function -
>> https://developer.gnome.org/gtk4/stable/gtk4-General.html#gtk-init -
>> it is documented as "void gtk_init(void);", i.e. it does not take any
>> arguments.
>>
>> I am not sure which one is correct - just wanted to report this to you guys.
>
> The reference hasn't been updated, as we're still releasing developers
> snapshots and we're churning on the API. By the time 4.0 is released,
> the API reference will be updated.

This probably means that you are aware of that, right?
However you decision is not that good - for people who will want to port early
at least.
I don't know if I'm the only one or not, but...

>
>> Moreover, if the function is documented correctly, then there is no
>> way to pass command-line
>> arguments to the program. Or is there?
>
> First of all, the arguments vector you passed to gtk_init() were for
> GDK and GTK *only*, not for your application; gtk_init() has always
> removed the arguments it interpreted, and then gave the arguments
> vector back to you, to do with it as you pleased. Historically, you
> typically should have gotten the GOptionGroup from GDK and GTK, added
> it to your GOptionContext, and then parsed the arguments vector using
> g_option_context_parse().

Does this mean this will be changed?
And I will have to rewrite this piece of code completely?

>
> In GTK+ 4.x, we removed the command line arguments for GDK and GTK, in
> favour of settings and environment variables — the same ones we
> already used, like DISPLAY, or G_DEBUG. This simplifies the
> initialisation process, and it ensures that your application is in
> charge of parsing the command line, not the library (or libraries) you
> happen to use.
>

So there will be no more GOptionGroup/Context?

Thank you.

> Finally, you should not be using gtk_init()/gtk_main() in newly
> written code even with GTK+ 3.x; use GtkApplication instead, as it's
> the preferred way to create an application with modern GTK.
>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


GTK4 documentation

2017-12-12 Thread Igor Korot
 Hi, ALL,
On the page https://developer.gnome.org/gtk4/stable/gtk4-General.html
in the "Description"
part in the sample code it is referencing the "gtk_init( &argc, &argv );".
However, if you look at the actual function -
https://developer.gnome.org/gtk4/stable/gtk4-General.html#gtk-init -
it is documented as "void gtk_init(void);", i.e. it does not take any
arguments.

I am not sure which one is correct - just wanted to report this to you guys.

Moreover, if the function is documented correctly, then there is no
way to pass command-line
arguments to the program. Or is there?

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


Re: Does webkitgtk issues discussed here?

2017-11-23 Thread Igor Korot
Hi, Jiri,

On Thu, Nov 23, 2017 at 10:16 AM, Jiří Janoušek  wrote:
> Hello Igor,
>
>> Does WebKitGTK has its own list?
>
> https://lists.webkit.org/mailman/listinfo/webkit-gtk

Thank you for mentioning and even bigger thanx to answering my questions here.

>
>> So here it is:
>> On the page https://webkitgtk.org/reference/webkitgtk/stable/index.html
>> there are
>> WebKitWebBackForwardList and WebKitWebHistoryItem classes which should
>> take care of the history support inside the WebView.
>>
>> However, on the page
>> https://webkitgtk.org/reference/webkit2gtk/stable/index.html
>> those classes are missing.
>>
>> The former link is for a version 2.4.5, the latter - 2.18.3.
>
> The difference is not in WebKitGTK version but in WebKit API version.
> The former documentation is for WebKitGTK (GTK+ port of WebKit 1 API,
> removed in WebKitGTK+ 2.6.0, that's why the doc comes from 2.4.5), the
> latter for WebKit2GTK (GTK+ port of WebKit 2 API, considered stable
> since WebKitGTK+ 2.0.0 and the only supported API nowadays).

OK.
I just mentioned the version since thats what I saw in the page at the top.
However you mentioned that the API was removed in the version 2.6.0.
Does this mean
those classes I mentioned are still available for the WebKitGtk below
version 2.6.0?
Or it is true for the 2.0.0+?

>
>> Are those 2 classes become deprecated? If so, which version deprecates them?
>
> WebKit1 is practically deprecated since WebKitGTK 2.0 and is no longer
> supported (no bug and security fixes).
>
>> I see on the second page there are WebKitBackForwardist and 
>> WebKitHistoryItem.
>> (no middle "Web"). Are they direct replacements?
>
> They seem to be the replacements, but not all methods from WebKit1
> have been ported.

Is there a plan to port them?

Thank you.

>
> Best regards,
>
> Jiri Janousek
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Does webkitgtk issues discussed here?

2017-11-22 Thread Igor Korot
 Hi,
Does WebKitGTK has its own list? Or I can ask here?

So here it is:
On the page https://webkitgtk.org/reference/webkitgtk/stable/index.html
there are
WebKitWebBackForwardList and WebKitWebHistoryItem classes which should
take care of the history support inside the WebView.

However, on the page
https://webkitgtk.org/reference/webkit2gtk/stable/index.html
those classes are missing.

The former link is for a version 2.4.5, the latter - 2.18.3.

Are those 2 classes become deprecated? If so, which version deprecates them?
I see on the second page there are WebKitBackForwardist and WebKitHistoryItem.
(no middle "Web"). Are they direct replacements?

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


Re: Feature suggest for GTK 4

2017-11-08 Thread Igor Korot
Hi,
In addition to Emmanuele response:

The retrocompatibility you ae talking about is fom Qt4 to Qt5. Its not
from Qt3 to Qt5.
So the GTK will be backward compatible with GTK3 to GTK4 not GTK2 to GTK4.

Thank you.


On Wed, Nov 8, 2017 at 8:24 AM, Emmanuele Bassi  wrote:
> Hi;
>
> you probably want to use gtk-devel-l...@gnome.org. Having said that:
>
> 2017-11-04 15:55 GMT+00:00 Natanael Barbosa Santos :
>> English: Add retrocompatibility with GTK 2.x or easy port like QT 4 to QT 5:
>
> Definitely not going to happen.
>
> A lot of API provided by GTK is defined at run time — properties,
> signals, even the object types. This means we cannot provide a
> compatibility layer like Qt does. Types would collide, properties
> would behave differently, signals would not be emitted.
>
> Additionally, a compatibility between GTK 2.x and 4.x is absolutely
> out of the question; at most, backward compatibility would extend to
> the latest stable release (GTK 3.22) not to the old stable release.
>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Boot error after install gtk-3-0

2017-10-22 Thread Igor Korot
Hi,

On Thu, Oct 19, 2017 at 11:26 AM, 윤진영  wrote:

> Dear gtk-list
>
>
> Hi, I'm Jin Young Youn.
>
> I have problems in installing gtk3.
>
> I want to install GXSM 3 for MK3-PLL.
>
> I'm using ubuntu 16.04.3 LTS.
>
> Because GXSM3 needs gtk3, I tried to install gtk3 following this guide.
>
> (Before my gtk3 version is 3.20.8 and I need 3.21.9 at least.)
>
>
> https://developer.gnome.org/gtk3/stable/gtk-building.html
>
> Compiling the GTK+ libraries: GTK+ 3 Reference Manual
> 
> developer.gnome.org
> Dependencies. Before you can compile the GTK+ widget toolkit, you need to
> have various other tools and libraries installed on your system.
>
> I have installed Glib2.52, pango, atk, gtk 3.22.4(use ./configure make
> make install ) also any other dependencies.
>
> But after installing, the version of gtk3 doesn't change.
>
> More serious is Computer can't boot after I tried reboot.
>
> Thanks you and please help me.
>

Why are you compiling by yourself and not installing from repository?
Moreover, it should not prevent you from booting.

What error did you get after reboot?

Thank you.


> ps.  I'm a beginner of linux. I can't attached any terminal message .
>
>
>
>
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Fwd: [Bug 788266] Adding Underline/Strikethrough selectors

2017-10-05 Thread Igor Korot
Hi,
I don't mind discussing this on the ML.


-- Forwarded message --
From: gtk+ 
Date: Thu, Oct 5, 2017 at 6:48 PM
Subject: [Bug 788266] Adding Underline/Strikethrough selectors
To: ikoro...@gmail.com


Comment # 15 on bug 788266 from Daniel Boles

(In reply to ikorot01 from comment #14)
> You refer me to the GTK API.
> It looks like the first comment from Mathias said "those properties have a
> different way of being selected".
> I'm still waiting for the application that allows user to select such font
> properties And to show how it's done.
> So in essence I believe Mathias failed me here.

>lol what. This isn't a help forum. It's for bug reports. You wanting code
> handed to you isn't a bug in GTK+. And no one replying here has any duty to
> you.

I don't want the code.
This feature request started as a request to add to checkboxes to the
FontChooser panel. Its not even a bug per se.



> Moreover, this is not about preview. In fact I don't card about preview In
> this case. I just want my user to be able to select those 2 properties the
> same way MS and Apple do.

>It's not about preview... so why did you file it against the FontChooser, which
>exists to preview fonts?

Then it shouldn't be called FontChooser, but rather FontPreviewer.
Wouldn't you agree?
In this case - yes, those 2 check boxes doesn't make much sense
and the programmer can easily add them to the panel either above as in
OSX or below as in Windows.

But as long as it calls itself FontChooser and its part of the font
selection dialog,
I believe those 2 checkboxes can be added.

>You keep invoking MS and Apple as though that's an automatic rhetorical
>victory, somehow... but they don't embed huge lists of fonts in their toolbars;
t>hey provide buttons to act on text spans - like you'll be able to do with the
>API mentioned by Emmanuele. Or they provide an enhanced font chooser widget,
>which you are very welcome to subclass and use as the chooser in your own
>application.

But why subclassing?
Why just not provide ready-to-go solution as OSX or provide them
as controls on one panel as in Windows?

>Basically, I think that in this case, you expect more comprehensive or
>high-level things from GTK+ than GTK+ is setting out to provide. That's fine;
>it can't be everything to everyone. But you can usually take the components and
>create what you want.

Well, of course I can. As a programmer in C/C++ I have a full and
complete power of what
my program will do. But this is not high-level thing
Unless of course this is not a FontChooser, but FontPreviewer.

>But in the absence of GTK+ already doing it for you, you expect people here to
>provide you code on a plate or Google for another rich text editor for you.
>That kind of thing might work on the mailing list or IRC, but it's not for
>here.

It's not me who started that flame.
Like I said - re-read what Mathias said in the first reply in the ticket:

[quote]
these are text attributes that should get applied to a selected range
of text, typically editors offer controls for that.
[/quote]

He doesn't say how they are doing it so that I can go and do that same
thing muyself.
Nor he provided an example of such application for me to check and
implement the same "HotKey"/Menu/ContextMenu/whatever.

I tried to do some research, but was immediately turned down.

To summarize: I'm not looking for a code solution - I can code that myself.
I also gather that there is no "standard" way of applying those
attributes to any standard GNOME text editor.

So I guess it is "expected" for a developer to code thise 2 checkboxes
with the "FontPreviewer" (not FontChooser")
control on a panel.

Thank you.




You are receiving this mail because:

You are on the CC list for the bug.
You reported the bug.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


GtkFileChooser show_hidden()

2017-10-03 Thread Igor Korot
Hi, ALL,
I am trying to implement show hidden files functionality for my program.

I have Gentoo Linux with GTK+2.24.29 and GTK+3.20.9.

On GTK+2 I had to connect to "map-event" and call
gtk_file_chooser_show_hidden(), because direct calling didn't work.

However, on GTK+3, it works fine.

Does anyone remember/know if there was a bug of that nature filed against GTK+2
and fixed?

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


Re: Font selection panel as part of notebook

2017-09-27 Thread Igor Korot
Eric,

On Sun, Sep 24, 2017 at 7:17 PM,   wrote:
>
> Igor,
>
> It sounds like you are determined to hack at this. I would recommend the
> newer GtkFontChooserWidget but OK. The PangoFcFamily* isn't much help. You
> need to get your widget pointers and setup up callbacks on your treeviews.
> Maybe all you need is to connect a "row-activated" to know if the user
> clicked on a row. To do this you need to find your pointers. If you use
> gtk_container_forall() you can find them. When doing this you are breaking
> the design of the font selection widget. It is poor practice. It might be
> just what you need though.

I did make it work with this sample.
The only thing I found - apparently GtkTreeView is also a GtkContainer().

Thank you.

>
> Eric
>
> /*
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-2.0`
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-3.0`
>Tested with GTK3.18 on Ubuntu16.04
> */
>
> #include
>
> static void find_widgets(GtkWidget* widget, gint *count)
>   {
> const char *name = gtk_widget_get_name(widget);
> printf("% *d. %s\n", (*count)*2, *count, name);
>
> //Recursive call for each container widget in the file chooser dialog.
> if(GTK_IS_CONTAINER(widget))
>   {
> (*count)++;
> gtk_container_foreach(GTK_CONTAINER(widget),
> (GtkCallback)find_widgets, count);
> (*count)--;
>   }
>
>   }
> int main(int argc, char *argv[])
>   {
> gtk_init (&argc, &argv);
>
> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
> GtkWidget *m_fontPanel=gtk_font_selection_new();
> G_GNUC_END_IGNORE_DEPRECATIONS
>
> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>
> gtk_widget_show_all(window);
>
> gint count=0;
> gtk_container_forall(GTK_CONTAINER(m_fontPanel),
> (GtkCallback)find_widgets, &count);
>
> gtk_main();
>
> return 0;
>   }
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-25 Thread Igor Korot
Eric,

On Sun, Sep 24, 2017 at 11:56 PM,   wrote:
>
>
> The code prints out the names of the widgets in the font selection widget.
> Using the names you can figure out the internal widget pointers you want to
> get from the selection widget. This might take a little trial and error to
> figure out. Maybe try, if it is a treeview, gtk_tree_view_set_grid_lines()
> so that you can distinguish the treeview that you have. Once you have the
> pointer you want, save it. Then try to set up your callback or get the value
> you need. It is messy but should work.

Ticket created: https://bugzilla.gnome.org/show_bug.cgi?id=788154

Thx.

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


Re: Font selection panel as part of notebook

2017-09-24 Thread Igor Korot
Erc,

On Sun, Sep 24, 2017 at 7:17 PM,   wrote:
>
> Igor,
>
> It sounds like you are determined to hack at this. I would recommend the
> newer GtkFontChooserWidget but OK. The PangoFcFamily* isn't much help. You
> need to get your widget pointers and setup up callbacks on your treeviews.
> Maybe all you need is to connect a "row-activated" to know if the user
> clicked on a row. To do this you need to find your pointers. If you use
> gtk_container_forall() you can find them. When doing this you are breaking
> the design of the font selection widget. It is poor practice. It might be
> just what you need though.

It is not "row-activated" that I need, as I can click on the already
selected row.
The "Apply" button should be enabled only if the changes are made.

So how do I modify the code below with the gtk_container_forall()?

Thank you.

>
> Eric
>
> /*
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-2.0`
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-3.0`
>Tested with GTK3.18 on Ubuntu16.04
> */
>
> #include
>
> static void find_widgets(GtkWidget* widget, gint *count)
>   {
> const char *name = gtk_widget_get_name(widget);
> printf("% *d. %s\n", (*count)*2, *count, name);
>
> //Recursive call for each container widget in the file chooser dialog.
> if(GTK_IS_CONTAINER(widget))
>   {
> (*count)++;
> gtk_container_foreach(GTK_CONTAINER(widget),
> (GtkCallback)find_widgets, count);
> (*count)--;
>   }
>
>   }
> int main(int argc, char *argv[])
>   {
> gtk_init (&argc, &argv);
>
> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
> GtkWidget *m_fontPanel=gtk_font_selection_new();
> G_GNUC_END_IGNORE_DEPRECATIONS
>
> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>
> gtk_widget_show_all(window);
>
> gint count=0;
> gtk_container_forall(GTK_CONTAINER(m_fontPanel),
> (GtkCallback)find_widgets, &count);
>
> gtk_main();
>
> return 0;
>   }
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-24 Thread Igor Korot
On Sun, Sep 24, 2017 at 10:54 PM,   wrote:
>
> A widget has encapsulated functionality that the designer of the widget does
> not expect you to use or see in your application code. Changing a "private"
> widget may have negative consequences for how the widget works. If a widget
> doesn't have the functionality that you need then file a feature request in
> bugzilla so that it can be implemented. Or, create your own widget.
>
> Is it illegal? No, and I would say it is something, as a developer, it is
> good to look at. You would want to look at the code of how the widget you
> are changing works to see if it is OK to do so. The font selection widget is
> deprecated so I don't think anymore changes are going to be made to it. A
> widget developer can change the private structure at any time which could
> break code that depends on a certain structure. Your code would be at risk
> of not working even across minor version changes in GTK. You are probably
> fairly safe that this widgets internal structure isn't going to change
> though. That isn't true for a lot of widgets.

OK, understood.

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


Re: Font selection panel as part of notebook

2017-09-24 Thread Igor Korot
Eric,
Why am I breaking the design?
Is it illegal to do?

Thank you.

On Sep 24, 2017 7:17 PM,  wrote:

>
> Igor,
>
> It sounds like you are determined to hack at this. I would recommend the
> newer GtkFontChooserWidget but OK. The PangoFcFamily* isn't much help. You
> need to get your widget pointers and setup up callbacks on your treeviews.
> Maybe all you need is to connect a "row-activated" to know if the user
> clicked on a row. To do this you need to find your pointers. If you use
> gtk_container_forall() you can find them. When doing this you are breaking
> the design of the font selection widget. It is poor practice. It might be
> just what you need though.
>
> Eric
>
> /*
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-2.0`
>gcc -Wall font_selection2.c -o font_selection2 `pkg-config --cflags
> --libs gtk+-3.0`
>Tested with GTK3.18 on Ubuntu16.04
> */
>
> #include
>
> static void find_widgets(GtkWidget* widget, gint *count)
>   {
> const char *name = gtk_widget_get_name(widget);
> printf("% *d. %s\n", (*count)*2, *count, name);
>
> //Recursive call for each container widget in the file chooser dialog.
> if(GTK_IS_CONTAINER(widget))
>   {
> (*count)++;
> gtk_container_foreach(GTK_CONTAINER(widget),
> (GtkCallback)find_widgets, count);
> (*count)--;
>   }
>
>   }
> int main(int argc, char *argv[])
>   {
> gtk_init (&argc, &argv);
>
> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
> GtkWidget *m_fontPanel=gtk_font_selection_new();
> G_GNUC_END_IGNORE_DEPRECATIONS
>
> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>
> gtk_widget_show_all(window);
>
> gint count=0;
> gtk_container_forall(GTK_CONTAINER(m_fontPanel),
> (GtkCallback)find_widgets, &count);
>
> gtk_main();
>
> return 0;
>   }
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-24 Thread Igor Korot
Eric,

On Sun, Sep 24, 2017 at 1:47 PM, Igor Korot  wrote:
> Eric,
>
> On Sun, Sep 24, 2017 at 1:51 AM, Igor Korot  wrote:
>> Eric,
>>
>> On Sun, Sep 24, 2017 at 12:33 AM,   wrote:
>>>
>>> When I test it out it looks like the font selection widget doesn't work very
>>> well in GTK3.
>>>
>>> Not quite sure how you have it setup for GTK2 and what information you are
>>> using to activate the apply button. The GValue that I get returned is a
>>> PangoFcFamily*. I don't think this will help unless you pull in private data
>>> from Pango. You don't like "The quick brown fox..."?
>>
>> This is what I see on the Terminal:
>>
>> igor@IgorDellGentoo ~ $ ./fontsel
>> Cursor Changed
>> 43
>> ((PangoFcFamily*) 0xba5a40)
>> Cursor Changed
>> 43
>> ((PangoFcFamily*) 0xba5a40)
>> Cursor Changed
>> 43
>> ((PangoFcFamily*) 0xba5a40)
>> Cursor Changed
>> 43
>> ((PangoFcFamily*) 0xba5a40)
>> Cursor Changed
>> 44
>> ((PangoFcFamily*) 0xba5a80)
>>
>> It initially selects "Sans" and then I select "Serif".
>>
>> I'm testing with GTK+2.24 on Gentoo Linux.
>
> I was calling "g_value_get_string( &value )" and this function failed.
> That's why I did see
> an empty string.
>
> I didn't look at the GTK+ sources but it looks like the value
> retrieved is just an address
> of the string and not the string itself.
>
> I do have a workaround. I didn't test it yet, but I'd prefer to get
> this info this way.
>
> Is there anything else?

I think I will just create a generic tab that will mimic the behaviour.
The reason being - I don't have access to the "Style" list box.

Now the only thing left is find what styles are available for a specific
font name? Is this info available on the PangoFont?

Thank you.

>
> Thank you.
>
>>
>> Thank you.
>>
>>>
>>> Eric
>>>
>>> /*
>>>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
>>> --libs gtk+-3.0`
>>>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
>>> --libs gtk+-2.0`
>>>Tested with GTK3.18 on Ubuntu16.04
>>> */
>>>
>>> #include
>>>
>>> static void font_name_change(GtkTreeView *view, gpointer user_data)
>>>   {
>>> g_print("Cursor Changed\n");
>>> GtkTreeIter iter;
>>> GValue value=G_VALUE_INIT;
>>> GList *selRows = NULL;
>>> GtkTreeSelection *sel = gtk_tree_view_get_selection( view );
>>> GtkTreeModel *model = gtk_tree_view_get_model( view );
>>> selRows = gtk_tree_selection_get_selected_rows( sel, &model );
>>> if(selRows!=NULL)
>>>   {
>>> gchar *string1=gtk_tree_path_to_string((GtkTreePath
>>> *)selRows[0].data);
>>> g_print("%s\n", string1);
>>> g_free(string1);
>>> if(gtk_tree_model_get_iter( model, &iter, (GtkTreePath
>>> *)selRows[0].data ))
>>>   {
>>> gtk_tree_model_get_value( model, &iter, 0, &value );
>>> gchar *string2=g_strdup_value_contents(&value);
>>> g_print("%s\n", string2);
>>> g_free(string2);
>>>   }
>>> else
>>>   {
>>> g_print("Need a valid iter.\n");
>>>   }
>>>   }
>>>else
>>>   {
>>> g_print("No list.\n");
>>>   }
>>>
>>>g_list_free_full(selRows, (GDestroyNotify) gtk_tree_path_free);
>>>
>>>   }
>>> int main(int argc, char *argv[])
>>>   {
>>> gtk_init (&argc, &argv);
>>>
>>> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
>>> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
>>> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
>>> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
>>> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>>>
>>> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
>>> GtkWidget *m_fontPanel=gtk_font_selection_new();
>>> GtkWidget *names = gtk_font_selection_get_family_list((GtkFontSelection
>>> *) m_fontPanel );
>>> //For GTK3.
>>> gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(names), TRUE);
>>> //GtkWidget *sizes = gtk_font_selection_get_size_entry((GtkFontSelection
>>> *) m_fontPanel );
>>> g_signal_connect( names, "cursor-changed", G_CALLBACK(font_name_change),
>>> NULL );
>>> G_GNUC_END_IGNORE_DEPRECATIONS
>>>
>>> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>>>
>>> gtk_widget_show_all(window);
>>>
>>> gtk_main();
>>>
>>> return 0;
>>>   }
>>>
>>>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-24 Thread Igor Korot
Eric,

On Sun, Sep 24, 2017 at 1:51 AM, Igor Korot  wrote:
> Eric,
>
> On Sun, Sep 24, 2017 at 12:33 AM,   wrote:
>>
>> When I test it out it looks like the font selection widget doesn't work very
>> well in GTK3.
>>
>> Not quite sure how you have it setup for GTK2 and what information you are
>> using to activate the apply button. The GValue that I get returned is a
>> PangoFcFamily*. I don't think this will help unless you pull in private data
>> from Pango. You don't like "The quick brown fox..."?
>
> This is what I see on the Terminal:
>
> igor@IgorDellGentoo ~ $ ./fontsel
> Cursor Changed
> 43
> ((PangoFcFamily*) 0xba5a40)
> Cursor Changed
> 43
> ((PangoFcFamily*) 0xba5a40)
> Cursor Changed
> 43
> ((PangoFcFamily*) 0xba5a40)
> Cursor Changed
> 43
> ((PangoFcFamily*) 0xba5a40)
> Cursor Changed
> 44
> ((PangoFcFamily*) 0xba5a80)
>
> It initially selects "Sans" and then I select "Serif".
>
> I'm testing with GTK+2.24 on Gentoo Linux.

I was calling "g_value_get_string( &value )" and this function failed.
That's why I did see
an empty string.

I didn't look at the GTK+ sources but it looks like the value
retrieved is just an address
of the string and not the string itself.

I do have a workaround. I didn't test it yet, but I'd prefer to get
this info this way.

Is there anything else?

Thank you.

>
> Thank you.
>
>>
>> Eric
>>
>> /*
>>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
>> --libs gtk+-3.0`
>>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
>> --libs gtk+-2.0`
>>Tested with GTK3.18 on Ubuntu16.04
>> */
>>
>> #include
>>
>> static void font_name_change(GtkTreeView *view, gpointer user_data)
>>   {
>> g_print("Cursor Changed\n");
>> GtkTreeIter iter;
>> GValue value=G_VALUE_INIT;
>> GList *selRows = NULL;
>> GtkTreeSelection *sel = gtk_tree_view_get_selection( view );
>> GtkTreeModel *model = gtk_tree_view_get_model( view );
>> selRows = gtk_tree_selection_get_selected_rows( sel, &model );
>> if(selRows!=NULL)
>>   {
>> gchar *string1=gtk_tree_path_to_string((GtkTreePath
>> *)selRows[0].data);
>> g_print("%s\n", string1);
>> g_free(string1);
>> if(gtk_tree_model_get_iter( model, &iter, (GtkTreePath
>> *)selRows[0].data ))
>>   {
>> gtk_tree_model_get_value( model, &iter, 0, &value );
>> gchar *string2=g_strdup_value_contents(&value);
>> g_print("%s\n", string2);
>> g_free(string2);
>>   }
>> else
>>   {
>> g_print("Need a valid iter.\n");
>>   }
>>   }
>>else
>>   {
>> g_print("No list.\n");
>>   }
>>
>>g_list_free_full(selRows, (GDestroyNotify) gtk_tree_path_free);
>>
>>   }
>> int main(int argc, char *argv[])
>>   {
>> gtk_init (&argc, &argv);
>>
>> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
>> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
>> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
>> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
>> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>>
>> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
>> GtkWidget *m_fontPanel=gtk_font_selection_new();
>> GtkWidget *names = gtk_font_selection_get_family_list((GtkFontSelection
>> *) m_fontPanel );
>> //For GTK3.
>> gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(names), TRUE);
>> //GtkWidget *sizes = gtk_font_selection_get_size_entry((GtkFontSelection
>> *) m_fontPanel );
>> g_signal_connect( names, "cursor-changed", G_CALLBACK(font_name_change),
>> NULL );
>> G_GNUC_END_IGNORE_DEPRECATIONS
>>
>> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>>
>> gtk_widget_show_all(window);
>>
>> gtk_main();
>>
>> return 0;
>>   }
>>
>>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-23 Thread Igor Korot
Eric,

On Sun, Sep 24, 2017 at 12:33 AM,   wrote:
>
> When I test it out it looks like the font selection widget doesn't work very
> well in GTK3.
>
> Not quite sure how you have it setup for GTK2 and what information you are
> using to activate the apply button. The GValue that I get returned is a
> PangoFcFamily*. I don't think this will help unless you pull in private data
> from Pango. You don't like "The quick brown fox..."?

This is what I see on the Terminal:

igor@IgorDellGentoo ~ $ ./fontsel
Cursor Changed
43
((PangoFcFamily*) 0xba5a40)
Cursor Changed
43
((PangoFcFamily*) 0xba5a40)
Cursor Changed
43
((PangoFcFamily*) 0xba5a40)
Cursor Changed
43
((PangoFcFamily*) 0xba5a40)
Cursor Changed
44
((PangoFcFamily*) 0xba5a80)

It initially selects "Sans" and then I select "Serif".

I'm testing with GTK+2.24 on Gentoo Linux.

Thank you.

>
> Eric
>
> /*
>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
> --libs gtk+-3.0`
>gcc -Wall font_selection1.c -o font_selection1 `pkg-config --cflags
> --libs gtk+-2.0`
>Tested with GTK3.18 on Ubuntu16.04
> */
>
> #include
>
> static void font_name_change(GtkTreeView *view, gpointer user_data)
>   {
> g_print("Cursor Changed\n");
> GtkTreeIter iter;
> GValue value=G_VALUE_INIT;
> GList *selRows = NULL;
> GtkTreeSelection *sel = gtk_tree_view_get_selection( view );
> GtkTreeModel *model = gtk_tree_view_get_model( view );
> selRows = gtk_tree_selection_get_selected_rows( sel, &model );
> if(selRows!=NULL)
>   {
> gchar *string1=gtk_tree_path_to_string((GtkTreePath
> *)selRows[0].data);
> g_print("%s\n", string1);
> g_free(string1);
> if(gtk_tree_model_get_iter( model, &iter, (GtkTreePath
> *)selRows[0].data ))
>   {
> gtk_tree_model_get_value( model, &iter, 0, &value );
> gchar *string2=g_strdup_value_contents(&value);
> g_print("%s\n", string2);
> g_free(string2);
>   }
> else
>   {
> g_print("Need a valid iter.\n");
>   }
>   }
>else
>   {
> g_print("No list.\n");
>   }
>
>g_list_free_full(selRows, (GDestroyNotify) gtk_tree_path_free);
>
>   }
> int main(int argc, char *argv[])
>   {
> gtk_init (&argc, &argv);
>
> GtkWidget *window=gtk_window_new (GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Font Selecton");
> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> G_GNUC_BEGIN_IGNORE_DEPRECATIONS
> GtkWidget *m_fontPanel=gtk_font_selection_new();
> GtkWidget *names = gtk_font_selection_get_family_list((GtkFontSelection
> *) m_fontPanel );
> //For GTK3.
> gtk_tree_view_set_activate_on_single_click(GTK_TREE_VIEW(names), TRUE);
> //GtkWidget *sizes = gtk_font_selection_get_size_entry((GtkFontSelection
> *) m_fontPanel );
> g_signal_connect( names, "cursor-changed", G_CALLBACK(font_name_change),
> NULL );
> G_GNUC_END_IGNORE_DEPRECATIONS
>
> gtk_container_add(GTK_CONTAINER(window), m_fontPanel);
>
> gtk_widget_show_all(window);
>
> gtk_main();
>
> return 0;
>   }
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-23 Thread Igor Korot
Eric,

On Sat, Sep 23, 2017 at 2:58 PM,   wrote:
>
>
> Hi Igor,
>
> Initialize the GValue structure and see if that does the trick for getting
> the value.
>
> GValue value=G_VALUE_INIT;

I initialied it with:

g_value_init( &value, G_TYPE_STRING );

but it didn't help.

>
> https://developer.gnome.org/gobject/stable/gobject-Generic-values.html#G-VALUE-INIT:CAPS
>
> If that doesn't work, check the return value of gtk_tree_model_get_iter() to
> make sure that your iter is good.

the function returns TRUE and so the iter is good.

Thank you.

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


Fwd: Font selection panel as part of notebook

2017-09-23 Thread Igor Korot
Sorry, this was sent privately and not to the list.


-- Forwarded message --
From: Igor Korot 
Date: Sat, Sep 23, 2017 at 5:40 PM
Subject: Re: Font selection panel as part of notebook
To: cecas...@aol.com


Hi Eric,
What about my first question?

Thank you.


On Sep 23, 2017 2:58 PM,  wrote:
>
>
>
> Hi Igor,
>
> Initialize the GValue structure and see if that does the trick for getting 
> the value.
>
> GValue value=G_VALUE_INIT;
>
> https://developer.gnome.org/gobject/stable/gobject-Generic-values.html#G-VALUE-INIT:CAPS
>
> If that doesn't work, check the return value of gtk_tree_model_get_iter() to 
> make sure that your iter is good.
>
> Eric
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel as part of notebook

2017-09-23 Thread Igor Korot
Eric,

On Sat, Sep 23, 2017 at 2:58 PM,   wrote:
>
>
> Hi Igor,
>
> Initialize the GValue structure and see if that does the trick for getting
> the value.
>
> GValue value=G_VALUE_INIT;
>
> https://developer.gnome.org/gobject/stable/gobject-Generic-values.html#G-VALUE-INIT:CAPS

It looks like G_VALUE_INT is available since 2.30.
What should I use for earlier version?

Thank you.

>
> If that doesn't work, check the return value of gtk_tree_model_get_iter() to
> make sure that your iter is good.
>
> Eric
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Font selection panel as part of notebook

2017-09-23 Thread Igor Korot
Hi, ALL,
I'm trying to implement a font selection as part of the notebook/wizard control.

1. In the GTK+2 I can write following:

GtkWidget *names = gtk_font_selection_get_family_list(
(GtkFontSelection *) m_fontPanel );
GtkWidget *sizes = gtk_font_selection_get_size_entry(
(GtkFontSelection *) m_fontPanel );
g_signal_connect( names, "cursor-changed", G_CALLBACK(
font_name_change ), this );

And then in the handler I am enabling the "Apply" button.

However in GTK+3 there is no gtk_font_selection_get_family_list() call
according to the docs. Is it possible to implement something like this
for GTK+3?

2. In the handler I wrote the following code:

GtkTreeIter iter;
GValue value;
GtkTreeSelection *sel = gtk_tree_view_get_selection( view );
GtkTreeModel *model = gtk_tree_view_get_model( view );
GList *selRows = gtk_tree_selection_get_selected_rows( sel, &model );
gtk_tree_model_get_iter( model, &iter, (GtkTreePath *)
selRows[0].data );
gtk_tree_model_get_value( model, &iter, 0, &value );

However it looks like the value is empty.

What am I missing?

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


Re: Past and future evolution of Gtk+

2017-09-18 Thread Igor Korot
Sorry, wrong message.

On Mon, Sep 18, 2017 at 11:04 AM, Carsten Mattner
 wrote:
> On 9/18/17, Igor Korot  wrote:
>> On Mon, Sep 18, 2017 at 10:53 AM, Carsten Mattner
>>  wrote:
>>> Thanks Igor for the wxWidgets clarification.
>>
>> NP.
>> After 7 years working with the library, submitting patches to it and
>> doing development with it I guess I'm "overqualified" to work with it. ;-)
>>
>> So, does the position requires wx knowledge?
>
> What position? I'm confused.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Past and future evolution of Gtk+

2017-09-18 Thread Igor Korot
On Mon, Sep 18, 2017 at 10:53 AM, Carsten Mattner
 wrote:
> Thanks Igor for the wxWidgets clarification.

NP.
After 7 years working with the library, submitting patches to it and
doing development with it I guess I'm "overqualified" to work with it. ;-)

So, does the position requires wx knowledge?

Thx.

>
> On 9/18/17, Igor Korot  wrote:
>> On Mon, Sep 18, 2017 at 9:39 AM, Carsten Mattner
>>  wrote:
>>> On 9/18/17, Ian Chapman  wrote:
>>>> This is not a troll, only a trawler as in fishing boat. I found the
>>>> discourse on “traditional file chooser” quite interesting and
>>>> informative. I'm using glade 3.18.3 and I'm able to do useful work so
>>>> possibly I'm off subject.
>>>>
>>>> Point 1
>>>>
>>>> In glade I can select GtkMenuItem and GtkImageMenuItem and when I look
>>>> at the GTK+ 3 Reference Manual the latter is depreciated. It's working
>>>> great so I wonder what depreciated actually implies? At some time in the
>>>> future will it vanish and working software will fail or simply fail to
>>>> compile on the newer distribution?
>>>
>>> That's how I interpret it. Case in point Raleigh theme which was never,
>>> from what I can tell, intended to be a replacement for the Gtk2 Raleigh
>>> theme. It didn't look right and now it just looks completely broken.
>>> If something is supposed to be removed, there's no need to make 3.x
>>> seem like it supports it and remove it in 4.x, when the version in 3.x
>>> isn't supported and working by sheer luck. This is what I read from the
>>> info I can gather and not meant to be an attack. I'm just trying to
>>> stitch
>>> together a picture.
>>>
>>>> Point 2
>>>>
>>>> Lots of acronyms were mentioned. Qt was one and it's in the LMDE
>>>> repositories. Wiki has a long list of GUIs in
>>>> “https://en.wikipedia.org/wiki/List_of_widget_toolkits” but only a few
>>>> could be of interest. In any case there would be a learning curve to use
>>>> any them and maybe no glade which greatly simplifies Gtk for me. Is
>>>> there an evaluation on these alternative GUIs?
>>>
>>> With all due respect and apologies to the list admins, allow me to
>>> answer this here although it's kinda advertising for "competitors".
>>>
>>> Ian, Qt and FLTK have GUI builders and FLTK generates code, not markup.
>>> Qt is used heavily with the declarative variant QML in entertainment
>>> systems of cars and such. If QML is something that works for you
>>> and the licensing is compatible, then consider a lunch break checking
>>> it out.
>>> If you're writing engineering software that doesn't have requirement
>>> that mandate Qt or Gtk, then FLTK or IUP have been used successfully
>>> in that domain.
>>>
>>> Qt has Haskell bindings (Qtah).
>>> wxWidgets has Gtk2, Gtk3, Qt5 backends and bindings pretty much
>>> everywhere, but there's no GUI builder I know of.
>>
>> wxWidgets does have GUI builders - wxGlade, wxFormBuilder, wxCrafter to
>> name a few.
>> It also works on both MS Windows and OSX without any issues.
>>
>> If you requirements are to have a "native look and feel" of the software
>> then wxWidgets is the way to go.
>>
>> The license is free for both O/S and commercial applications.
>>
>> It has bindings for all popular languages - Python, Perl, Ruby.
>>
>> On Linux GTK is the most developed and most mature port.
>> wxQt is relatively new and wxX11 (so called Universal) is not actively
>> developed. wxMotiff is really outdated and will be removed in future
>> versions.
>>
>> Thank you.
>>
>>> FLTK has a GUI builder and the Haskell bindings also generate
>>> Haskell code when using the GUI builder. Just in case you had
>>> interest in a different language.
>>> IUP is plain C and has been used in many brazilian industrial
>>> applications. Check the screenshots section.
>>> ___
>>> gtk-list mailing list
>>> gtk-list@gnome.org
>>> https://mail.gnome.org/mailman/listinfo/gtk-list
>>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Past and future evolution of Gtk+

2017-09-18 Thread Igor Korot
On Mon, Sep 18, 2017 at 9:39 AM, Carsten Mattner
 wrote:
> On 9/18/17, Ian Chapman  wrote:
>> This is not a troll, only a trawler as in fishing boat. I found the
>> discourse on “traditional file chooser” quite interesting and
>> informative. I'm using glade 3.18.3 and I'm able to do useful work so
>> possibly I'm off subject.
>>
>> Point 1
>>
>> In glade I can select GtkMenuItem and GtkImageMenuItem and when I look
>> at the GTK+ 3 Reference Manual the latter is depreciated. It's working
>> great so I wonder what depreciated actually implies? At some time in the
>> future will it vanish and working software will fail or simply fail to
>> compile on the newer distribution?
>
> That's how I interpret it. Case in point Raleigh theme which was never,
> from what I can tell, intended to be a replacement for the Gtk2 Raleigh
> theme. It didn't look right and now it just looks completely broken.
> If something is supposed to be removed, there's no need to make 3.x
> seem like it supports it and remove it in 4.x, when the version in 3.x
> isn't supported and working by sheer luck. This is what I read from the
> info I can gather and not meant to be an attack. I'm just trying to stitch
> together a picture.
>
>> Point 2
>>
>> Lots of acronyms were mentioned. Qt was one and it's in the LMDE
>> repositories. Wiki has a long list of GUIs in
>> “https://en.wikipedia.org/wiki/List_of_widget_toolkits” but only a few
>> could be of interest. In any case there would be a learning curve to use
>> any them and maybe no glade which greatly simplifies Gtk for me. Is
>> there an evaluation on these alternative GUIs?
>
> With all due respect and apologies to the list admins, allow me to
> answer this here although it's kinda advertising for "competitors".
>
> Ian, Qt and FLTK have GUI builders and FLTK generates code, not markup.
> Qt is used heavily with the declarative variant QML in entertainment
> systems of cars and such. If QML is something that works for you
> and the licensing is compatible, then consider a lunch break checking
> it out.
> If you're writing engineering software that doesn't have requirement
> that mandate Qt or Gtk, then FLTK or IUP have been used successfully
> in that domain.
>
> Qt has Haskell bindings (Qtah).
> wxWidgets has Gtk2, Gtk3, Qt5 backends and bindings pretty much
> everywhere, but there's no GUI builder I know of.

wxWidgets does have GUI builders - wxGlade, wxFormBuilder, wxCrafter to
name a few.
It also works on both MS Windows and OSX without any issues.

If you requirements are to have a "native look and feel" of the software
then wxWidgets is the way to go.

The license is free for both O/S and commercial applications.

It has bindings for all popular languages - Python, Perl, Ruby.

On Linux GTK is the most developed and most mature port.
wxQt is relatively new and wxX11 (so called Universal) is not actively
developed. wxMotiff is really outdated and will be removed in future versions.

Thank you.

> FLTK has a GUI builder and the Haskell bindings also generate
> Haskell code when using the GUI builder. Just in case you had
> interest in a different language.
> IUP is plain C and has been used in many brazilian industrial
> applications. Check the screenshots section.
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Setting pango attributes

2017-09-01 Thread Igor Korot
Emmanuelle,

On Fri, Sep 1, 2017 at 6:37 PM, Emmanuele Bassi  wrote:
> On 1 September 2017 at 21:20, Igor Korot  wrote:
>>  Hi, ALL,.
>> There is a GtkFontChooserDialog class which enable a user to do a font
>> selection.
>>
>> However, this dialog does not allow to select some pango attributes - notably
>> strikethrough and underline.
>>
>> Is there a way to have some kind of a GUI controls to select them?
>> If not - why they are not present in the dialog itself?
>
> Because that's not what a font selection dialog does?

So I should just add 2 checkboxes to my panel to make them selectable?

>
> The bold and italic font faces you see are different font weights
> inside a family, not Pango attributes being set.

I was actually asking about underline/strikethrough not bold/italic.

Thank you.

>
> Ciao,
>  Emmanuele.
>
> --
> https://www.bassi.io
> [@] ebassi [@gmail.com]
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Setting pango attributes

2017-09-01 Thread Igor Korot
 Hi, ALL,.
There is a GtkFontChooserDialog class which enable a user to do a font
selection.

However, this dialog does not allow to select some pango attributes - notably
strikethrough and underline.

Is there a way to have some kind of a GUI controls to select them?
If not - why they are not present in the dialog itself?

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


Re: Interactive search on GtkTreeView not working

2017-09-01 Thread Igor Korot
Hi, Sofi,

On Fri, Sep 1, 2017 at 11:42 AM, Sofi Celi  wrote:
> Dear list,
>
> I have created an application on OS X El Capitan which has a GtkTreeView.
> Neither the start-interactive-search key binding nor the
> 'gtk_tree_view_set_enable_search()' works. It does not interactively search
> and when 'Ctrl+f' is press, the search bar is shown and focused, but nothing
> can be typed in it. Oddly enough, input can be copied, pasted or deleted,
> but when manually typing from the keyboard, the input is not shown.
> I have even modified the 'Ctrl+f' key binding to something else and it still
> does not work.
>
> It also does not work on Glade.
>
> Just in case, the properties 'can-focus' and 'has-focus' are set to true.

Which version of GTK+ you are using?

Thank you.

>
> Any ideas?
>
> Thanks!
>
> --
> Kunoichi developer. Hattori Hanzo clan.
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Switching GTK version

2017-08-22 Thread Igor Korot
Hi, Link,

On Tue, Aug 22, 2017 at 4:07 PM, Link Dupont  wrote:
> Hi Igor,
>
> On Tue, 2017-08-22 at 15:48 -0400, Igor Korot wrote:
>>  Hi, ALL,
>> I have setup to do my development for GTK+2 and GTK+3 on 2 different
>> machines.
>> My project is on GitHub and there is one codebase.
>>
>> What's the best way to set up Makefiles?
>
> You're going to find this is a matter of opinion. Traditionally, GTK+
> and GNOME projects have used GNU autotools for their build system. Many
> are now moving to meson. Either way, I suggest you take some time and
> learn one or both in order to make an informed decision about which
> build system is best for you.
>
> Meson is relatively new, and has most of its documentation on its
> website[1]. GNU autotools has a vast online manual available[2],
> however I recommend reading "Autotools: A Practition's Guide to to GNU
> Autoconf, Automake, and Libtool"[3] to get a hands-on understanding of
> the autotools suite.
>
> 1: http://mesonbuild.com/
> 2: http://www.gnu.org/software/autoconf/manual/, etc.
> 3: https://www.nostarch.com/autotools.htm
>
> You could, of course, eschew all of those and use your own hand-
> maintained Makefile. You'll find varying levels of opinion there too,
> although you'll encounter some pretty compelling arguments against
> maintaining your own hand-crafted Makefiles anywhere you look. In this
> case, you could consider at least using pkg-config to find out whether
> your required libraries are installed and where they are located on
> your build host.

I'm actually working with Anjuta.
Anjuta is Makefile-based.

The problem is that if I change something I need to do a 'git pull',
which overwrites
the "pkg-config --includedir gtk+2" to be "pkg-config --includedir gtk+3".

So I'm thinking to just create an environment variable - something
like "USE_GTK3",
export it on the machine set for GTK3, then fix the Makefile.in for my project.
Then this will be kept independently of which version I have installed
on the system.

Or is there a better and simpler alternative? Maybe pkg-config has
something like
"set the current GTK+ version to be GTK+3"?

Thank you.

>
>> Is it feasible to define some environment variable and select GTK
>> version if it defined?
>>
>> Or there is a better alternative?
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Switching GTK version

2017-08-22 Thread Igor Korot
 Hi, ALL,
I have setup to do my development for GTK+2 and GTK+3 on 2 different machines.
My project is on GitHub and there is one codebase.

What's the best way to set up Makefiles?

Is it feasible to define some environment variable and select GTK
version if it defined?

Or there is a better alternative?

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


Re: Max int value constant

2017-08-21 Thread Igor Korot
Thank you.

On Mon, Aug 21, 2017 at 1:46 PM, Link Dupont  wrote:
> G_MAXINT?
>
> https://developer.gnome.org/glib/stable/glib-Basic-Types.html#G-MAXINT:CAPS
>
>
> On Aug 21, 2017, at 10:42 AM, Igor Korot  wrote:
>
> Hi,
> Is there a constant in GTK library that defines the maximum integer value
> one
> can assign to int variable?
>
> Something like "INT_MAX"?
> I just need a very big number for comparison...
>
> Thank you.
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Max int value constant

2017-08-21 Thread Igor Korot
 Hi,
Is there a constant in GTK library that defines the maximum integer value one
can assign to int variable?

Something like "INT_MAX"?
I just need a very big number for comparison...

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


Help button

2017-08-09 Thread Igor Korot
 Hi, ALL,
Is it possible to display a Help button on GtkAssistant?

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


Font handling

2017-07-07 Thread Igor Korot
 Hi,
I'm not sure if this list is the one I should be talking to. If not -
please direct me appropriately.
Apologies in advance.

I'm currently  looking at
https://developer.gnome.org/pango/unstable/pango-Fonts.html#pango-font-metrics-get-underline-thickness
and I see only _get_underline_/_get_strikethrough_ functions.

There is no _set_underline_/_set_strikethrough_ functions which means
that there is no way
to create a underlined/strikethrough font.

Moreover it looks like GtkFontWidget does not support setting this parameters.

So is there a way to create such fonts programmatically? If yes - how?

And if there is such a way - is there a plans to support setting those
attributes from GtkFontWidget?

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


Using GtkFontSelection

2017-07-05 Thread Igor Korot
 Hi, ALL,
In the documentation for the GtkFontSelection class it said:

[quote]
To set the font which is initially selected, use
gtk_font_selection_set_font_name().
[/quote]

Since there is no function to set the size of the font or any other parameters
I'm curious - how they are selected?

Let's say I want to initially select the font "Verdana 16".
Does this mean I should pass "Verdana 16" to the function above?

I'm using GTK+2.24.

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


Re: Masked text control

2017-04-10 Thread Igor Korot
 Hi, Paul,

On Mon, Apr 10, 2017 at 10:29 AM, Paul Davis  wrote:
> No. You need to do the filtering yourself.

It's not just filtering.
As an example - for a phone number text field the mask will be

(___) ___-

so it is also a display problem.

So, nothing like this exists in GTK+?

Is there a plan to do something like this in the future?

Thank you.

>
> On Mon, Apr 10, 2017 at 3:09 PM, Igor Korot  wrote:
>>
>>  Hi,
>> Is there something like
>>
>> https://msdn.microsoft.com/en-us/library/windows/desktop/aa369797(v=vs.85).aspx
>> in GTK+?
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Masked text control

2017-04-10 Thread Igor Korot
 Hi,
Is there something like
https://msdn.microsoft.com/en-us/library/windows/desktop/aa369797(v=vs.85).aspx
in GTK+?

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


Re: Set maximum length for text control

2017-01-14 Thread Igor Korot
Eric at al,

On Thu, Jan 12, 2017 at 1:56 PM,   wrote:
> Your callback looks to be set up correctly but you have some unnecessary
> assignments in the function. You don't want.
>
> text = text;
> len = len;
> ptr = ptr;
>
> The len and text variables are already set up for you to use in the
> callback. GTK takes care of that part for you. The ptr variable in your set
> up is going to have the variable or variables that you want to send to the
> maxlen_handler() function. It can also be NULL so I don't know by looking at
> your code how that pointer is set up. What does
>
> g_signal_connect_after(buffer, "insert-text", G_CALLBACK(maxlen_handler),
> NULL);
>
> look like in your code? Is there a value in the NULL position that you need
> in your function?
>
> Check where the location iter is.
>
> g_print("Iters %i %i\n", gtk_text_iter_get_offset(location),
> gtk_text_iter_get_offset(&end));
>
> It might be at the same position as the end iter. Then the delete won't do
> anything. You might need another iter to get the starting position of where
> you want to remove text.

Yes, you were right. The iterator was at the same positions.

I ended up with the following code:

gint count = gtk_text_buffer_get_char_count( buffer );
if( count > 5 )
{
GtkTextIter offset, end;
gint startPos = gtk_text_iter_get_offset( location );
gtk_text_buffer_get_iter_at_offset( buffer, &offset, startPos - 1 );
gtk_text_buffer_get_iter_at_offset( buffer, &end, (startPos -
1) + len );
gtk_text_buffer_delete( buffer, &offset, &end );
/*
gtk_text_iter_assign( location, offset );
*/
}

for the GTK+2.24.
I will still need to test it under GTK+3 though.

Thank you for the help.

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


Re: Set maximum length for text control

2017-01-11 Thread Igor Korot
Eric,
Here is my corrected code:

static void maxlen_handler(GtkTextBuffer *buffer, GtkTextIter
*location, gchar *text, gint len, gpointer ptr)
{
text = text;
len = len;
ptr = ptr;
gint count = gtk_text_buffer_get_char_count( buffer );
if( count > 5 )
{
GtkTextIter end;
gtk_text_buffer_get_end_iter( buffer, &end );
gtk_text_buffer_delete( buffer, location, &end );
}
}

Basically what I'm doing is:
I already have the beginning iterator - location, so all I need is the
end iterator, which is
retrieved using gtk_text_buffer_get_end_iter().
Then I am removing the text between location and and end.

However, it doesn't work. I can still see the typing text which more
that 5 symbols.
Running under gdb I see that _buffer_delete() call is executed, but
the text is not being
updated.
I am trying it on GTK+-2.24.

Thank you.

On Wed, Jan 11, 2017 at 2:21 PM,   wrote:
>
> Check that your callback looks similar to the following.
>
> https://developer.gnome.org/gtk3/stable/GtkTextBuffer.html#GtkTextBuffer-insert-text
>
> It looks like you have "gint WXUNUSED(len), gpointer *user_data" that is
> likely giving you trouble.
>
> A couple of notes about this. It is a good idea to look up the callback in
> the documentation. If you get the parameters wrong your code may compile
> without warning and then later segfault. This is something in C you have to
> be careful of. The compiler might not help you here. Also a gpointer is a
> void* pointer.
>
> https://developer.gnome.org/glib/stable/glib-Basic-Types.html#gpointer
>
> This can cause confusion. When you are using a gpointer *user_data, that is
> a pointer to an array of pointers like a void **user_data or a void
> *user_data[]. That is valid if you are sending to your callback a pointer to
> some array of pointers and you might want to do this. Again, the compiler
> might not be able to help you when using void* pointers and you will
> probably get a segfault if you get it wrong. The documentation has a
> gpointer user_data parameter so that you can pass a pointer of any type to
> your callback along with the other required callback parameters. If you know
> the type of the pointer you can use the type in the callback so the compiler
> can help find potential errors. If you are sending a GRand* to your callback
> you can type it as such. If you are sending a pointer to an array of widget
> pointers you might have something like GtkWidget **widgets or GtkWidget
> *widgets[] although gpointer *widgets will work also and is valid but the
> compiler can't type check it for you.
>
> Eric
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Set maximum length for text control

2017-01-10 Thread Igor Korot
Hi, Eric,

On Tue, Jan 3, 2017 at 5:55 PM,   wrote:
>
> This turns out to be trickier than expected. In GTK3 I kept getting an
> invalid iter warning. Found a previous discussion about it at
>
> https://mail.gnome.org/archives/gtk-app-devel-list/2015-October/msg00015.html
>
> Stefan Salewski figured it out. Thankfully so because I tried quite a few
> things to try to get rid of the iter warning.
>
> Test the following out. See if it helps. There is a gtk_text_iter_assign()
> in there for GTK3. You can remove that for GTK2. GTK2 doesn't seem to be
> cranky about the invalid iters. You should be able to set a max length for
> the textview buffer in both GTK2 and GTK3 though.

I tried to modify the condition to prevent inserting the text at any
location if the
resulting text is bigger than maximum, but it didn't even compiled:

static void maxlen_handler(GtkTextBuffer *buffer, GtkTextIter
*location, gchar *text, gint WXUNUSED(len), gpointer *user_data)
{
gint count = gtk_text_buffer_get_char_count( buffer );
if( count > 5 )
{
   GtkTextIter end;
gtk_text_buffer_get_end_iter( text, &end );
gtk_text_buffer_delete( buffer, location, &end );
gtk_text_iter_assign( location, offset );
}
}

Any idea?

Thank you.

>
> Eric
>
>
> //gcc -Wall textview1.c -o textview1 `pkg-config --cflags --libs gtk+-3.0`
>
> #include 
>
> static void insert_text(GtkTextBuffer *buffer, GtkTextIter *location, gchar
> *text, gint len, gpointer user_data)
>   {
> static int i=1;
> gint count=gtk_text_buffer_get_char_count(buffer);
> g_print("%i Chars %i\n", i++, count);
> if(count>10)
>   {
> GtkTextIter offset, end;
> gtk_text_buffer_get_iter_at_offset(buffer, &offset, 10);
> gtk_text_buffer_get_end_iter(buffer, &end);
> g_print("Remove Range %i %i\n", gtk_text_iter_get_offset(&offset),
> gtk_text_iter_get_offset(&end));
> gtk_text_buffer_delete(buffer, &offset, &end);
> gtk_text_iter_assign(location, &offset);
>   }
>   }
> int main (int argc, char *argv[])
>   {
> gtk_init(&argc, &argv);
>
> GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
> gtk_window_set_title(GTK_WINDOW(window), "Textview");
> gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
> gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
> gtk_container_set_border_width(GTK_CONTAINER(window), 20);
> g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
> GtkWidget *scroll=gtk_scrolled_window_new(NULL, NULL);
>
> GtkWidget *textview=gtk_text_view_new();
> GtkTextBuffer *buffer=gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
> g_signal_connect_after(buffer, "insert-text", G_CALLBACK(insert_text),
> NULL);
>
> gtk_container_add(GTK_CONTAINER(scroll), textview);
>
> gtk_container_add(GTK_CONTAINER(window), scroll);
>
> gtk_widget_show_all(window);
>
> gtk_main();
>
> return 0;
>   }
>
>
>
>
> -Original Message-
> From: Igor Korot 
> To: gtk-list 
> Sent: Sat, Dec 31, 2016 4:33 pm
> Subject: Set maximum length for text control
>
> Hi,
> In the GtkEntry there is a function "gtk_entry_set_max_length()".
> However, it is for a single line text entry.
>
> Is there a way to set maximum length for multi-line text control?
>
> Thank you.
>
> Happy New Year!!
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel

2017-01-01 Thread Igor Korot
Hi,
I looked more closely at the code you provided and here are some observations.

On Fri, Dec 23, 2016 at 2:23 PM,   wrote:
>
> Give it a try. For GTK2 you can change a few things around to get it to
> work.

Yes in your code I need to set button2 as disabled initially - call
gtk_widget_set_sensitive( button2, false ); when the program starts.
Then when the user changes the font in any way (i.e. (s)he presses
arrow key anywhere),
the button becomes enabled.

IIUC, in GTK3 it may be possible with
https://developer.gnome.org/gtk3/stable/GtkFontChooser.html#GtkFontChooser-font-activated
signal, but if I read the docs correctly there is no equivalent for GTK+2.

>
> Pass the selection or chooser with your apply button "clicked" signal and
> you can apply the changes.

Yes, this part I understand.

>
> I tried the following with Ubuntu 16.04 and GTK2.24.30 and it worked. Maybe
> get a start at setting something up. I would recommend GTK3 over GTK2 but if
> GTK2 is the needed library then program with it.
>
> I don't see a deprecated warning for gtk_font_selection_set_font_name() when
> I compile in GTK2.

That's weird - I definitely see the deprecation warning in the GTK+2 docs -
see 
https://developer.gnome.org/gtk2/stable/GtkFontSelection.html#gtk-font-selection-set-font-name
for the reference.

Thank you for the code and Happy New Year!!

>
>
> /*
> gcc -Wall notebook2.c -o notebook2 `pkg-config --cflags --libs gtk+-2.0`
> */
>
> #include
>
> static void click_button1(GtkWidget *widget, gpointer user_data)
>  {
>g_print("Properties OK\n");
>  }
> static void click_button2(GtkWidget *widget, gpointer user_data)
>  {
>gchar
> *selection=gtk_font_selection_get_font_name(GTK_FONT_SELECTION(user_data));
>g_print("%s\n", selection);
>g_free(selection);
>  }
> static void set_font(GtkWidget *widget, gpointer user_data)
>  {
>gtk_font_selection_set_font_name(GTK_FONT_SELECTION(widget), "Monospace
> Bold 18");
>  }
> int main(int argc, char **argv)
>  {
>gtk_init(&argc, &argv);
>g_print("%d.%d.%d\n", gtk_major_version, gtk_minor_version,
> gtk_micro_version);
>
>GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>gtk_window_set_title(GTK_WINDOW(window), "Notebook Test2");
>gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
>gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
>g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
>GtkWidget *label1=gtk_label_new("Some Properties");
>
>GtkWidget *button1=gtk_button_new_with_label("Properties OK");
>g_signal_connect(button1, "clicked", G_CALLBACK(click_button1), NULL);
>
>GtkWidget *table1=gtk_table_new(2, 1, FALSE);
>gtk_table_attach(GTK_TABLE(table1), label1, 0, 1, 0, 1, GTK_EXPAND,
> GTK_EXPAND, 0, 0);
>gtk_table_attach(GTK_TABLE(table1), button1, 0, 1, 1, 2, GTK_EXPAND,
> GTK_SHRINK, 0, 0);
>
>GtkWidget *font=gtk_font_selection_new();
>g_signal_connect(font, "realize", G_CALLBACK(set_font), NULL);
>
>GtkWidget *button2=gtk_button_new_with_label("Font OK");
>g_signal_connect(button2, "clicked", G_CALLBACK(click_button2), font);
>
>GtkWidget *table2=gtk_table_new(2, 1, FALSE);
>gtk_table_attach(GTK_TABLE(table2), font, 0, 1, 0, 1, GTK_EXPAND,
> GTK_EXPAND, 0, 0);
>gtk_table_attach(GTK_TABLE(table2), button2, 0, 1, 1, 2, GTK_EXPAND,
> GTK_SHRINK, 0, 0);
>
>GtkWidget *notebook=gtk_notebook_new();
>GtkWidget *notebook_label1=gtk_label_new("Properties");
>GtkWidget *notebook_label2=gtk_label_new("Fonts");
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table1,
> notebook_label1);
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table2,
> notebook_label2);
>
>gtk_container_add(GTK_CONTAINER(window), notebook);
>
>gtk_widget_show_all(window);
>
>gtk_main();
>return 0;
>  }
>
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Set maximum length for text control

2016-12-31 Thread Igor Korot
Hi,
In the GtkEntry there is a function "gtk_entry_set_max_length()".
However, it is for a single line text entry.

Is there a way to set maximum length for multi-line text control?

Thank you.

Happy New Year!!
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel

2016-12-23 Thread Igor Korot
Thank you.
I will check it most likely after the holidays and report back.

Happy Holidays!!

On Fri, Dec 23, 2016 at 2:23 PM,   wrote:
>
> Give it a try. For GTK2 you can change a few things around to get it to
> work.
>
> Pass the selection or chooser with your apply button "clicked" signal and
> you can apply the changes.
>
> I tried the following with Ubuntu 16.04 and GTK2.24.30 and it worked. Maybe
> get a start at setting something up. I would recommend GTK3 over GTK2 but if
> GTK2 is the needed library then program with it.
>
> I don't see a deprecated warning for gtk_font_selection_set_font_name() when
> I compile in GTK2.
>
>
> /*
> gcc -Wall notebook2.c -o notebook2 `pkg-config --cflags --libs gtk+-2.0`
> */
>
> #include
>
> static void click_button1(GtkWidget *widget, gpointer user_data)
>  {
>g_print("Properties OK\n");
>  }
> static void click_button2(GtkWidget *widget, gpointer user_data)
>  {
>gchar
> *selection=gtk_font_selection_get_font_name(GTK_FONT_SELECTION(user_data));
>g_print("%s\n", selection);
>g_free(selection);
>  }
> static void set_font(GtkWidget *widget, gpointer user_data)
>  {
>gtk_font_selection_set_font_name(GTK_FONT_SELECTION(widget), "Monospace
> Bold 18");
>  }
> int main(int argc, char **argv)
>  {
>gtk_init(&argc, &argv);
>g_print("%d.%d.%d\n", gtk_major_version, gtk_minor_version,
> gtk_micro_version);
>
>GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>gtk_window_set_title(GTK_WINDOW(window), "Notebook Test2");
>gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
>gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
>g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
>GtkWidget *label1=gtk_label_new("Some Properties");
>
>GtkWidget *button1=gtk_button_new_with_label("Properties OK");
>g_signal_connect(button1, "clicked", G_CALLBACK(click_button1), NULL);
>
>GtkWidget *table1=gtk_table_new(2, 1, FALSE);
>gtk_table_attach(GTK_TABLE(table1), label1, 0, 1, 0, 1, GTK_EXPAND,
> GTK_EXPAND, 0, 0);
>gtk_table_attach(GTK_TABLE(table1), button1, 0, 1, 1, 2, GTK_EXPAND,
> GTK_SHRINK, 0, 0);
>
>GtkWidget *font=gtk_font_selection_new();
>g_signal_connect(font, "realize", G_CALLBACK(set_font), NULL);
>
>GtkWidget *button2=gtk_button_new_with_label("Font OK");
>g_signal_connect(button2, "clicked", G_CALLBACK(click_button2), font);
>
>GtkWidget *table2=gtk_table_new(2, 1, FALSE);
>gtk_table_attach(GTK_TABLE(table2), font, 0, 1, 0, 1, GTK_EXPAND,
> GTK_EXPAND, 0, 0);
>gtk_table_attach(GTK_TABLE(table2), button2, 0, 1, 1, 2, GTK_EXPAND,
> GTK_SHRINK, 0, 0);
>
>GtkWidget *notebook=gtk_notebook_new();
>GtkWidget *notebook_label1=gtk_label_new("Properties");
>GtkWidget *notebook_label2=gtk_label_new("Fonts");
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table1,
> notebook_label1);
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), table2,
> notebook_label2);
>
>gtk_container_add(GTK_CONTAINER(window), notebook);
>
>gtk_widget_show_all(window);
>
>gtk_main();
>return 0;
>  }
>
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Font selection panel

2016-12-22 Thread Igor Korot
Hi,

On Thu, Dec 22, 2016 at 8:07 PM,   wrote:
>
>
> Where do you want to set the font? The gtk_font_chooser_set_font() function
> will set it in the chooser.

On the page 
https://developer.gnome.org/gtk2/stable/GtkFontSelection.html#gtk-font-selection-set-font-name
the function is declared as deprecated. Which means it will not be
possible to set the font initially.

>
> What version of GTK+ and OS are you using to test with? I only have GTK3.18
> to test with right now and the code worked with that.

I will try that on both 2.24 and 3.18.

>
> The gtk font chooser widget only has one function but it can use functions
> present in the derivation chain and also the interfaces it implements. If
> you think that a widget really should have a certain function, and don't see
> it there, always check to see how it is derived and if it implements one or
> more interfaces.

Also, unfortunately, the page
https://developer.gnome.org/gtk2/stable/GtkFontSelection.html does
not list any signals. Which means I will not be able to catch a font
changing event and enable the "Apply"
button.
In comparison the GTK3+ GtkFontChooser does emit a signal on the font
change and can set the font
initially.

Any idea how to do this under GTK+2?

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


Re: Font selection panel

2016-12-22 Thread Igor Korot
Hi,

On Thu, Dec 22, 2016 at 3:59 PM,   wrote:
>
> You should be able to put something together with a notebook widget
> wizardlike. Of course I have been caught with the "should be able to" before
> and spent hours working on what I shouldn't do in the first place. This
> looks to be do_able().
>
> Test it out. See if it helps. Happy Holidays.

Is there a way to set the initial font?
Also is there a way to have something like this on GTK+3?


And thank you for an example.

>
> Eric
>
>
> /*
> gcc -Wall notebook1.c -o notebook1 `pkg-config --cflags --libs gtk+-3.0`
> Tested on Ubuntu16.04 and GTK3.18
> */
>
> #include
>
> static void click_button1(GtkWidget *widget, gpointer user_data)
>  {
>g_print("Properties OK\n");
>  }
> static void click_button2(GtkWidget *widget, gpointer user_data)
>  {
>gchar *selection=gtk_font_chooser_get_font(GTK_FONT_CHOOSER(user_data));
>g_print("%s\n", selection);
>g_free(selection);
>  }
> int main(int argc, char **argv)
>  {
>gtk_init(&argc, &argv);
>
>GtkWidget *window=gtk_window_new(GTK_WINDOW_TOPLEVEL);
>gtk_window_set_title(GTK_WINDOW(window), "Notebook Test");
>gtk_window_set_default_size(GTK_WINDOW(window), 400, 400);
>gtk_window_set_position(GTK_WINDOW(window), GTK_WIN_POS_CENTER);
>g_signal_connect(window, "destroy", G_CALLBACK(gtk_main_quit), NULL);
>
>GtkWidget *label1=gtk_label_new("Some Properties");
>gtk_widget_set_hexpand(label1, TRUE);
>gtk_widget_set_vexpand(label1, TRUE);
>
>GtkWidget *button1=gtk_button_new_with_label("Properties OK");
>g_signal_connect(button1, "clicked", G_CALLBACK(click_button1), NULL);
>
>GtkWidget *grid1=gtk_grid_new();
>gtk_grid_attach(GTK_GRID(grid1), label1, 0, 0, 1, 1);
>gtk_grid_attach(GTK_GRID(grid1), button1, 0, 1, 1, 1);
>
>GtkWidget *font=gtk_font_chooser_widget_new();
>gtk_widget_set_hexpand(font, TRUE);
>gtk_widget_set_vexpand(font, TRUE);
>
>GtkWidget *button2=gtk_button_new_with_label("Font OK");
>g_signal_connect(button2, "clicked", G_CALLBACK(click_button2), font);
>
>GtkWidget *grid2=gtk_grid_new();
>gtk_grid_attach(GTK_GRID(grid2), font, 0, 0, 1, 1);
>gtk_grid_attach(GTK_GRID(grid2), button2, 0, 1, 1, 1);
>
>GtkWidget *notebook=gtk_notebook_new();
>GtkWidget *notebook_label1=gtk_label_new("Properties");
>GtkWidget *notebook_label2=gtk_label_new("Fonts");
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), grid1, notebook_label1);
>gtk_notebook_append_page(GTK_NOTEBOOK(notebook), grid2, notebook_label2);
>
>gtk_container_add(GTK_CONTAINER(window), notebook);
>
>gtk_widget_show_all(window);
>
>gtk_main();
>return 0;
>  }
>
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Font selection panel

2016-12-21 Thread Igor Korot
 Hi, ALL,
I am trying to see if it's at all possible to create a font selection
panel which can be used
as a page in the notebook/wizard.

What I'm trying to do is to create a "Properties/Options"-like dialog
with the notebook control
and "OK", "Apply", "Cancel" and "Help" button. One of the pages in the
notebook should be
a font selection page.

Looking at the documentation I see there are 2 different classes in
GTK+2 and GTK+3.

In GTK+2 the widget is called GtkFontSelection. However,
unfortunately, this widget lists
a function called gtk_font_selection_set_font_name(), which is marked
deprecated.

It would be very useful for my purpose, but the deprecation warning
doesn't list a replacement.

Is there any?

Or maybe I'm barking at the wrong tree and it would actually be much
easier to use
GtkFontSelectionDialog and simply hide the buttons in it?

Anybody done something like this before?

Thank you and Happy Holidays to everybody on this list!!
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: gtk_file_chooser_dialog_new and gtk_file_chooser_native_new very slow on a Windows 10 64-bit PC

2016-12-08 Thread Igor Korot
Ian,

On Thu, Dec 8, 2016 at 9:35 AM, Timm Bäder  wrote:
> On 07.12, Ian Puleston wrote:
>> A little debugging showed that the time is spent in
>> gtk_file_chooser_dialog_new which takes 15 seconds to execute. I tried
>> switching to gtk_file_chooser_native_new instead but it too has the same
>> problem taking just as long.

Did you try profiling the program/test?

Thank you.

>
> Was the debugging just a printf before and after those calls or is there
> some more info about where the time is exactly spent?
>
>> So I tried running an older version of the app with GTK 2.24.10 on this PC
>> and it too shows the problem, although it is not so bad, taking about 10
>> seconds to open the file chooser (three file chooser opens in quick
>> succession actually take 10, 5 and 5 seconds where all three take 15 seconds
>> when doing the same with GTK 3).
>
> Just a hunch, but might this be the "nonexistent floppy drive" problem
> that a few people on the web have mentioned, I can right now only
> find[1]?
>
> In any case, the fact that both gtk2 and gtk3 are affected makes it kind
> of unrealistic that a change in gtk+ is at fault and without more info
> it's hard to say what exactly the problem is.
>
>
>
> [1] 
> http://superuser.com/questions/979504/load-dialog-disk-access-slowdown-on-windows-10
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Catch logging off in GTK application

2016-12-01 Thread Igor Korot
Emmanuelle,

On Thu, Dec 1, 2016 at 4:06 PM, Emmanuele Bassi  wrote:
> Hi;
>
> If you're using GtkApplication under GNOME and Xfce, you'll get the
> GApplication::shutdown signal if the session manager terminates the session.

Thank you.
But I can use D-Bus API directly, right?

Thank you.

>
> Other session managers do not expose a DBus API that GTK can use; if they
> do, patches are welcome to support them.
>
> Ciao,
> Emmanuele.
>
> On Wed, 30 Nov 2016 at 19:47, Igor Korot  wrote:
>>
>>  Hi, ALL,
>> What is the way to go to catch the logging off event in the GTK+ app?
>> For both GTK+2 and GTK+3.
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Catch logging off in GTK application

2016-12-01 Thread Igor Korot
Guys,

On Thu, Dec 1, 2016 at 3:59 AM, Göran Hasse  wrote:
> All right...
>
> But what if you do
>
> ssh -X remote.sys.com
> my_nice_gtk_app &
>
> On whitch desktop is this running?
>
> Gtk that interacts with the "lokal" desktop is a problem!
>
> If I do "open file" - do I then expect the lokal filesystem or
> the filesystem on the systems that the gtk app is running.

I'm looking for a simplest possible scenario - logging off from the
current local session.
No remote execution, no other special stuff.

Is there a simple solution which can be implemented?
Preferably something on the X + GTK+ (Linux).

Thank you.

>
> /gh
>
>
> Den 2016-12-01 kl. 09:53, skrev Paul Davis:
>> No, he's talking about handling notifications from a desktop environment 
>> that strongly suggest to the application that it should exit.
>>
>> On Thu, Dec 1, 2016 at 5:47 AM, Göran Hasse > <mailto:gor...@raditex.nu>> wrote:
>>
>>
>> You should be talking of "quit" an application. And to notice when an 
>> application (a process)
>> exits it is possible to know.
>>
>> I is always possible to make a service listen on a socket and take 
>> connections from
>> afar without "logging in" to the operating system.
>>
>> /gh
>>
>> Den 2016-11-30 kl. 20:47, skrev Igor Korot:
>> >  Hi, ALL,
>> > What is the way to go to catch the logging off event in the GTK+ app?
>> > For both GTK+2 and GTK+3.
>> >
>> > Thank you.
>> > ___
>> > gtk-list mailing list
>> > gtk-list@gnome.org <mailto:gtk-list@gnome.org>
>> > https://mail.gnome.org/mailman/listinfo/gtk-list 
>> <https://mail.gnome.org/mailman/listinfo/gtk-list>
>> >
>>
>> --
>> Göran Hasse
>> Raditex Control AB
>> Boo 229
>> 715 91 ODENSBACKEN
>> http://www.rscada.se
>> OrgNr: 556611-8773
>> email: gor...@raditex.nu <mailto:gor...@raditex.nu>
>> tel: 019-450105
>> mob: 070-5530148
>> Lat:  59.18805083 Long: 15.50300449
>> URL: http://alturl.com/3e6hf
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org <mailto:gtk-list@gnome.org>
>> https://mail.gnome.org/mailman/listinfo/gtk-list 
>> <https://mail.gnome.org/mailman/listinfo/gtk-list>
>>
>>
>
> --
> Göran Hasse
> Raditex Control AB
> Boo 229
> 715 91 ODENSBACKEN
> http://www.rscada.se
> OrgNr: 556611-8773
> email: gor...@raditex.nu
> tel: 019-450105
> mob: 070-5530148
> Lat:  59.18805083 Long: 15.50300449
> URL: http://alturl.com/3e6hf
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Catch logging off in GTK application

2016-11-30 Thread Igor Korot
 Paul,

On Wed, Nov 30, 2016 at 4:14 PM, Paul Davis  wrote:
> Technically, that's not a GTK+ question.
>
> GTK+ apps can run on desktops or platforms where there's no concept of
> "logging in" or "logging off".
>
> GNOME covers that and GTK+ does represent some of it, but it isn't
> necessarily portable to other desktop environments.

So if I write the GTK+-based application and want to have it handle graceful
exit when the user logs off the session or just kills the GUI session, it is not
possible?

Or you are saying that there are other libraries that should handle this? If
yes - which one(s)? I can try to check their API and see what I can do...

Thank you.

>
> On Wed, Nov 30, 2016 at 7:47 PM, Igor Korot  wrote:
>>
>>  Hi, ALL,
>> What is the way to go to catch the logging off event in the GTK+ app?
>> For both GTK+2 and GTK+3.
>>
>> Thank you.
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Catch logging off in GTK application

2016-11-30 Thread Igor Korot
 Hi, ALL,
What is the way to go to catch the logging off event in the GTK+ app?
For both GTK+2 and GTK+3.

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


Font selection property page

2016-11-30 Thread Igor Korot
Hi, ALL,
I am trying to create a property sheet (sorry for the M$ terminology),
which will be used
in the dialog.

One of the pages in the sheet (or notebook, if its easier to
comprehend) should be
a font selection page.

Looking at the GTK+ documentation I see that there are
https://developer.gnome.org/gtk3/stable/GtkFontChooserWidget.html for
GTK+3
and https://developer.gnome.org/gtk2/stable/GtkFontSelection.html for GTK+2.

Will those 2 work in my scenario? They are not dialogs, just a
widgets. And I don't
want to create something if it's already exists.

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


GtkLinkButton question

2016-11-23 Thread Igor Korot
 Hi, ALL,
Have a following question.

In the GTK < 3.12 there was a property named "link-color" which would be used
to implement the color change if the link was already been clicked ("visited").

Unfortunately this property was deprecated.

Is there a way in the more current GTK+ to implement such a feature?

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


time change signal

2016-06-28 Thread Igor Korot
 Hi, ALL,
Is there a signal which is posted when the system time change occurs?

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


Re: Clarification needed

2016-05-15 Thread Igor Korot
Also, what is the difference between this one and "extend-selection"?

On Sun, May 15, 2016 at 6:26 PM, Igor Korot  wrote:
> Hi, ALL,
> In the 
> https://developer.gnome.org/gtk3/stable/GtkTextView.html#GtkTextView-move-cursor
> it said:
>
> [quote]
> Applications should not connect to it, but may emit it with
> g_signal_emit_by_name() if they need to control the cursor
> programmatically.
> [/quote]
>
> If this signal is not meant to be connected, how come it is documented?
>
> And if it is documented, does this mean I can connect to it and it will work?
> Or there is another signal I can connect to to catch the cursor movements?
>
> Thank you.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Clarification needed

2016-05-15 Thread Igor Korot
Hi, ALL,
In the 
https://developer.gnome.org/gtk3/stable/GtkTextView.html#GtkTextView-move-cursor
it said:

[quote]
Applications should not connect to it, but may emit it with
g_signal_emit_by_name() if they need to control the cursor
programmatically.
[/quote]

If this signal is not meant to be connected, how come it is documented?

And if it is documented, does this mean I can connect to it and it will work?
Or there is another signal I can connect to to catch the cursor movements?

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


Re: Is creating such button supported by GTK+?

2016-04-11 Thread Igor Korot
Hi, Allin,

On Mon, Apr 11, 2016 at 4:20 PM, Allin Cottrell  wrote:
> On Mon, 11 Apr 2016, Igor Korot wrote:
>
>> Hi, ALL,
>> If I want to create a button with the underlined font - will I be able
>> to do that?
>> Or if the font will have a strikethrough option?
>
>
> http://developer.gnome.org/pango/stable/PangoMarkupFormat.html

Yes, I know about this page.

The trouble is - it looks like that this is describing how to do a
basic label (or
static text) format change.

Now if I want to have a button (push button - like an "OK" button in the dialog)
and want to have this "OK" text as strikethrough - will this be supported.

Either with GTK+2 or GTK+3.

Thank you.

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


Is creating such button supported by GTK+?

2016-04-11 Thread Igor Korot
 Hi, ALL,
If I want to create a button with the underlined font - will I be able
to do that?
Or if the font will have a strikethrough option?

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


Re: Computing border size of GtkFrame

2016-03-23 Thread Igor Korot
Hi, Andreas,

On Wed, Mar 23, 2016 at 11:34 AM, Andreas Falkenhahn
 wrote:
> I need to compute the border sizes of a GtkFrame before the window containing
> that GtkFrame has been realized. Precisely, I need the distances between the
> GtkFrame container widget and its child. AFAICS, this isn't possible to get
> before the GtkFrame has been realized. So I thought that I could use a 
> workaround
> that creates a top-level window, adds a GtkFrame with a GtkButton and computes
> the size and destroys everything again. Here is the code:

What is it that you are trying to accomplish/achieve?
Maybe this is possible in some other way?

Thank you.

>
> void GTKFrameGetBorders(int *borderTop, int *borderOther)
> {
> GtkWidget *wnd = gtk_window_new(GTK_WINDOW_TOPLEVEL);
> GtkWidget* labelwidget = gtk_label_new_with_mnemonic("Foo");
> gtk_widget_show(labelwidget);
>
> GtkWidget* framewidget = gtk_frame_new(NULL);
> gtk_frame_set_label_widget(GTK_FRAME(framewidget), labelwidget);
>
> GtkWidget *btn = gtk_button_new();
> gtk_widget_show(btn);
>
> gtk_container_add(GTK_CONTAINER(framewidget), btn);
> gtk_container_add(GTK_CONTAINER(wnd), framewidget);
>
> gtk_widget_show(framewidget);
>
> // !!! THIS CALL IS NECESSARY TO GET CORRECT VALUES !!!
> gtk_widget_realize(labelwidget);
>
> GtkAllocation alloc, child_alloc;
> gtk_widget_get_allocation(framewidget, &alloc);
>
> 
> GTK_FRAME_GET_CLASS(framewidget)->compute_child_allocation(GTK_FRAME(framewidget),
>  &child_alloc);
>
> *borderTop = child_alloc.y - alloc.y;
> *borderOther = child_alloc.x - alloc.x;
>
> gtk_widget_destroy(wnd);
> }
>
> This seems to do the job and returns the correct values but of course it's a
> really hackish solution. So I've got two questions:
>
> 1) Is there a better/cleaner solution? :)
>
> 2) Is it allowed to call gtk_widget_realize() on the "labelwidget" as done 
> above? The
> docs say that gtk_widget_realize() is propagated upwards so does this mean 
> that
> gtk_widget_realize() will end up being called on the top-level window which 
> means
> that the top-level window will be shown very briefly? That's of course 
> something
> I'd like to avoid...
>
> I'm targetting GTK+ 2.
>
> Thanks for any suggestions!
>
> --
> Best regards,
>  Andreas Falkenhahn  mailto:andr...@falkenhahn.com
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkFrame looks different each time the program is started

2016-03-22 Thread Igor Korot
Hi, Goran,

On Tue, Mar 22, 2016 at 5:40 PM, Göran Hasse  wrote:
>
>
> Den 2016-03-22 kl. 21:09, skrev Andreas Falkenhahn:
>> On 22.03.2016 at 20:17 Göran Hasse wrote:
>>
>>> Hello,
>>
>>> Strange... You can test the behavior by changing the order
>>> the widget get realized.
>>
>>> Instead of gtk_widget_show_all(window); at the end try to do 
>>> gtk_widget_show(widget1);
>>> one at a time and in different order. This could give a clue... but maybe 
>>> not...
>>
>> Unfortunately, this isn't easily possible because the GUI is programmed
>> using wxWidgets...
>
> Then you *should* expect strange things. A toolkit trying to glue things as
> orthogonal as Gtk (entierly relying on callbacks) and Qt (with its internal 
> message buss ... slots and signals )
> are bound to give strange behaviour. So call it a feature and forget it... ;-)

Unfortunately, its not possible to call it a feature, because its not
documented anywhere. ;-)

Thank you.

>
> /gh
>
> --
> Göran Hasse
> Raditex Control AB
> http://www.rscada.se
> OrgNr: 556611-8773
> email: gor...@raditex.nu
> tel: 019-450105
> mob: 070-5530148
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: GtkFrame looks different each time the program is started

2016-03-22 Thread Igor Korot
Hi, Marco,

On Tue, Mar 22, 2016 at 4:36 PM, Marco Scannadinari
 wrote:
> Doesn't wxwidgets use Gtk2 as a backend (which has a theme similar to the
> current Qt GNOME theme)

Yes, it does using GTK2 as the backend. And latest release can be
compiled against GTK3.

Thank you.

>
>
> On Tue, 22 Mar 2016, 20:09 Andreas Falkenhahn, 
> wrote:
>>
>> On 22.03.2016 at 20:17 Göran Hasse wrote:
>>
>> > Hello,
>>
>> > Strange... You can test the behavior by changing the order
>> > the widget get realized.
>>
>> > Instead of gtk_widget_show_all(window); at the end try to do
>> > gtk_widget_show(widget1);
>> > one at a time and in different order. This could give a clue... but
>> > maybe not...
>>
>> Unfortunately, this isn't easily possible because the GUI is programmed
>> using wxWidgets...
>>
>> --
>> Best regards,
>>  Andreas Falkenhahn
>> mailto:andr...@falkenhahn.com
>>
>> ___
>> gtk-list mailing list
>> gtk-list@gnome.org
>> https://mail.gnome.org/mailman/listinfo/gtk-list
>
>
> ___
> gtk-list mailing list
> gtk-list@gnome.org
> https://mail.gnome.org/mailman/listinfo/gtk-list
>
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Where are the icon names documented?

2016-03-05 Thread Igor Korot
Hi, ALL,
In the documentation of "gtk_image_new_from_icon_name ()" it states
that:

[quote]
Creates a GtkImage displaying an icon from the current icon theme. If
the icon name isn’t known, a “broken image” icon will be displayed
instead. If the current icon theme is changed, the icon will be
updated appropriately.
[/quote]

However, it does not indicate where the icon names are documented and what
are they

Can someone please point me to this place?

Also, I am running Gentoo with KDE 4. I have both Qt and GTK+ 3.14 installed.

Will I see my icon bitmaps? Or I have to run Gnome?

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


Another documentation issue

2015-10-26 Thread Igor Korot
Hi, ALL,
Looking at 
https://developer.gnome.org/gdk2/stable/gdk2-Drawing-Primitives.html#gdk-draw-line

I see following:

[quote]
gdk_draw_line has been deprecated since version 2.22 and should not be
used in newly-written code.

Use cairo_line_to() and cairo_stroke() instead. Be aware that the
default line width in Cairo is 2 pixels and that your coordinates need
to describe the center of the line. To draw a single pixel wide
pixel-aligned line, you would use:

cairo_set_line_cap (cr, CAIRO_LINE_CAP_SQUARE);
cairo_move_to (cr, 0.5, 0.5);
cairo_line_to (cr, 9.5, 0.5);
cairo_stroke (cr);]|
See also http://cairographics.org/FAQ/#sharp_lines";>the Cairo
FAQ on this topic.
[/quote]

The text after "See also " is a plain text and not a link to the
appropriate URL.

It also would be nice if the documentation say whether screen, window or client
coordinates are used for drawing.

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


Re: Dynamically filled combo box

2015-10-19 Thread Igor Korot
John,

On Mon, Oct 19, 2015 at 2:54 PM,   wrote:
> On 19 October 2015 at 18:45, Igor Korot  wrote:
>> On Mon, Oct 19, 2015 at 1:37 PM,   wrote:
>>> On 19 October 2015 at 17:45, Igor Korot  wrote:
>>>> On Windows I have an ability to create a dynamically filled combobox.
>>>> I.e. I can catch a dropdown event (message), where I can remove all
>>>> items from the list
>>>> and insert a new string to be displayed. Then on the popup event
>>>> (message) I can remove everything and depending whether there is a
>>>> selection or not, add the appropriate string.
>>>>
>>>> Is it possible to do the same with GTK+? Either with 2 or 3?
>>>
>>> Sure, in gtk2, try:
>>>
>>> https://developer.gnome.org/gtk2/stable/GtkComboBoxText.html#gtk-combo-box-text-append-text
>>>
>>> Same thing, though a little fancier, in gtk3:
>>>
>>> https://developer.gnome.org/gtk3/stable/GtkComboBoxText.html#gtk-combo-box-text-append-text
>>
>> Ok, but the trouble is that in GTK those signals are "Actions".
>> They don't have "Run First"/"Run Last" flag.
>>
>> So, how do I properly connect to them?
>
> The signals are on the parent class. I use "changed" for an option
> being selected.  There are popup and popdown signals too, though I've
> not tried them.
>
> https://developer.gnome.org/gtk3/stable/GtkComboBox.html#GtkComboBox-changed

I am not selecting anything.
I want to dynamically fill up the combo box list, when it is displayed
and remove everything leaving just
one line in after it is pops up.

To give you an exampple:

I have a dialog with the combo box. The text in the combo box says:
"Make a selection".
When I click on the combo box arrow to display the list, the strings I
see are "Choice 1", "Choice 2", "Choice 3".
No "Make a selection".
Then after selection is made all strings are disappear and I am seeing
"Selected - Choice 1".
And so internally there is only one string available which is
currently selected.

This is what I mean by dynamically filled combo box.
Thank you.
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


Re: Dynamically filled combo box

2015-10-19 Thread Igor Korot
Hi, John,

On Mon, Oct 19, 2015 at 1:37 PM,   wrote:
> Hi Igor,
>
> On 19 October 2015 at 17:45, Igor Korot  wrote:
>> On Windows I have an ability to create a dynamically filled combobox.
>> I.e. I can catch a dropdown event (message), where I can remove all
>> items from the list
>> and insert a new string to be displayed. Then on the popup event
>> (message) I can remove everything and depending whether there is a
>> selection or not, add the appropriate string.
>>
>> Is it possible to do the same with GTK+? Either with 2 or 3?
>
> Sure, in gtk2, try:
>
> https://developer.gnome.org/gtk2/stable/GtkComboBoxText.html#gtk-combo-box-text-append-text
>
> Same thing, though a little fancier, in gtk3:
>
> https://developer.gnome.org/gtk3/stable/GtkComboBoxText.html#gtk-combo-box-text-append-text

Ok, but the trouble is that in GTK those signals are "Actions".
They don't have "Run First"/"Run Last" flag.

So, how do I properly connect to them?

I need this code to be executed befor dropdown and after popup...

Thank you.

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


Dynamically filled combo box

2015-10-19 Thread Igor Korot
 Hi, ALL,
On Windows I have an ability to create a dynamically filled combobox.
I.e. I can catch a dropdown event (message), where I can remove all
items from the list
and insert a new string to be displayed. Then on the popup event
(message) I can remove everything and depending whether there is a
selection or not, add the appropriate string.

Is it possible to do the same with GTK+? Either with 2 or 3?

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


Moving the file to Recycle Bin/Trash

2015-10-14 Thread Igor Korot
 Hi,
Everywhere I look I can't seem to find a way to send the file to the
Recycle Bin/Trash using GTK+.

Is there any "standard" way to send the file to the Recycle Bin/Trash
in GTK+ application on Linux?

I of course realize that every Linux distro is different and on top
every WM is also different and can have its own way. But I'm talking
about most used ones - like GNOME/KDE/XFCE.

Or this is distro-dependent as well?

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


Re: Pango question about font

2015-08-30 Thread Igor Korot
Hi, again,

On Sun, Aug 30, 2015 at 11:44 PM, Igor Korot  wrote:
> Hi, ALL,
> Hopefully there is a person who is familiar with Pango...
>
> The documentation for PangoUnderline -> PANGO_UNDERLINE_ERROR states:
>
> [quote]
> a wavy underline should be drawn below. This underline is typically
> used to indicate an error such as a possilble mispelling; in some
> cases a contrasting color may automatically be used. This type of
> underlining is available since Pango 1.4.
> [/quote]
>
> 2 questions:
> 1. "in some cases a contrasting color may automatically be used".
> When? I.e. what are those cases?
> 2. Can I set the color used for the wavy underline? As an example on
> Windows when there is a misspelled word the red color is used and when
> there is a syntactical error - blue.

I kind of found an answer to my second question.
Is this line of code OK:

[code]
tag = gtk_text_buffer_create_tag( text_buffer, buf, "underline-color",
(128, 128, 128 ), NULL );
[/code]

Thank you.

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


Pango question about font

2015-08-30 Thread Igor Korot
Hi, ALL,
Hopefully there is a person who is familiar with Pango...

The documentation for PangoUnderline -> PANGO_UNDERLINE_ERROR states:

[quote]
a wavy underline should be drawn below. This underline is typically
used to indicate an error such as a possilble mispelling; in some
cases a contrasting color may automatically be used. This type of
underlining is available since Pango 1.4.
[/quote]

2 questions:
1. "in some cases a contrasting color may automatically be used".
When? I.e. what are those cases?
2. Can I set the color used for the wavy underline? As an example on
Windows when there is a misspelled word the red color is used and when
there is a syntactical error - blue.

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


Re: Composite window with GTK+3.

2015-08-26 Thread Igor Korot
Hi, Gian,

On Mon, Aug 24, 2015 at 4:56 AM, Gian Mario Tagliaretti
 wrote:
> On 24 August 2015 at 05:49, Igor Korot  wrote:
>
> Hi Igor,
>
>> So then this path becomes obsolete, since it is compiled into the binary?
>> Or not?
>> And how to properly format it?
>
> You might want to have a look at how GResource [1] works:
>
> [1] https://developer.gnome.org/gio/stable/GResource.html

Sorry for the delay.
So if I understand correctly I need to create an xml file description
in the form

[code]


  
data/splashscreen.png
dialog.ui
menumarkup.xml
  

[/code]

Then run glib-compile-resource passing "--generate-source" and
"--generate-header" options to it and then just include the source
code
directly instead of loading the resource from the file like GtkWidget
page suggested which I referenced in the OP.
And of course no "bind_template_child" call as it will be a source code.

Do I understand correctly?

Thank you.
>
> Cheers
>
> --
> Gian Mario Tagliaretti
> GNOME Foundation member
> gia...@gnome.org
___
gtk-list mailing list
gtk-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-list


  1   2   3   >