hello everybody,

I've started to learn pyGTK and glade for a program i'm doing,
and i've run into some problems:

1. Is there no way to change the size of a specific text when using glade? for example, a window title, a label text etc.

2. In the Gnome widgets, when choosing to use a druid, how can you configure the buttons of the wizard? (forward, back, cancel, help) and is there a possible way to change their title and add more buttons?

Tough questions... :rolleyes:
simple answers?

Dani AI

Generated

Quick clarifications for @Avner.H (and follow-ups to and ): labels and window titles are different beasts, and GNOME’s “druid” widget (the GNOME name for a wizard) has a small, fixed set of controls — there are API calls to enable/disable or show/hide them, but renaming or arbitrarily extending those built‑in buttons is not part of the GnomeDruid API. (sources.debian.org)

Label text inside the window can be styled. Pango markup (used by GtkLabel) is the usual, stable way to change font, size and inline style for a label’s text; GtkLabel supports set_markup / markup attributes and Pango’s markup tags. (docs.gtk.org) The window’s titlebar, however, is normally rendered by the window manager (so its font/size follows the user’s theme/WM settings), not the application. For app‑drawn titlebars use client‑side decorations (GtkHeaderBar / gtk_window_set_titlebar) so the title can be a widget the app controls. (developer.gnome.org)

For styling across the app (GTK3+), use a GtkCssProvider and style classes/IDs rather than hardcoding per‑label sizes in code; that makes the UI maintainable and theme‑friendly. Example CSS rule (put in a provider or gtk.css):

label.title { font-size: 18px; font-weight: bold; }

See GtkCssProvider docs for how to load/apply CSS. (docs.gtk.org)

About druids/wizards: the legacy GnomeDruid exposes functions to set button sensitivity and to show the Finish/Help controls, but it’s deprecated. For greater control (add buttons, custom labels, different actions) prefer GtkAssistant — it lets the app add/remove action widgets in the assistant’s action area (gtk_assistant_add_action_widget) so custom buttons (and labels) are straightforward. (sources.debian.org)

Practical notes: ’s markup approach is valid for labels; for a styled window title use a headerbar or place a large label inside the window content; and if targeting Windows, expect some theme/behavior differences (as noted). If needed, share which GTK/Glade/pygtk version is in use and whether the UI runs on X11, Wayland or Windows — that determines the exact technique.

Recommended Answers

All 2 Replies

Using Dev-C++ or Python with Windows, I found GTK one of the more frustrating GUI libraries, but it may work better under Linux. Just my limited opinion.

hello everybody,

I've started to learn pyGTK and glade for a program i'm doing,
and i've run into some problems:

1. Is there no way to change the size of a specific text when using glade? for example, a window title, a label text etc.

The only way I've found to change the text size, is using the set_markup attribute of the label widget.
But you must first enable the markup usage in the label widget properties window in glade.

Check the gtk widgets documentation and look inside the label widget so you see all the methods it has.

GUI.LabelWidget.set_markup('<big><big><big>INSERT YOUR BIG TEXT HERE</big></big></big>')

I hope its not too late hehe. Good luck!

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.