Help with gtkEntry

I am trying to add in some functionality to G510s to be able to run custom code on the fly (specific to each mode), but I cannot figure out how to make the gtkEntry element in Glade be multiline and monospace.

I can provide the .glade file if you would like that

A quick search of the web suggests (from a 2012 Stackoverflow post) that the proper way to handle multiline text entry is to use the TextView widget rather than gtkEntry.

The discussion relates to using pygtk, but regardless of language, this is probably good info, if a bit old (gtk has certainly changed in the intervening 12 years).

so i got that but how do i make it monospace, I have tried the toggle but i cannot figure it out
image
the toggle does nothing

What do you see that’s telling you that it’s not doing anything?

I created a test project quickly that enables monospace in the space, and when I tell it to preview it, it seems to work just fine.

image

Can you be a bit more descriptive in what you’re doing, how you’re testing, and what the results are?

Just posting a screenshot doesn’t really tell us a lot, and having to guess just takes more time.

1 Like

I want to make a window for injecting code to be run every x seconds, mainly for custom Ui on the keyboard display, it is for a program called G510s, you can find it on my home project, I can list the deps if you would like.
this is the keyboard with the screen in question (without the chin piece though, I do not have that)

My test is simple, make it appear in monospace, EVEN THOUGH I HAVE TRIED EVERYTHING GOOD GRIEF

OK, but what specifically are you doing within Glade?

I’ve tried it in Glade here, and it just works. So either we’re running different versions of Glade, or there’s something in how you’re testing it that’s not the way I’m testing it.

Enabling the monospace toggle
image

here is the version

usr_40476@localhost:~> glade --version
glade 3.40.0
usr_40476@localhost:~> 

here is about glade
image

Here is the project settings

So we’re kinda going in circles here.

Showing a screenshot of the toggle turned on (again) doesn’t give me any new information.

Here’s what I did to test:

  1. Create a new project.
  2. Create a gtkWindow object
  3. Create a gtkTextView object in the gtkWindow object
  4. Set the toggle for ‘monospace’ so it’s on
  5. Make sure the ‘editable’ checkbox is enabled
  6. Click ‘Preview snapshot’ button

Result:

image

I don’t need the high level “here’s what my project is supposed to do”, nor do I need a series of screenshots with no narrative.

A detailed step-by-step of how to reproduce the issue you’re seeing is what’s going to help here.

Remember that nobody here can see what you’re doing. Only showing the results of what you’re doing and a few screenshots of steps along the way without the full picture of the steps you’re following to get the result doesn’t give us enough to help you.

The version of Glade that I’m using is also 3.40.0, so it’s probably not a bug.

It probably would also be useful to see the full list of warnings from the project settings - the partial view that you’ve shown in the project settings hints that there might be things you’re doing that are causing it to not allow the settings you’re trying to use. Rather than a screenshot, use copy/paste and paste it in a preformatted text tag (the button is the one that looks like </> in the forum editor toolbar).

1 Like

I followed your steps, but did not yield any results.


I do not have any warnings, could any of this be related to they messed up window buttons I have on the main window?
image

In the project settings window from your previous screenshot, there are warnings, such as:

[window > box1 > closebutton]
  Property 'Use stock' of object class 'Button' is deprecated

And so on. Those are the warnings I was talking about.

Those buttons being weird could be indicative of an issue (related or not) - I might be inclined to verify the Glade RPM and to make sure all the proper fonts are installed. If you open gedit for example, do you see a monospaced font there? (It uses one by default).

It might also be useful to run glade from a terminal window, duplicate these steps, and see if anything is reported in the terminal window. That might also give us some clues as to what’s happening.

I suspect thatGtkCellRendererText::variant has something to do with monospace, do you get that message?

glade terminal output here \/ \/ \/

usr_40476@localhost:~> glade -v
GladeUI-Message: 13:41:09.450: 1 missing displayable value for GtkWidget::AtkObject::accessible-role
GladeUI-Message: 13:41:10.039: 5 missing displayable value for GtkCellRendererText::variant
GladeUI-Message: 13:41:10.120: Glade needs artwork; a default icon will be used for the following classes:
        GladeInstantiableGtkBin needs an icon named 'widget-gtk-bin'
        GtkFileChooserNative    needs an icon named 'widget-gtk-filechoosernative'
        GtkApplicationWindow    needs an icon named 'widget-gtk-applicationwindow'
        GThemedIcon     needs an icon named 'widget-gtk-themedicon'
        GFileIcon       needs an icon named 'widget-gtk-fileicon'
GladeUI-Message: 13:41:10.184: No DevHelp installed on your system, devhelp feature will be disabled.
usr_40476@localhost:~> 

I do get that message in my installation as well.

Let’s make sure that monospace fonts are working in GNOME/gtk apps for on on the whole (gedit is a good way to test that). Failing that, I would be inclined to verify and/or reinstall glade and the dependent libraries, unless someone else has an idea that I’m not thinking of.

It does appear to be working properly,


could you provide the list of deps for glade so i know what to reinstall?

I’d probably check on your own system to do this. Here is the easy way I found. There isn’t really an easy way to do this - I would probably do:

$ rpm -qR glade
libc.so.6()(64bit)
libc.so.6(GLIBC_2.14)(64bit)
libc.so.6(GLIBC_2.2.5)(64bit)
libc.so.6(GLIBC_2.3.4)(64bit)
libc.so.6(GLIBC_2.34)(64bit)
libc.so.6(GLIBC_2.4)(64bit)
libc.so.6(GLIBC_2.7)(64bit)
libcairo.so.2()(64bit)
libgdk-3.so.0()(64bit)
libgdk_pixbuf-2.0.so.0()(64bit)
libgio-2.0.so.0()(64bit)
libgjs.so.0()(64bit)
libgladeui-2.so.13()(64bit)
libglib-2.0.so.0()(64bit)
libgmodule-2.0.so.0()(64bit)
libgobject-2.0.so.0()(64bit)
libgtk-3.so.0()(64bit)
libpango-1.0.so.0()(64bit)
libpython3.11.so.1.0()(64bit)
rpmlib(CompressedFileNames) <= 3.0.4-1
rpmlib(FileDigests) <= 4.6.0-1
rpmlib(PartialHardlinkSets) <= 4.0.4-1
rpmlib(PayloadFilesHavePrefix) <= 4.0-1
rpmlib(PayloadIsZstd) <= 5.4.18-1

Then do a check of each package identified (there’s some duplication there) with

$ zypper search --provides "<value>"

For example:

$ zypper search --provides "libc.so.6()(64bit)"
Repository 'Databases' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'NVIDIA' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Repository (NON-OSS)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Repository (OSS)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Update Repository' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'google-chrome' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'microsoft-edge' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Packman' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'snappy' is out-of-date. You can run 'zypper refresh' as root to update it.
Loading repository data...
Reading installed packages...

S  | Name  | Summary                                            | Type
---+-------+----------------------------------------------------+--------
i+ | glibc | Standard Shared Libraries (from the GNU C Library) | package

Sometimes it’s obvious from the name (like rpmlib in the list I showed). Other times, you need to search more explicitly.

It’s possible to chain the commands together - this may work for you:

$ rpm -qR glade | xargs zypper search --provides

For me, that returns:

$ rpm -qR glade | xargs zypper search --provides 
Repository 'Databases' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'NVIDIA' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Repository (NON-OSS)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Repository (OSS)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Main Update Repository' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'google-chrome' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'microsoft-edge' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Packman' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'snappy' is out-of-date. You can run 'zypper refresh' as root to update it.
Loading repository data...
Reading installed packages...

S  | Name                | Summary                                                        | Type
---+---------------------+----------------------------------------------------------------+--------
   | glib2-stage1-devel  | General-Purpose Utility Library                                | package
i+ | glibc               | Standard Shared Libraries (from the GNU C Library)             | package
i+ | libcairo2           | Vector Graphics Library with Cross-Device Output Support       | package
i+ | libgdk_pixbuf-2_0-0 | An image loading library                                       | package
i+ | libgio-2_0-0        | A virtual file system library API                              | package
i+ | libgjs0             | JavaScript bindings based on gobject-introspection and Mozilla | package
i  | libgladeui-2-13     | Core library of the GLADE User Interface Builder               | package
i+ | libglib-2_0-0       | General-Purpose Utility Library                                | package
i+ | libgmodule-2_0-0    | General-Purpose Utility Library -- Library for Modules         | package
i+ | libgobject-2_0-0    | Object-Oriented Framework for C                                | package
i+ | libgtk-3-0          | The GTK+ toolkit library (version 3)                           | package
i+ | libpango-1_0-0      | Library for Layout and Rendering of Text                       | package
i  | libpython3_11-1_0   | Python Interpreter shared library                              | package

But I note that it says that glib2-stage1-devel isn’t installed. It looks like that devel package includes stuff that’s provided by other items in the list, and that’s why it isn’t installed.

What I would then do is run an rpm -V on each of the packages (in the second column) that says it’s installed (an i or i+ in the first column; the i+ means there’s an update available. I’m on Tumbleweed, so I have updates that if you’re on Leap, you won’t have). Or you can just reinstall those packages using YaST or zypper (if you reinstall with zypper, you’ll need to use --force or it’ll just say the package is already installed).

as expected…

usr_40476@localhost:~> rpm -qR glade | xargs zypper search --provides
Repository 'google-chrome' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE:Tumbleweed' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Packman' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Non-Oss' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'Open H.264 Codec (openSUSE Tumbleweed)' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Oss' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'openSUSE-Tumbleweed-Update' is out-of-date. You can run 'zypper refresh' as root to update it.
Repository 'snappy' is out-of-date. You can run 'zypper refresh' as root to update it.
Loading repository data...
Reading installed packages...

S  | Name                | Summary                                                        | Type
---+---------------------+----------------------------------------------------------------+--------
   | glib2-stage1-devel  | General-Purpose Utility Library                                | package
i+ | glibc               | Standard Shared Libraries (from the GNU C Library)             | package
i+ | libcairo2           | Vector Graphics Library with Cross-Device Output Support       | package
i+ | libgdk_pixbuf-2_0-0 | An image loading library                                       | package
i+ | libgio-2_0-0        | A virtual file system library API                              | package
i  | libgjs0             | JavaScript bindings based on gobject-introspection and Mozilla | package
i  | libgladeui-2-13     | Core library of the GLADE User Interface Builder               | package
i+ | libglib-2_0-0       | General-Purpose Utility Library                                | package
i+ | libgmodule-2_0-0    | General-Purpose Utility Library -- Library for Modules         | package
i+ | libgobject-2_0-0    | Object-Oriented Framework for C                                | package
i+ | libgtk-3-0          | The GTK+ toolkit library (version 3)                           | package
i+ | libpango-1_0-0      | Library for Layout and Rendering of Text                       | package
i+ | libpython3_11-1_0   | Python Interpreter shared library                              | package

Ok, Now im confused, what did i do wrong here>?

usr_40476@localhost:~> rpm -qR glade | sudo xargs zypper in --force
Loading repository data...
Reading installed packages...
'rpmlib(CompressedFileNames)<=3.0.4-1' not found in package names. Trying capabilities.
'rpmlib(PayloadFilesHavePrefix)<=4.0-1' not found in package names. Trying capabilities.
'rpmlib(FileDigests)<=4.6.0-1' not found in package names. Trying capabilities.
'rpmlib(PayloadIsZstd)<=5.4.18-1' not found in package names. Trying capabilities.
'rpmlib(PartialHardlinkSets)<=4.0.4-1' not found in package names. Trying capabilities.
'libc.so.6(GLIBC_2.34)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.34)(64bit)' is already installed.
'libc.so.6(GLIBC_2.4)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.4)(64bit)' is already installed.
'libglib-2.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libglib-2_0-0' providing 'libglib-2.0.so.0()(64bit)' is already installed.
'libgobject-2.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libgobject-2_0-0' providing 'libgobject-2.0.so.0()(64bit)' is already installed.
'libcairo.so.2()(64bit)' not found in package names. Trying capabilities.
'libcairo2' providing 'libcairo.so.2()(64bit)' is already installed.
'libgio-2.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libgio-2_0-0' providing 'libgio-2.0.so.0()(64bit)' is already installed.
'libgtk-3.so.0()(64bit)' not found in package names. Trying capabilities.
'libgtk-3-0' providing 'libgtk-3.so.0()(64bit)' is already installed.
'libpango-1.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libpango-1_0-0' providing 'libpango-1.0.so.0()(64bit)' is already installed.
'libc.so.6(GLIBC_2.14)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.14)(64bit)' is already installed.
'libgdk-3.so.0()(64bit)' not found in package names. Trying capabilities.
'libgtk-3-0' providing 'libgdk-3.so.0()(64bit)' is already installed.
'libgdk_pixbuf-2.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libgdk_pixbuf-2_0-0' providing 'libgdk_pixbuf-2.0.so.0()(64bit)' is already installed.
'libc.so.6(GLIBC_2.2.5)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.2.5)(64bit)' is already installed.
'libgmodule-2.0.so.0()(64bit)' not found in package names. Trying capabilities.
'libgmodule-2_0-0' providing 'libgmodule-2.0.so.0()(64bit)' is already installed.
'libpython3.11.so.1.0()(64bit)' not found in package names. Trying capabilities.
'libpython3_11-1_0' providing 'libpython3.11.so.1.0()(64bit)' is already installed.
'libc.so.6(GLIBC_2.7)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.7)(64bit)' is already installed.
'libc.so.6(GLIBC_2.3.4)(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6(GLIBC_2.3.4)(64bit)' is already installed.
'libgjs.so.0()(64bit)' not found in package names. Trying capabilities.
'libgjs0' providing 'libgjs.so.0()(64bit)' is already installed.
'libgladeui-2.so.13()(64bit)' not found in package names. Trying capabilities.
'libgladeui-2-13' providing 'libgladeui-2.so.13()(64bit)' is already installed.
'libc.so.6()(64bit)' not found in package names. Trying capabilities.
'glibc' providing 'libc.so.6()(64bit)' is already installed.
Resolving package dependencies...
Nothing to do.
usr_40476@localhost:~> 

Just had an idea… Are you on X11? maybe someone with Wayland can try this?

You fed the requirements into the xargs command rather than the packages that fulfill the requirements.

Actually…I am on Xorg and not Wayland. It’s possible that might make a difference.

ok, could you please help me with that?

I don’t have a spare machine or the time to try this, perhaps someone else with Wayland is up to try glade?